/* ============================================================
   MODULE.CSS v3.0 - 组件样式
   ============================================================
   匹配 Section 模板:
   - AuthorBoxSection / AuthorProfileSection / AuthorPostsListSection / MainAuthorsSection
   - FaqSection
   - SidebarWidgetsSection
   - PaginationSection
   - SearchBoxSection / SearchResultsSection
   - Error404Section
   - LegalArticleSection
   - PostListSection / RelatedPostsSection
   - SocialShareSection
   ============================================================ */

/* Conservative sharp-edges identity variables */
:root{
    --color-bg-soft: #f4f7fb;
    --color-bg-muted: #e9eef6;
    --color-bg: #eef2f7;
    --color-text: #111827;
    --color-text-light: #6b7280;

    --color-primary: #1f6feb;
    --color-primary-dark: #1756b6;
    --color-primary-darker: #0f3d8a;

    --color-accent: #ff4d2e;
    --color-success: #12b76a;

    --color-border: #cfe0ff;
    --color-border-soft: #d9e2ef;

    --radius-pill: 9999px;
    --radius-lg: 6px;
    --radius-sm: 3px;

    --shadow-sm: 4px 4px 0 rgba(15, 61, 138, 0.22);
    --shadow-md: 4px 4px 0 rgba(17, 24, 39, 0.10), 8px 8px 0 rgba(15, 61, 138, 0.08);
    --shadow-lg: 4px 4px 0 rgba(15, 61, 138, 0.22), 10px 10px 0 rgba(17, 24, 39, 0.06);
    --shadow-xl: 4px 4px 0 rgba(255, 77, 46, 0.18), 12px 12px 0 rgba(15, 61, 138, 0.10);

    --transition-fast: 0.15s;
    --transition-base: 0.15s;
    --transition-slow: 0.22s;
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
}

/* ============================================
   1. Author Profile (AuthorProfileSection)
   ============================================ */
.author-profile {
    background: linear-gradient(135deg, #ffffff 0%, #eef2f7 45%, #f4f7fb 100%);
}

.author-profile h1 {
    color: var(--color-primary-darker);
    text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}

.author-profile img.rounded-circle {
    border: 4px solid #ffffff;
    box-shadow: 4px 4px 0 rgba(15, 61, 138, 0.18), 8px 8px 0 rgba(17, 24, 39, 0.06);
}

.author-profile .badge.bg-light {
    background: var(--color-bg-muted) !important;
    color: var(--color-text) !important;
    border: 2px solid rgba(15, 61, 138, 0.12);
    transition: all var(--transition-fast);
    border-radius: 2px;
}

.author-profile .badge.bg-light:hover {
    background: var(--color-primary) !important;
    color: #fff !important;
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   2. Author Box (AuthorBoxSection)
   ============================================ */
.author-box {
    border-inline-start: 4px solid var(--color-accent);
    transition: all var(--transition-fast);
    border-radius: 0;
}

.author-box:hover {
    box-shadow: 4px 4px 0 rgba(15, 61, 138, 0.20), 8px 8px 0 rgba(17, 24, 39, 0.06);
}

.author-box img {
    transition: transform var(--transition-fast), filter var(--transition-fast);
}

.author-box:hover img {
    transform: scale(1.05);
    filter: saturate(1.05) contrast(1.03);
}

/* ============================================
   3. Author Posts List (AuthorPostsListSection)
   ============================================ */
.author-posts-list .card {
    transition: all var(--transition-fast);
    overflow: hidden;
    border-radius: 0;
    border: 2px solid rgba(15, 61, 138, 0.12);
    background: #fff;
    box-shadow: 0 0 0 rgba(0,0,0,0);
}

.author-posts-list .card:hover {
    transform: translateY(-5px);
    box-shadow: 4px 4px 0 rgba(15, 61, 138, 0.24), 10px 10px 0 rgba(17, 24, 39, 0.06);
    border-color: rgba(31, 111, 235, 0.55);
}

.author-posts-list .card-img-top {
    transition: transform var(--transition-slow), filter var(--transition-fast);
}

.author-posts-list .card:hover .card-img-top {
    transform: scale(1.05);
    filter: saturate(1.1);
}

/* ============================================
   4. Main Authors (MainAuthorsSection)
   ============================================ */
.main-authors-section {
    background: linear-gradient(180deg, #f4f7fb 0%, #eef2f7 100%);
}

.author-card {
    transition: all var(--transition-fast);
    border: 2px solid var(--color-border-soft);
    border-radius: 0;
    background: #fff;
}

.author-card:hover {
    transform: translateY(-8px);
    box-shadow: 4px 4px 0 rgba(255, 77, 46, 0.18), 12px 12px 0 rgba(15, 61, 138, 0.10);
    border-color: rgba(31, 111, 235, 0.55);
}

.author-card img.rounded-circle {
    border: 3px solid var(--color-bg-muted);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    border-radius: 0;
    box-shadow: none;
}

.author-card:hover img.rounded-circle {
    border-color: var(--color-primary);
    box-shadow: 4px 4px 0 rgba(15, 61, 138, 0.18);
}

/* ============================================
   5. FAQ (FaqSection) - <details>/<summary>
   ============================================ */
.faq-section {
    background: linear-gradient(180deg, #eef2f7 0%, #ffffff 100%);
    border-top: 2px solid rgba(15, 61, 138, 0.10);
    border-bottom: 2px solid rgba(15, 61, 138, 0.10);
}

.faq-section h2 {
    font-size: 1.75rem;
    color: var(--color-primary-darker);
    text-shadow: 0 1px 0 rgba(255,255,255,0.75);
}

/* FAQ item */
.faq-list .faq-item {
    border: 2px solid rgba(17, 24, 39, 0.06);
    transition: all var(--transition-fast);
    cursor: pointer;
    border-radius: 0;
    background: #fff;
}

.faq-list .faq-item:hover {
    box-shadow: 4px 4px 0 rgba(15, 61, 138, 0.18) !important, 8px 8px 0 rgba(17, 24, 39, 0.05) !important;
    transform: translateY(-2px);
    border-color: rgba(31, 111, 235, 0.45);
}

.faq-list .faq-item[open] {
    border-color: rgba(31, 111, 235, 0.55);
    background: linear-gradient(90deg, #dbeafe 0%, #ffffff 55%, #ffffff 100%);
    box-shadow: 4px 4px 0 rgba(31, 111, 235, 0.18), 10px 10px 0 rgba(17, 24, 39, 0.05);
}

/* summary */
.faq-list .faq-item summary {
    list-style: none;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1.6;
    padding-inline-end: 2rem;
    position: relative;
    user-select: none;
}

.faq-list .faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-list .faq-item summary::marker {
    content: '';
}

.faq-list .faq-item summary::after {
    content: '+';
    position: absolute;
    inset-inline-end: 0.25rem;
    inset-block-start: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--color-primary);
    transition: transform var(--transition-fast), color var(--transition-fast);
    line-height: 1;
    text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}

.faq-list .faq-item[open] summary::after {
    content: '−';
    transform: translateY(-50%) rotate(180deg);
    color: var(--color-accent);
}

/* Q number */
.faq-list .faq-q-num {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-primary);
    text-shadow: 0 1px 0 rgba(255,255,255,0.65);
}

/* Answer */
.faq-list .faq-answer {
    font-size: 0.95rem;
    line-height: 1.8;
    animation: faqFadeIn var(--transition-fast);
}

@keyframes faqFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
        filter: blur(0.5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* ============================================
   6. Sidebar Widgets (SidebarWidgetsSection)
   ============================================ */
.sidebar-widgets .card {
    transition: all var(--transition-fast);
    border-radius: 0;
    border: 2px solid rgba(15, 61, 138, 0.10);
    background: #fff;
}

.sidebar-widgets .card:hover {
    box-shadow: 4px 4px 0 rgba(15, 61, 138, 0.18), 10px 10px 0 rgba(17, 24, 39, 0.05);
    border-color: rgba(31, 111, 235, 0.45);
}

.sidebar-widgets h5 {
    color: var(--color-primary-darker);
    text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}

.sidebar-widgets .badge {
    transition: all var(--transition-fast);
    cursor: pointer;
    border-radius: 2px;
    border: 2px solid rgba(15, 61, 138, 0.12);
}

.sidebar-widgets .badge:hover {
    background-color: var(--color-primary) !important;
    color: #fff !important;
    border-color: var(--color-primary) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.sidebar-widgets ul li:last-child {
    border-bottom: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.sidebar-widgets ul li a:hover .small {
    color: var(--color-primary) !important;
}

/* ============================================
   7. Pagination (PaginationSection)
   ============================================ */
.pagination .page-link {
    color: var(--color-primary);
    border-color: rgba(31, 111, 235, 0.35);
    transition: all var(--transition-fast);
    border-radius: 0;
    border-style: solid;
    border-width: 2px;
    background: #fff;
}

.pagination .page-link:hover {
    background-color: var(--color-bg-muted);
    color: var(--color-primary-dark);
    border-color: var(--color-primary);
    box-shadow: 4px 4px 0 rgba(15, 61, 138, 0.12);
}

.pagination .page-item.active .page-link {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 4px 4px 0 rgba(15, 61, 138, 0.18);
}

.pagination .page-item.disabled .page-link {
    color: var(--color-text-light);
    border-color: rgba(17, 24, 39, 0.10);
    background: #f3f4f6;
    box-shadow: none;
}

/* ============================================
   8. Search Box (SearchBoxSection)
   ============================================ */
.search-box-section {
    background: linear-gradient(180deg, #f4f7fb 0%, #eef2f7 100%);
    border-top: 2px solid rgba(15, 61, 138, 0.08);
    border-bottom: 2px solid rgba(15, 61, 138, 0.08);
}

.search-box-section .input-group-lg .form-control {
    border-radius: var(--radius-pill) 0 0 var(--radius-pill);
    padding-inline-start: 1.5rem;
    border: 2px solid rgba(15, 61, 138, 0.12);
    background: #fff;
    box-shadow: none;
}

.search-box-section .input-group-lg .btn {
    border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
    border: 2px solid rgba(31, 111, 235, 0.55);
    border-left: 0;
    background: var(--color-primary);
    color: #fff;
    transition: all var(--transition-fast);
    box-shadow: 4px 4px 0 rgba(15, 61, 138, 0.14);
}

.search-box-section .input-group-lg .btn:hover {
    background: var(--color-primary-dark);
    border-color: rgba(23, 86, 182, 0.85);
    transform: translateY(-1px);
    box-shadow: 4px 4px 0 rgba(15, 61, 138, 0.18);
}

.search-box-section .badge {
    transition: all var(--transition-fast);
    border-radius: 2px;
    border: 2px solid rgba(15, 61, 138, 0.12);
}

.search-box-section .badge:hover {
    background-color: var(--color-primary) !important;
    color: #fff !important;
    border-color: var(--color-primary) !important;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

/* ============================================
   9. Search Results (SearchResult
sSection)
   ============================================ */
.search-results-section {
    background: linear-gradient(180deg, #eef2f7 0%, #f4f7fb 100%);
}

.search-result {
    transition: all var(--transition-fast);
    border-radius: 0;
}

.search-result:hover {
    transform: translateX(3px);
    box-shadow: 4px 4px 0 rgba(15, 61, 138, 0.18), 10px 10px 0 rgba(17, 24, 39, 0.05);
}

.search-result h2 a:hover {
    color: var(--color-primary) !important;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.search-result mark {
    background-color: #fde68a;
    padding-inline: 2px;
    border-radius: 0;
    font-weight: 700;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.22) inset;
}

/* ============================================
   10. Error Page (Error404Section)
   ============================================ */
.error-page h1 {
    background: linear-gradient(135deg, #ff4d2e 0%, var(--color-primary-dark) 55%, #0f3d8a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    line-height: 1;
    text-shadow: 4px 4px 0 rgba(15, 61, 138, 0.18), 12px 12px 0 rgba(255, 77, 46, 0.10);
}

.recommended-links .badge {
    transition: all var(--transition-fast);
    border: 2px solid rgba(15, 61, 138, 0.18);
    border-radius: 0;
    background: #fff;
}

.recommended-links .badge:hover {
    background-color: var(--color-primary) !important;
    color: #fff !important;
    border-color: var(--color-primary) !important;
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 rgba(15, 61, 138, 0.18), 10px 10px 0 rgba(17, 24, 39, 0.05);
}

.recommended-links .badge:hover .text-warning {
    color: var(--color-accent) !important;
    text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}

/* ============================================
   11. Legal Article (LegalArticleSection)
   ============================================ */
.legal-article-section,
main:has(> .container > article.bg-white) {
    background: linear-gradient(180deg, #f4f7fb 0%, #eef2f7 100%);
    border-top: 2px solid rgba(15, 61, 138, 0.08);
    border-bottom: 2px solid rgba(15, 61, 138, 0.08);
}

article :is(h2.h4) {
    color: var(--color-primary-dark);
    border-bottom: 2px solid rgba(31, 111, 235, 0.55);
    padding-bottom: var(--space-xs);
    margin-bottom: var(--space-sm);
    text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}

article .alert-info {
    background-color: #e0f2fe;
    border-color: #7dd3fc;
    color: #0b3b66;
    border-radius: 0;
    border-width: 2px;
    border-style: solid;
}

article .list-group-item {
    background: transparent;
    transition: all var(--transition-fast);
    border-radius: 0;
    border-color: rgba(15, 61, 138, 0.08);
    border-width: 2px;
    border-style: solid;
}

article .list-group-item:hover {
    background: #f4f7fb;
    padding-inline-start: var(--space-sm);
    border-color: rgba(31, 111, 235, 0.35);
    box-shadow: 4px 4px 0 rgba(15, 61, 138, 0.12);
}

/* ============================================
   12. Post List (PostListSection - Category page)
   ============================================ */
.posts-grid {
    /* Container nếu cần */
}

.posts-grid .card {
    transition: all var(--transition-fast);
    border: 2px solid var(--color-border-soft);
    overflow: hidden;
    border-radius: 0;
    background: #fff;
}

.posts-grid .card:hover {
    transform: translateY(-5px);
    box-shadow: 4px 4px 0 rgba(15, 61, 138, 0.22), 10px 10px 0 rgba(17, 24, 39, 0.05);
    border-color: rgba(31, 111, 235, 0.6);
}

.posts-grid .card-img-top {
    transition: transform var(--transition-slow), filter var(--transition-fast);
}

.posts-grid .card:hover .card-img-top {
    transform: scale(1.05);
    filter: saturate(1.06) contrast(1.02);
}

.posts-grid .card-title a {
    transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
    text-decoration: none;
    text-underline-offset: 3px;
}

.posts-grid .card-title a:hover {
    color: var(--color-primary) !important;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-decoration-color: rgba(31, 111, 235, 0.8);
}

/* ============================================
   13. Related Posts (RelatedPostsSection)
   ============================================ */
.related-posts h3 {
    border-bottom: 3px solid var(--color-accent);
    padding-bottom: var(--space-xs);
    display: inline-block;
    text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}

.related-card {
    transition: all var(--transition-fast);
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 4px 4px 0 rgba(15, 61, 138, 0.18), 10px 10px 0 rgba(17, 24, 39, 0.05);
}

.related-card img {
    transition: transform var(--transition-slow), filter var(--transition-fast);
}

.related-card:hover img {
    transform: scale(1.05);
    filter: saturate(1.08);
}

/* ============================================
   14. Social Share (SocialShareSection)
   ============================================ */
.social-share .btn {
    min-width: 40px;
    transition: all var(--transition-fast);
    border-radius: 0;
    border: 2px solid rgba(15, 61, 138, 0.18);
    box-shadow: none;
}

.social-share .btn:hover {
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 rgba(15, 61, 138, 0.16);
    border-color: rgba(31, 111, 235, 0.55);
}

.social-share [data-copy-url].copied {
    background-color: var(--color-success);
    color: #fff;

    border-color: var(--color-success);
    box-shadow: 4px 4px 0 rgba(18, 183, 106, 0.22);
}

/* ============================================
   15. Bootstrap Accordion override
   ============================================ */
.accordion-button:not(.collapsed) {
    background-color: #dbeafe;
    color: var(--color-primary-dark);
    box-shadow: none;
    border-radius: 0;
    border: 2px solid rgba(31, 111, 235, 0.30);
}

.accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.18);
    outline: 2px solid rgba(31, 111, 235, 0.35);
    outline-offset: -2px;
}

/* ============================================
   16. Modal (用于 SocialShare 微信二维码)
   ============================================ */
.modal-content {
    border: 2px solid rgba(15, 61, 138, 0.18);
    border-radius: var(--radius-lg);
    box-shadow: 4px 4px 0 rgba(15, 61, 138, 0.18), 14px 14px 0 rgba(17, 24, 39, 0.06);
    background: #fff;
}

/* ============================================
   17. Tooltip (Bootstrap)
   ============================================ */
.tooltip-inner {
    background-color: var(--color-primary-darker);
    border-radius: 0;
    font-size: 0.85rem;
    border: 2px solid rgba(255,255,255,0.10);
    box-shadow: 4px 4px 0 rgba(15, 61, 138, 0.20);
}

/* ============================================
   18. Responsive
   ============================================ */
@media (max-width: 767.98px) {
    .faq-section h2 {
        font-size: 1.4rem;
    }

    .faq-list .faq-item summary {
        font-size: 0.95rem;
        padding-inline-end: 1.5rem;
    }

    .faq-list .faq-answer {
        font-size: 0.88rem;
    }

    .author-profile h1 {
        font-size: 1.5rem;
    }

    .author-profile .col-md-3 img {
        width: 120px !important;
        height: 120px !important;
    }

    .error-page h1 {
        font-size: 5rem !important;
        text-shadow: 4px 4px 0 rgba(15, 61, 138, 0.18), 16px 16px 0 rgba(255, 77, 46, 0.10);
    }

    .search-box-section .input-group-lg .form-control,
    .search-box-section .input-group-lg .btn {
        font-size: 1rem;
    }
}

@media (max-width: 575.98px) {
    .related-posts .row > [class*="col-"] {
        margin-bottom: var(--space-sm);
    }

    .pagination .page-link {
        padding: 0.4rem 0.7rem;
        font-size: 0.9rem;
        border-width: 2px;
    }
}