/* ============================================================
   Louis Blog Optimizer — UI/UX Styles v1.0
   ============================================================ */

/* ---- P0: Hero Bio Card ---- */
.lbo-hero {
    display: block !important;
    width: 100%;
    margin-bottom: 3rem;
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--border-color, #eaeaea);
}

.lbo-hero-inner {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 var(--content-padding, 20px);
}

.lbo-hero-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color, #eaeaea);
    flex-shrink: 0;
}

.lbo-hero-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.lbo-hero-title {
    font-size: 0.875rem;
    margin: 0 0 0.35rem;
    opacity: 0.7;
    font-weight: 500;
}

.lbo-hero-desc {
    font-size: 0.8rem;
    margin: 0 0 0.75rem;
    opacity: 0.5;
}

.lbo-hero-links {
    display: flex;
    gap: 1rem;
}

.lbo-hero-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none !important;
    color: var(--text-primary, #1a1a1a);
    opacity: 0.65;
    transition: opacity 0.2s;
}

.lbo-hero-links a:hover {
    opacity: 1;
}

/* Dark mode */
[data-theme="dark"] .lbo-hero-links a {
    color: var(--text-heading, #fff);
}

/* Mobile */
@media (max-width: 600px) {
    .lbo-hero-inner {
        flex-direction: column;
        text-align: center;
    }
    .lbo-hero-links {
        justify-content: center;
    }
    .lbo-hero-avatar {
        width: 72px;
        height: 72px;
    }
    .lbo-hero-name {
        font-size: 1.25rem;
    }
}


/* ---- P0: Placeholder Thumbnail ---- */
.lbo-placeholder-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    margin-bottom: 1rem;
}


/* ---- P1: External Link Icon ---- */
.lbo-ext-icon {
    vertical-align: middle;
    margin-left: 2px;
    opacity: 0.5;
}


/* ---- P1: Date Meta ---- */
.lbo-date-meta {
    font-size: 0.8rem;
    color: var(--text-muted, #888);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #eaeaea);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

.lbo-date-sep {
    margin: 0 0.15rem;
}

.lbo-date-modified {
    opacity: 0.7;
}

.lbo-reading-time {
    margin-left: 0.75rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border-color, #ddd);
}


/* ---- P1: Search Overlay ---- */
.lbo-search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    padding: 0.25rem;
    display: inline-flex;
    align-items: center;
    opacity: 0.65;
    transition: opacity 0.2s;
}

.lbo-search-toggle:hover {
    opacity: 1;
}

.lbo-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20vh;
    pointer-events: none;
}

.lbo-search-overlay.is-open {
    pointer-events: auto;
}

.lbo-search-modal {
    position: relative;
    width: 90%;
    max-width: 560px;
    background: var(--bg-primary, #fff);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .lbo-search-modal {
    background: #1a1a1a;
}

.lbo-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    background: transparent;
    color: inherit;
    outline: none;
    font-family: inherit;
}

.lbo-search-input:focus {
    border-color: var(--text-heading, #000);
}

.lbo-search-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    line-height: 1;
}

.lbo-search-close:hover {
    opacity: 1;
}

/* 隐藏浏览器原生的 search 清除按钮 */
.lbo-search-input::-webkit-search-cancel-button,
.lbo-search-input::-webkit-search-decoration {
    display: none;
    -webkit-appearance: none;
}


/* ---- P2: TOC (Table of Contents) ---- */
.lbo-toc {
    background: var(--bg-secondary, #f8f8f8);
    border: 1px solid var(--border-color, #eaeaea);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    font-size: 0.85rem;
    line-height: 1.8;
}

[data-theme="dark"] .lbo-toc {
    background: #111;
}

.lbo-toc-title {
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 0.5rem;
    user-select: none;
}

.lbo-toc ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
}

.lbo-toc li {
    margin: 0.15rem 0;
}

.lbo-toc li.lbo-toc-sub {
    padding-left: 1.25rem;
    opacity: 0.8;
}

.lbo-toc a {
    text-decoration: none !important;
    color: inherit;
    opacity: 0.75;
    transition: opacity 0.15s;
}

.lbo-toc a:hover {
    opacity: 1;
}


/* ---- P2: Share Buttons ---- */
.lbo-share {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color, #eaeaea);
}

.lbo-share-label {
    font-size: 0.8rem;
    opacity: 0.5;
    font-weight: 500;
}

.lbo-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary, #f0f0f0);
    color: inherit;
    text-decoration: none !important;
    transition: background 0.2s, transform 0.15s;
}

.lbo-share-btn:hover {
    background: var(--text-heading, #000);
    color: var(--bg-primary, #fff);
    transform: scale(1.1);
}

[data-theme="dark"] .lbo-share-btn {
    background: #222;
}

[data-theme="dark"] .lbo-share-btn:hover {
    background: #fff;
    color: #000;
}


/* ---- P2: Enhanced Footer ---- */
.lbo-footer-extra {
    text-align: center;
    padding: 1rem 0 0.5rem;
}

.lbo-footer-links {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: 0.5rem;
}

.lbo-footer-links a {
    color: inherit;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.lbo-footer-links a:hover {
    opacity: 1;
}


/* ---- Dark mode toggle: always on top ---- */
#dark-mode-toggle {
    z-index: 99999999 !important;
}

/* ---- Hide: Scroll-to-Top ---- */
#pfx-scroll-top {
    display: none !important;
}

/* ---- Wider Content: match separator width ---- */
article .entry-content {
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.entry-content,
.post-content,
.site-content,
.content-area {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ---- Smooth Scroll for TOC ---- */
html {
    scroll-behavior: smooth;
}

/* ---- 确保文章 h2/h3 锚点不被 sticky header 遮挡 ---- */
[id^="toc-"] {
    scroll-margin-top: 5rem;
}
