/* 文章目录页样式 */
.articles-index {
    min-height: calc(100vh - 200px);
    padding: 4rem 0;
}

.articles-index-header {
    text-align: center;
    margin-bottom: 4rem;
}

.articles-index-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    line-height: 1.2;
}

.articles-index-icon {
    font-size: clamp(2.5rem, 5vw, 4rem);
    display: inline-block;
    line-height: 1;
    /* emoji 保持原样，不受渐变影响 */
    filter: none;
}

.articles-index-text {
    background: var(--gradient-tech, linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.articles-index-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 暗黑模式文章标题字体优化 */
body:not(.light-theme) .articles-index-subtitle,
body.dark-theme .articles-index-subtitle {
    color: #cbd5e1;
    text-shadow: 0 0.5px 0 rgba(255, 255, 255, 0.05), 0 1px 3px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.015em;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body:not(.light-theme) .articles-index-text,
body.dark-theme .articles-index-text {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 20px rgba(99, 102, 241, 0.15);
    letter-spacing: -0.02em;
}

body:not(.light-theme) .articles-index-title,
body.dark-theme .articles-index-title {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 明亮模式文章标题字体优化 */
body.light-theme .articles-index-subtitle {
    color: #64748b;
    text-shadow: none;
}

body.light-theme .articles-index-text {
    text-shadow: none;
}

.articles-catalog {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.article-catalog-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    position: relative;
    overflow: hidden;
}

.article-catalog-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-tech);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.article-catalog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
}

.article-catalog-card:hover::before {
    opacity: 1;
}

.article-catalog-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 60px;
    text-align: center;
    opacity: 0.6;
    font-family: 'Inter', sans-serif;
}

.article-catalog-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.article-catalog-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.article-catalog-category {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    border: 1px solid;
}

.article-catalog-date,
.article-catalog-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.article-catalog-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

.article-catalog-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
}

.article-catalog-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* 暗黑模式文章目录字体优化 */
body:not(.light-theme) .article-catalog-title,
body.dark-theme .article-catalog-title {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 10px rgba(99, 102, 241, 0.1);
    letter-spacing: -0.015em;
    font-weight: 700;
}

body:not(.light-theme) .article-catalog-meta,
body.dark-theme .article-catalog-meta {
    color: #94a3b8;
    text-shadow: 0 0.5px 0 rgba(255, 255, 255, 0.02);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body:not(.light-theme) .article-catalog-date,
body:not(.light-theme) .article-catalog-time,
body.dark-theme .article-catalog-date,
body.dark-theme .article-catalog-time {
    color: #94a3b8;
    text-shadow: 0 0.5px 0 rgba(255, 255, 255, 0.02);
}

body:not(.light-theme) .article-catalog-link,
body.dark-theme .article-catalog-link {
    color: #f1f5f9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

body:not(.light-theme) .article-catalog-link:hover,
body.dark-theme .article-catalog-link:hover {
    color: #a5b4fc;
    text-shadow: 0 1px 3px rgba(99, 102, 241, 0.3), 0 0 15px rgba(99, 102, 241, 0.2);
}

body:not(.light-theme) .article-catalog-number,
body.dark-theme .article-catalog-number {
    color: #818cf8;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    opacity: 0.8;
}

/* 明亮模式文章目录字体优化 */
body.light-theme .article-catalog-title {
    color: #0f172a;
    text-shadow: none;
}

body.light-theme .article-catalog-meta {
    color: #64748b;
}

.loading-spinner {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.no-articles,
.error-message {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* 明亮主题下的文章目录样式 */
body.light-theme .article-catalog-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body.light-theme .article-catalog-card:hover {
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.12);
    border-color: var(--primary-color);
}

body.light-theme .article-catalog-link {
    color: var(--text-primary);
}

body.light-theme .article-catalog-link:hover {
    color: var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .articles-index {
        padding: 3rem 0;
    }
    
    .articles-index-title {
        font-size: clamp(2rem, 5vw, 3rem);
    }
    
    .articles-index-subtitle {
        font-size: 1.125rem;
    }
    
    .article-catalog-card {
        padding: 1.75rem;
        gap: 1.5rem;
    }
    
    .article-catalog-title {
        font-size: 1.375rem;
    }
}

@media (max-width: 768px) {
    .articles-index {
        padding: 2rem 0;
    }
    
    .articles-index-header {
        margin-bottom: 2rem;
    }
    
    .articles-index-title {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .articles-index-icon {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
    }
    
    .articles-index-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .articles-catalog {
        gap: 1.25rem;
    }
    
    .article-catalog-card {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .article-catalog-number {
        min-width: auto;
        text-align: left;
        font-size: 1.5rem;
    }
    
    .article-catalog-title {
        font-size: 1.25rem;
    }
    
    .article-catalog-meta {
        font-size: 0.8rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .article-catalog-category {
        font-size: 0.8125rem;
        padding: 0.35rem 0.875rem;
    }
}

@media (max-width: 480px) {
    .articles-index {
        padding: 1.5rem 0;
    }
    
    .articles-index-header {
        margin-bottom: 1.5rem;
    }
    
    .articles-index-title {
        font-size: clamp(1.5rem, 7vw, 2rem);
    }
    
    .articles-index-icon {
        font-size: clamp(1.5rem, 7vw, 2rem);
    }
    
    .articles-index-subtitle {
        font-size: 0.9375rem;
        padding: 0 0.5rem;
    }
    
    .articles-catalog {
        gap: 1rem;
    }
    
    .article-catalog-card {
        padding: 1.25rem;
        gap: 0.75rem;
    }
    
    .article-catalog-number {
        font-size: 1.25rem;
    }
    
    .article-catalog-title {
        font-size: 1.125rem;
    }
    
    .article-catalog-meta {
        font-size: 0.75rem;
    }
    
    .article-catalog-category {
        font-size: 0.75rem;
        padding: 0.3rem 0.75rem;
    }
}

/* 文章详情页通用样式 */
.article-detail {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 20px;
}

.article-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.article-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.article-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.95rem;
}

.article-back:hover {
    color: var(--primary-color);
}

.article-category-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-left: auto;
    margin-right: 0;
}

.article-detail-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

/* 黑暗主题下的文章标题优化 */
body:not(.light-theme) .article-detail-title,
body.dark-theme .article-detail-title {
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), 0 0 30px rgba(99, 102, 241, 0.2);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    letter-spacing: -0.01em;
    font-weight: 750;
}

.article-meta-info {
    display: flex;
    gap: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.article-toc {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.article-toc h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.article-toc ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.article-toc li {
    margin-bottom: 0.75rem;
}

.article-toc a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.article-toc a:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    transform: translateX(4px);
}

.article-toc a::before {
    content: '▸';
    color: var(--primary-color);
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.article-toc a:hover::before {
    transform: translateX(2px);
}

/* 黑暗主题下的目录美化 */
body:not(.light-theme) .article-toc,
body.dark-theme .article-toc {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.9) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body:not(.light-theme) .article-toc h3,
body.dark-theme .article-toc h3 {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    border-bottom-color: rgba(99, 102, 241, 0.3);
    background: linear-gradient(90deg, transparent 0%, rgba(99, 102, 241, 0.1) 50%, transparent 100%);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

body:not(.light-theme) .article-toc a,
body.dark-theme .article-toc a {
    color: #cbd5e1;
}

body:not(.light-theme) .article-toc a:hover,
body.dark-theme .article-toc a:hover {
    color: #93c5fd;
    background: rgba(99, 102, 241, 0.15);
}

body:not(.light-theme) .article-toc a::before,
body.dark-theme .article-toc a::before {
    color: #6366f1;
}

.article-content {
    line-height: 1.9;
    font-size: 1.05rem;
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.article-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
    scroll-margin-top: 100px;
    position: relative;
}

/* 明亮主题下的h2样式 */
body.light-theme .article-content h2 {
    border-left: none;
    background: none;
    padding: 0.75rem 0;
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    scroll-margin-top: 100px;
}

.article-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.article-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.9;
    text-align: justify;
}

.article-content ul, .article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2.5rem;
    color: var(--text-secondary);
}

.article-content li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.article-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.article-content code {
    background: var(--bg-card);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', 'Consolas', 'Monaco', 'Menlo', monospace;
    font-size: 0.9em;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.article-content pre {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.article-content pre code {
    background: transparent;
    padding: 0;
    color: var(--text-primary);
    border: none;
    font-size: 0.9rem;
    line-height: 1.6;
    display: block;
}

/* 代码复制按钮 */
.code-copy-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.article-content pre:hover .code-copy-btn {
    opacity: 1;
}

.code-copy-btn:hover {
    background: var(--primary-dark);
}

.code-copy-btn:active {
    transform: scale(0.95);
}

.code-copy-btn.copied {
    background: #10b981;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    color: var(--text-secondary);
    font-style: italic;
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.article-content .diagram {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}

.article-content .diagram svg {
    max-width: 100%;
    height: auto;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

.article-content table th,
.article-content table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.article-content table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.article-content table tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

/* 明亮主题优化 */
body.light-theme .article-content {
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body.light-theme .article-content p,
body.light-theme .article-content li {
    color: #475569;
    line-height: 1.75;
    letter-spacing: 0.005em;
}

body.light-theme .article-content code {
    background: #f1f5f9;
    color: #6366f1;
    border-color: #e2e8f0;
}

body.light-theme .article-content pre {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body.light-theme .article-content pre code {
    color: #1e293b;
}

body.light-theme .article-content h2,
body.light-theme .article-content h3,
body.light-theme .article-content h4 {
    color: #0f172a;
    text-shadow: none;
    letter-spacing: -0.015em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 黑暗主题优化（默认主题） */
body:not(.light-theme) .article-content,
body.dark-theme .article-content {
    color: #f8fafc;
    text-shadow: 0 0.5px 0 rgba(255, 255, 255, 0.05);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1;
    font-kerning: normal;
}

body:not(.light-theme) .article-content p,
body.dark-theme .article-content p {
    color: #e2e8f0;
    line-height: 1.85;
    letter-spacing: 0.015em;
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
}

body:not(.light-theme) .article-content li,
body.dark-theme .article-content li {
    color: #e2e8f0;
    line-height: 1.9;
    letter-spacing: 0.01em;
    margin-bottom: 0.5rem;
}

body:not(.light-theme) .article-content ul,
body:not(.light-theme) .article-content ol,
body.dark-theme .article-content ul,
body.dark-theme .article-content ol {
    margin-bottom: 1.5rem;
}

body:not(.light-theme) .article-content code,
body.dark-theme .article-content code {
    background: #1e293b;
    color: #93c5fd;
    border-color: #334155;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    font-size: 0.9em;
}

body:not(.light-theme) .article-content pre,
body.dark-theme .article-content pre {
    background: #0f172a;
    border-color: #1e293b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border-width: 1px;
}

body:not(.light-theme) .article-content pre code,
body.dark-theme .article-content pre code {
    color: #e2e8f0;
    font-weight: 400;
    font-size: 0.9rem;
    line-height: 1.7;
    text-shadow: none;
}

body:not(.light-theme) .article-content h2,
body.dark-theme .article-content h2 {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 0 20px rgba(99, 102, 241, 0.2);
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    line-height: 1.3;
    position: relative;
    padding-left: 1rem;
    border-left: 4px solid #6366f1;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
    padding: 0.75rem 1rem;
    border-radius: 6px;
}

body:not(.light-theme) .article-content h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

body:not(.light-theme) .article-content h3,
body.dark-theme .article-content h3 {
    color: #f1f5f9;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 15px rgba(99, 102, 241, 0.15);
    font-weight: 650;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.35;
    position: relative;
    padding-left: 0.75rem;
    border-left: 3px solid #8b5cf6;
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.08) 0%, transparent 100%);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
}

body:not(.light-theme) .article-content h4,
body.dark-theme .article-content h4 {
    color: #f1f5f9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    position: relative;
    padding-left: 0.5rem;
    border-left: 2px solid #a78bfa;
    background: linear-gradient(90deg, rgba(167, 139, 250, 0.06) 0%, transparent 100%);
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
}

body:not(.light-theme) .article-content strong,
body.dark-theme .article-content strong {
    color: #ffffff;
    font-weight: 650;
}

body:not(.light-theme) .article-content a,
body.dark-theme .article-content a {
    color: #60a5fa;
    text-decoration: none;
    border-bottom: 1px solid rgba(96, 165, 250, 0.3);
    transition: color 0.2s ease, border-color 0.2s ease;
}

body:not(.light-theme) .article-content a:hover,
body.dark-theme .article-content a:hover {
    color: #93c5fd;
    border-bottom-color: rgba(147, 197, 253, 0.5);
}

body:not(.light-theme) .article-content blockquote,
body.dark-theme .article-content blockquote {
    border-left-color: #60a5fa;
    background: rgba(15, 23, 42, 0.5);
    color: #cbd5e1;
}

body:not(.light-theme) .article-content table,
body.dark-theme .article-content table {
    border-color: #334155;
}

body:not(.light-theme) .article-content table th,
body.dark-theme .article-content table th {
    background: #1e293b;
    color: #ffffff;
    font-weight: 650;
    border-color: #334155;
}

body:not(.light-theme) .article-content table td,
body.dark-theme .article-content table td {
    color: #e2e8f0;
    border-color: #334155;
}

body:not(.light-theme) .article-content table tr:hover,
body.dark-theme .article-content table tr:hover {
    background: rgba(30, 41, 59, 0.5);
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: calc(1rem + 56px);
    left: max(20px, calc((100vw - 1000px) / 2 - 80px));
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: 
        0 4px 20px rgba(99, 102, 241, 0.4),
        0 0 0 0 rgba(99, 102, 241, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                visibility 0.4s;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px) scale(0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

/* top文字 */
.back-to-top .text-top {
    display: inline-block;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ↑符号 */
.back-to-top .arrow-up {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% + 10px));
    display: inline-block;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

/* hover时显示↑，隐藏top */
.back-to-top:hover .text-top {
    opacity: 0;
    transform: translateY(-10px);
}

.back-to-top:hover .arrow-up {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.back-to-top::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.back-to-top:hover::before {
    width: 300px;
    height: 300px;
}

.back-to-top.show {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    animation: fadeInBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.back-to-top:not(.show) {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.3s;
}

@keyframes fadeInBounce {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.6);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-8px) scale(1.05);
    }
    70% {
        transform: translateY(2px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.back-to-top:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 8px 30px rgba(99, 102, 241, 0.6),
        0 0 0 8px rgba(99, 102, 241, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #22d3ee 100%);
}

.back-to-top:active {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 4px 20px rgba(99, 102, 241, 0.5),
        0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* 明亮主题下的回到顶部按钮 */
body.light-theme .back-to-top {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
    box-shadow: 
        0 4px 20px rgba(99, 102, 241, 0.35),
        0 0 0 0 rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

body.light-theme .back-to-top:hover {
    box-shadow: 
        0 8px 30px rgba(99, 102, 241, 0.5),
        0 0 0 8px rgba(99, 102, 241, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #22d3ee 100%);
}

/* 跳转到底部按钮 */
.back-to-bottom {
    position: fixed;
    bottom: 1rem;
    left: max(20px, calc((100vw - 1000px) / 2 - 80px));
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 50%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: 
        0 4px 20px rgba(6, 182, 212, 0.4),
        0 0 0 0 rgba(6, 182, 212, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                visibility 0.4s;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

.back-to-bottom.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    animation: fadeInBounceBottom 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.back-to-bottom:not(.show) {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.3s;
}

@keyframes fadeInBounceBottom {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.6);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-5px) scale(1.05);
    }
    70% {
        transform: translateY(2px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* bottom文字 */
.back-to-bottom .text-bottom {
    display: inline-block;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ↓符号 */
.back-to-bottom .arrow-down {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% - 10px));
    display: inline-block;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

/* hover时显示↓，隐藏bottom */
.back-to-bottom:hover .text-bottom {
    opacity: 0;
    transform: translateY(10px);
}

.back-to-bottom:hover .arrow-down {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.back-to-bottom::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.back-to-bottom:hover::before {
    width: 300px;
    height: 300px;
}

.back-to-bottom:hover {
    transform: translateY(5px) scale(1.05);
    box-shadow: 
        0 8px 30px rgba(6, 182, 212, 0.6),
        0 0 0 8px rgba(6, 182, 212, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #22d3ee 0%, #a78bfa 50%, #818cf8 100%);
}

.back-to-bottom:active {
    transform: translateY(2px) scale(1.02);
    box-shadow: 
        0 4px 20px rgba(6, 182, 212, 0.5),
        0 0 0 4px rgba(6, 182, 212, 0.15);
}

/* 明亮主题下的跳转到底部按钮 */
body.light-theme .back-to-bottom {
    background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 50%, #6366f1 100%);
    box-shadow: 
        0 4px 20px rgba(6, 182, 212, 0.35),
        0 0 0 0 rgba(6, 182, 212, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

body.light-theme .back-to-bottom:hover {
    box-shadow: 
        0 8px 30px rgba(6, 182, 212, 0.5),
        0 0 0 8px rgba(6, 182, 212, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #22d3ee 0%, #a78bfa 50%, #818cf8 100%);
}

/* 当屏幕宽度小于1200px时，按钮回到右下角 */
@media (max-width: 1200px) {
    .back-to-top {
        left: auto;
        right: 2rem;
        bottom: calc(1rem + 56px);
    }
    
    .back-to-bottom {
        left: auto;
        right: 2rem;
    }
}

@media (max-width: 1024px) {
    .article-detail {
        padding: 2rem 20px;
        max-width: 900px;
    }
    
    .article-detail-title {
        font-size: clamp(2rem, 5vw, 2.5rem);
    }
    
    .article-content {
        font-size: 1.05rem;
    }
    
    .article-content h2 {
        font-size: 1.75rem;
    }
    
    .article-content h3 {
        font-size: 1.375rem;
    }
    
    .article-toc {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .article-detail {
        padding: 1.5rem 15px;
    }
    
    .article-header {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }
    
    .article-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .article-category-badge {
        margin-left: 0;
        margin-right: 0;
    }
    
    .article-detail-title {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }
    
    .article-meta-info {
        flex-direction: column;
        gap: 0.75rem;
        font-size: 0.875rem;
    }
    
    .article-toc {
        padding: 1.25rem;
        margin-bottom: 2rem;
    }
    
    .article-toc h3 {
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }
    
    .article-content {
        font-size: 1rem;
        line-height: 1.8;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
        margin-top: 2.5rem;
        margin-bottom: 1rem;
        padding: 0.5rem 0.75rem;
    }
    
    .article-content h3 {
        font-size: 1.25rem;
        margin-top: 2rem;
        padding: 0.4rem 0.6rem;
    }
    
    .article-content h4 {
        font-size: 1.125rem;
        margin-top: 1.5rem;
        padding: 0.35rem 0.5rem;
    }
    
    .article-content p {
        font-size: 1rem;
        margin-bottom: 1.25rem;
    }
    
    .article-content ul,
    .article-content ol {
        padding-left: 1.75rem;
        margin-bottom: 1.25rem;
    }
    
    .article-content pre {
        padding: 1rem;
        margin: 1.5rem 0;
        border-radius: 8px;
    }
    
    .article-content pre code {
        font-size: 0.85rem;
    }
    
    .article-content blockquote {
        padding: 1rem 1.25rem;
        margin: 1.5rem 0;
    }
    
    .article-content img {
        margin: 1.5rem 0;
        border-radius: 8px;
    }
    
    .article-content table {
        font-size: 0.9rem;
        margin: 1.5rem 0;
    }
    
    .article-content table th,
    .article-content table td {
        padding: 0.75rem;
    }
    
    .back-to-top {
        bottom: calc(0.5rem + 50px);
        left: auto;
        right: 1.5rem;
        width: 50px;
        height: 50px;
        font-size: 0.7rem;
    }
    
    .back-to-bottom {
        bottom: 0.5rem;
        left: auto;
        right: 1.5rem;
        width: 50px;
        height: 50px;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .article-detail {
        padding: 1.25rem 12px;
    }
    
    .article-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .article-detail-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .article-meta-info {
        font-size: 0.8125rem;
    }
    
    .article-toc {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .article-toc h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .article-toc a {
        padding: 0.4rem 0.6rem;
        font-size: 0.875rem;
    }
    
    .article-content {
        font-size: 0.9375rem;
        line-height: 1.75;
    }
    
    .article-content h2 {
        font-size: 1.375rem;
        margin-top: 2rem;
        padding: 0.4rem 0.6rem;
    }
    
    .article-content h3 {
        font-size: 1.125rem;
        margin-top: 1.5rem;
        padding: 0.35rem 0.5rem;
    }
    
    .article-content h4 {
        font-size: 1rem;
        margin-top: 1.25rem;
        padding: 0.3rem 0.4rem;
    }
    
    .article-content p {
        font-size: 0.9375rem;
        margin-bottom: 1rem;
    }
    
    .article-content ul,
    .article-content ol {
        padding-left: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .article-content li {
        margin-bottom: 0.5rem;
    }
    
    .article-content code {
        font-size: 0.85em;
        padding: 0.15rem 0.4rem;
    }
    
    .article-content pre {
        padding: 0.875rem;
        margin: 1.25rem 0;
    }
    
    .article-content pre code {
        font-size: 0.8rem;
        line-height: 1.6;
    }
    
    .code-copy-btn {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .article-content blockquote {
        padding: 0.875rem 1rem;
        margin: 1.25rem 0;
        border-left-width: 3px;
    }
    
    .article-content img {
        margin: 1.25rem 0;
        border-radius: 6px;
    }
    
    .article-content table {
        font-size: 0.85rem;
        margin: 1.25rem 0;
        display: block;
        overflow-x: auto;
    }
    
    .article-content table th,
    .article-content table td {
        padding: 0.6rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .back-to-top,
    .back-to-bottom {
        width: 45px;
        height: 45px;
        font-size: 0.65rem;
        right: 1rem;
    }
    
    .back-to-top {
        bottom: calc(0.5rem + 45px);
    }
}

