/* ==================== 通用容器样式 ==================== */
.article-hero-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
background: var(--hero-gradient);
    z-index: 0;
}

.article-wrapper {
    position: relative;
    z-index: 1;
    padding-top: 90px;
}

.article-container {
    margin: 20px auto 0;
    max-width: 1100px;
    padding: 0 20px 2rem;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1rem;
    min-height: calc(100vh - 70px);
}

.article-main {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* ==================== 文章/列表 头部 ==================== */
.article-header,
.topic-header {
    padding: 1.5rem 2rem 1rem;
    border-bottom: 2px solid #e2e8f0;
    background: linear-gradient(180deg, rgba(240, 249, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%);
}

.article-header {
    text-align: center;
}

.article-title,
.topic-title {
    font-weight: 700;
    color: #1e293b;
}

.article-title {
    font-size: 1.4rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.topic-title {
    font-size: 1.6rem;
    margin-bottom: 0.3rem;
}

.topic-description {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.2rem;
}

.article-title-divider {
    height: 1px;
    width: 100%;
    max-width: 600px;
    margin: 0.5rem auto 1rem;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(6, 182, 212, 0.3) 20%,
        rgba(6, 182, 212, 0.6) 50%,
        rgba(6, 182, 212, 0.3) 80%,
        transparent 100%
    );
    border-radius: 3px;
}

/* ==================== Meta 信息 ==================== */
.article-meta,
.article-item-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #64748b;
}

.article-meta {
    justify-content: center;
}

.article-item-meta {
    margin-bottom: 0.75rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.article-category,
.meta-category {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    text-decoration: none;
    transition: all 0.2s;
}

.article-category:hover,
.meta-category:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(6, 182, 212, 0.3);
}

.featured-badge {
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    margin-left: 0.5rem;
    box-shadow: 0 2px 6px rgba(255, 193, 7, 0.3);
}

/* ==================== 文章列表 ==================== */
.article-list {
    padding: 0 2rem;
}

.article-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.article-item-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.article-item-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s;
}

.article-item-title a:hover {
    color: #06b6d4;
}

.article-item-excerpt {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-item-link {
    color: #06b6d4;
    font-size: 0.9rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-block;
}

.article-item-link:hover {
    color: #0891b2;
    transform: translateX(3px);
}

/* ==================== 文章内容 ==================== */
.article-content {
    padding: 1.5rem 2rem;
}

.article-body {
    font-size: 1rem;
    line-height: 1.6;
    color: #1e293b;
}

.article-body * {
    font-family: inherit !important;
    background-color: transparent !important;
    text-align: start !important;
}

.article-body p {
    color: #1e293b !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
    margin: 0 0 1rem 0 !important;
    padding: 0 !important;
}

.article-body h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 0.8rem;
    color: #1e293b;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.article-body h2:first-child {
    margin-top: 0;
}

.article-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
    color: #1e293b;
}

.article-body h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.2rem 0 0.4rem;
    color: #1e293b;
}

.article-body ul,
.article-body ol {
    margin: 1rem 0 1rem 1.5rem;
}

.article-body li {
    margin-bottom: 0.4rem;
}

.article-body pre {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
    font-size: 0.85rem;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-body code {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
    padding: 0.15rem 0.3rem;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: 'Courier New', monospace;
}

.article-body pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.article-body blockquote {
    border-left: 4px solid #06b6d4;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #64748b;
    font-style: italic;
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
    padding: 0.8rem 1.2rem;
    border-radius: 0 8px 8px 0;
}

.article-body img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-body table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.article-body table th,
.article-body table td {
    padding: 0.6rem;
    border: 1px solid #e2e8f0;
}

.article-body table th {
    background: #f8fafc;
    font-weight: 600;
}

.article-body table tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.5);
}

.article-body a {
    color: #06b6d4;
    text-decoration: underline;
}

.article-body a:hover {
    color: #0891b2;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

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

.empty-text {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ==================== 侧边栏 ==================== */
.article-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
    align-self: start;
}

.sidebar-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.sidebar-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ==================== 作者信息 ==================== */
.author-card {
    background: white;
    padding: 10px 20px;
}

.author-info {
    text-align: center;
    padding: 0.75rem 0;
}

.author-avatar {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border-radius: 50%;
    margin: 0 auto 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(6, 182, 212, 0.3);
    position: relative;
}

.author-avatar::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    opacity: 0.2;
    z-index: -1;
}

.author-name {
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: #1e293b;
    font-size: 0.95rem;
}

.author-bio {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.4;
}

/* ==================== 快捷导航 ==================== */
.quick-nav-card {
    background: white;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.quick-nav-title {
    font-weight: 600;
    color: #1e293b;
    padding: 1rem 1.25rem 0.5rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-nav-section {
    padding: 0 1.25rem 0.75rem;
}

.quick-nav-section:last-child {
    padding-bottom: 1rem;
}

.quick-nav-category-header {
    text-align: center;
    margin-bottom: 0.5rem;
    position: relative;
}

.quick-nav-category-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
    background: white;
    display: inline-block;
    padding: 0 0.75rem;
    position: relative;
    z-index: 1;
}

.quick-nav-category-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg, 
        #e2e8f0 0%, 
        #06b6d4 50%, 
        #e2e8f0 100%
    );
    z-index: 0;
}

.quick-nav-items-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.quick-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.3rem;
    background: #f8fafc;
    border-radius: 8px;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.2s;
    font-size: 0.8rem;
    border: 1px solid transparent;
    position: relative;
}

.quick-nav-item:hover {
    background: white;
    border-color: #06b6d4;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(6, 182, 212, 0.15);
}

.quick-nav-item-name {
    font-weight: 500;
    color: #1e293b;
    transition: color 0.2s;
}

.quick-nav-item:hover .quick-nav-item-name {
    color: #06b6d4;
}

.quick-nav-section-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0 -1.25rem;
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e2e8f0;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    background: #f8fafc;
    color: #1e293b;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.pagination-btn:hover {
    background: #06b6d4;
    color: white;
}

.pagination-numbers {
    display: flex;
    gap: 0.3rem;
}

.pagination-number {
    min-width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #1e293b;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.pagination-number:hover {
    background: #06b6d4;
    color: white;
}

.pagination-number.active {
    background: #06b6d4;
    color: white;
    font-weight: 600;
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    color: #64748b;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .article-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        min-height: auto;
        margin: 40px auto 0;
    }
    
    .article-sidebar {
        position: static;
        margin-top: 0.2rem;
    }
}

@media (max-width: 768px) {
    .article-wrapper {
        padding-top: 60px;
    }
    
    .article-container {
        padding: 0 12px 1.2rem;
        gap: 1rem;
    }
    
    .article-header,
    .topic-header {
        padding: 0.9rem 1.1rem 0.7rem;
    }
    
    .article-title {
        font-size: 1.15rem;
        line-height: 1.4;
    }
    
    .topic-title {
        font-size: 1.2rem;
        margin-bottom: 0.25rem;
    }
    
    .topic-description {
        font-size: 0.82rem;
        line-height: 1.5;
        margin-bottom: 0.15rem;
    }
    
    .article-title-divider {
        margin: 0.5rem auto 0.7rem;
    }
    
    .article-meta {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        font-size: 0.75rem;
        justify-content: start;
    }
    
    .article-item-meta {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        margin-bottom: 0.6rem;
        font-size: 0.75rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .article-list {
        padding: 0 1.1rem;
    }
    
    .article-item {
        padding: 1.1rem 0;
    }
    
    .article-item-title {
        font-size: 1rem;
        margin-bottom: 0.4rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .article-item-excerpt {
        font-size: 0.86rem;
        line-height: 1.5;
    }
    
    .article-content {
        padding: 0.9rem 1.1rem;
    }
    
    .article-body {
        font-size: 0.92rem;
        line-height: 1.6;
    }
    
    .article-body p {
        font-size: 0.92rem !important;
        line-height: 1.6 !important;
        margin: 0 0 0.8rem 0 !important;
    }
    
    .article-body h2 {
        font-size: 1.25rem;
        margin: 1.4rem 0 0.6rem;
    }
    
    .article-body h3 {
        font-size: 1.1rem;
        margin: 1.2rem 0 0.5rem;
    }
    
    .article-body h4 {
        font-size: 0.98rem;
        margin: 1rem 0 0.4rem;
    }
    
    .sidebar-card {
        padding: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .author-avatar {
        width: 54px;
        height: 54px;
        font-size: 1.35rem;
    }
    
    .author-name {
        font-size: 0.92rem;
    }
    
    .author-bio {
        font-size: 0.78rem;
    }
    
    .quick-nav-title {
        padding: 0.85rem 1rem 0.4rem;
        font-size: 0.92rem;
    }
    
    .quick-nav-section {
        padding: 0 1rem 0.6rem;
    }
    
    .quick-nav-section:last-child {
        padding-bottom: 0.85rem;
    }
    
    .quick-nav-items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }
    
    .quick-nav-item {
        padding: 0.55rem 0.4rem;
        font-size: 0.82rem;
    }
    
    .pagination {
        padding: 1.1rem;
        gap: 0.4rem;
        flex-wrap: wrap;
    }
    
    .pagination-btn {
        font-size: 0.82rem;
        padding: 0.38rem 0.75rem;
    }
    
    .pagination-number {
        min-width: 1.7rem;
        height: 1.7rem;
        font-size: 0.82rem;
    }
}
