/* Component Styles - Complete UI System */

/* ========== Two-Column Article Layout ========== */
.article-layout {
    max-width: 1140px;
    margin: 0 auto;
    padding: 3rem 1.5rem 2rem;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* ========== Left Sidebar ========== */
.article-sidebar {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-widget {
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
}

.widget-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Categories Widget - With Gradient */
.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-primary);
    transition: all 0.2s;
    font-size: 0.875rem;
}

.category-link:hover,
.category-link.active {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.15), rgba(94, 234, 212, 0.1));
    color: var(--color-brand);
}

.category-count {
    font-size: 0.75rem;
    color: var(--color-secondary);
    background: rgba(0, 0, 0, 0.05);
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
}

.no-category {
    color: var(--color-secondary);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

/* Recent Posts Widget - With Gradient */
.recent-posts-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-posts-list li {
    margin-bottom: 0.75rem;
}

.recent-post-link {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    text-decoration: none;
    color: var(--color-primary);
    transition: all 0.2s;
    font-size: 0.8125rem;
    line-height: 1.4;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

.recent-post-link:hover {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.12), rgba(94, 234, 212, 0.08));
    color: var(--color-brand);
}

.recent-post-date {
    flex-shrink: 0;
    color: var(--color-secondary);
    font-size: 0.75rem;
    font-weight: 600;
}

.recent-post-title {
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.no-posts {
    color: var(--color-secondary);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

/* Tags Widget */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-item {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--color-primary);
    font-size: 0.75rem;
    text-decoration: none;
    transition: all 0.2s;
}

.tag-item:hover {
    background: var(--color-brand);
    color: white;
    border-color: var(--color-brand);
}

/* TOC Widget */
.toc-list {
    font-size: 0.875rem;
}

.toc-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-item {
    margin-bottom: 0.5rem;
}

.toc-link {
    display: block;
    padding: 0.4rem 0.75rem;
    color: var(--color-primary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1.4;
    border-bottom: none !important;
}

.toc-link:hover,
.toc-link.active {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.12), rgba(94, 234, 212, 0.08));
    color: var(--color-brand);
    border-bottom: none !important;
}

.toc-level-h1 .toc-link {
    font-weight: 700;
    font-size: 0.9375rem;
}

.toc-level-h2 {
    padding-left: 0;
}

.toc-level-h3 .toc-link {
    padding-left: 1.25rem;
    font-size: 0.8125rem;
}

.toc-level-h4 .toc-link {
    padding-left: 1.75rem;
    font-size: 0.75rem;
    color: var(--color-secondary);
}

.no-toc {
    color: var(--color-secondary);
    font-size: 0.8125rem;
    margin: 0;
}

/* Back to Top Button */
.back-to-top-btn {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-md);
}

.back-to-top-btn:hover {
    background: var(--color-brand);
    color: white;
    transform: translateY(-2px);
}

.back-to-top-btn span:first-child {
    font-size: 1.25rem;
    font-weight: 700;
}

.btn-text {
    font-size: 0.75rem;
    font-weight: 500;
}

/* ========== Main Article Area ========== */
.article-main {
    flex: 1;
    backdrop-filter: blur(4px);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
    overflow-x: hidden;
}

.article-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.article-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0 0 1rem 0;
    line-height: 1.2;
    word-wrap: break-word;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.article-tag {
    font-size: 0.875rem;
    color: var(--color-secondary);
}

.article-date {
    font-size: 0.875rem;
    color: var(--color-secondary);
}

/* ========== Timeline (Homepage/Archive) ========== */
.blog-timeline {
    width: 100%;
}

.blog-year-group {
    margin-bottom: 3rem;
}

.blog-year-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.blog-year-label {
    width: 44px;
    font-weight: 500;
    color: var(--color-primary);
}

.blog-year-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #D9D9D9;
}

.blog-year-count {
    font-size: 0.875rem;
    color: var(--color-secondary);
}

.blog-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.blog-item-date {
    width: 44px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-secondary);
}

.blog-item-dot-container {
    position: relative;
    width: 8px;
    height: 8px;
}

.blog-item-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--color-secondary);
    transition: all 0.3s;
}

.blog-item:hover .blog-item-dot {
    background: var(--color-brand);
    height: 16px;
}

.blog-item-short-line {
    position: absolute;
    bottom: 16px;
    width: 1px;
    height: 20px;
    background: #e5e5e5;
}

.blog-item-title {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-primary);
    transition: all 0.3s;
}

.blog-item:hover .blog-item-title {
    color: var(--color-brand);
    transform: translateX(0.5rem);
}

.blog-item-tags {
    display: flex;
    gap: 0.5rem;
}

.blog-item-tag {
    font-size: 0.875rem;
    color: var(--color-secondary);
}

/* ========== Comments Section ========== */
.comments-area {
    margin-top: 3rem;
}

.comments-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 2rem;
    text-align: center;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.comment-body {
    background: var(--bg-glass);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-light);
}

.comment-author {
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.comment-meta {
    font-size: 0.8125rem;
    color: var(--color-secondary);
    margin-bottom: 1rem;
}

.comment-content {
    line-height: 1.7;
}

/* Comment Form */
.comment-reply-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.comment-form-custom {
    background: var(--bg-glass);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-light);
}

.comment-notes {
    font-size: 0.875rem;
    color: var(--color-secondary);
    margin-bottom: 1.5rem;
}

.comment-form-comment label,
.comment-form-author label,
.comment-form-email label,
.comment-form-url label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-primary);
}

.comment-form-comment textarea,
.comment-form-author input,
.comment-form-email input,
.comment-form-url input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    transition: all 0.2s;
    font-family: inherit;
    color: var(--color-primary);
}

.comment-form-comment textarea:focus,
.comment-form-author input:focus,
.comment-form-email input:focus,
.comment-form-url input:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.form-submit {
    margin-top: 1.5rem;
}

.submit {
    background: var(--color-brand);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.submit:hover {
    background: var(--color-brand-dark);
    transform: translateY(-2px);
}

/* Pagination - WordPress Default Structure Fix */
.navigation.pagination {
    margin-top: 3rem;
    width: 100%;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.5rem;
    border-radius: 10px;
    background: var(--bg-glass);
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid var(--border-light);
    font-size: 0.875rem;
}

.page-numbers:hover,
.page-numbers.current {
    background: var(--color-brand);
    color: white;
    border-color: var(--color-brand);
    transform: translateY(-2px);
}

/* Share Buttons & Link Copy - Enhanced Specificity */
.share-buttons,
.share-link-container {
    display: flex !important;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    justify-content: center;
}

button.share-btn,
button.share-link-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
    cursor: pointer;
    line-height: 1.5;
}

button.share-btn:hover,
button.share-link-btn:hover {
    background: var(--color-brand);
    color: white;
    transform: translateY(-2px);
}

.share-link-btn svg {
    width: 18px;
    height: 18px;
}

/* Footer Styles - Left Aligned & Small Text */
.site-footer {
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
    font-size: 0.75rem;
    /* Small text */
    color: var(--color-secondary);
    text-align: left;
    /* Left aligned */
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav-list a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-nav-list a:hover {
    color: var(--color-brand);
}

.footer-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-info p {
    margin: 0;
    line-height: 1.6;
}

.footer-copyright {
    margin-top: 0.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-copyright a {
    color: var(--color-primary);
    text-decoration: none;
}

.footer-copyright a:hover {
    color: var(--color-brand);
}

/* Mobile Optimizations */
@media (max-width: 1024px) {
    .article-layout {
        flex-direction: column;
        padding: 2rem 1rem;
    }

    /* Hide sidebar on mobile */
    .article-sidebar {
        display: none;
    }

    .article-main {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .article-card {
        padding: 1.5rem;
    }

    .article-title {
        font-size: 1.75rem;
    }

    .card {
        padding: 1.25rem;
        border-radius: 24px;
    }

    /* 移动端横向溢出保护 */
    .article-main,
    .article-card,
    .card {
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* 触摸目标优化 */
    .category-link,
    .recent-post-link,
    .toc-link,
    .tag-item,
    .page-numbers,
    .share-btn,
    .share-link-btn {
        min-height: 44px;
    }
}

/* Breadcrumbs Navigation */
.breadcrumbs {
    max-width: 1140px;
    margin: 1rem auto 0;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.breadcrumbs a {
    color: var(--color-secondary);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

.breadcrumbs a:hover {
    color: var(--color-brand);
}

.breadcrumbs .separator {
    color: var(--color-tertiary);
    font-size: 0.75rem;
}

.breadcrumbs .current {
    color: var(--color-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

@media (max-width: 768px) {
    .breadcrumbs {
        margin: 1rem;
        padding: 0.75rem 1rem;
        font-size: 0.8125rem;
    }

    .breadcrumbs .current {
        max-width: 150px;
    }
}