/* ==================== 文章详情 / 归档 / 分页 ==================== */
/* 复用 Article.css 与 host.css 的变量，保持整站视觉一致 */

/* ---------- 归档标题 ---------- */
.archive-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--white-10);
}

.archive-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.archive-home {
    color: #60a5fa;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.archive-home:hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* ---------- 单篇文章 ---------- */
.post-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    max-width: var(--reading-width, 900px);
    margin: 0 auto 12px;
}

.post-back {
    color: var(--white-50);
    font-size: 13px;
    text-decoration: none;
    transition: var(--transition);
}

.post-back:hover {
    color: #93c5fd;
}

.reading-toggle {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 18px;
    border: 1px solid var(--white-15);
    background: var(--white-5);
    color: rgba(255, 255, 255, 0.75);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.reading-toggle:hover {
    background: var(--white-15);
    color: #fff;
}

.reading-toggle[aria-pressed="true"] {
    background: var(--white-20);
    color: #fff;
}

.post-single {
    width: 100%;
    max-width: var(--reading-width, 900px);
    margin: 0 auto;
}

/* ---------- 阅读尺寸：文章页默认更宽、更大 ---------- */
body.yepc-single .frosted-glass {
    width: 90%;
    max-width: 1400px;
    height: 88vh;
    max-height: 92vh;
}

body.yepc-single .post-content {
    font-size: var(--reading-font-size, 17px);
    line-height: 1.9;
}

body.yepc-single .post-single-title {
    font-size: 1.9rem;
}

body.yepc-single .comments {
    max-width: var(--reading-width, 900px);
}

/* ---------- 阅读模式：进一步放大窗口与正文 ---------- */
body.yepc-reading .frosted-glass {
    width: 97%;
    max-width: none;
    height: 96vh;
    max-height: 97vh;
}

body.yepc-reading .post-single,
body.yepc-reading .post-toolbar,
body.yepc-reading .comments {
    max-width: 1240px;
}

body.yepc-reading .post-content {
    font-size: calc(var(--reading-font-size, 17px) + 1px);
    line-height: 1.95;
}

body.yepc-reading .post-single-title {
    font-size: 2.1rem;
}

.post-single-header {
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--white-10);
}

.post-single-title {
    margin: 0 0 14px 0;
    font-size: 1.75rem;
    line-height: 1.35;
    font-weight: 600;
    color: #fff;
    text-align: left;
}

.post-single-header .post-meta {
    margin-bottom: 0;
}

.post-single-header .post-meta a {
    color: inherit;
    text-decoration: none;
}

.post-single-header .post-meta a:hover {
    color: #93c5fd;
}

/* ---------- 正文排版 ---------- */
.post-content {
    color: rgba(255, 255, 255, 0.88);
    font-size: 16px;
    line-height: 1.85;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.post-content > *:first-child {
    margin-top: 0;
}

.post-content p {
    margin: 0 0 1.1em;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin: 1.6em 0 0.7em;
    color: #fff;
    font-weight: 600;
    line-height: 1.4;
}

.post-content h1 { font-size: 1.5rem; }
.post-content h2 { font-size: 1.35rem; }
.post-content h3 { font-size: 1.2rem; }
.post-content h4 { font-size: 1.05rem; }

.post-content a {
    color: #60a5fa;
    text-decoration: none;
    border-bottom: 1px solid rgba(96, 165, 250, 0.35);
}

.post-content a:hover {
    color: #93c5fd;
    border-bottom-color: #93c5fd;
}

.post-content img {
    /* 正文图片按 800×600 等比缩小，宽高都用 auto，不变形 */
    max-width: var(--post-image-width, 800px);
    max-height: 600px;
    width: auto;
    height: auto;
    border-radius: 10px;
    display: block;
    margin: 1.2em auto;
}

.post-content img.yepc-zoomable {
    cursor: zoom-in;
    transition: filter 0.2s ease;
}

.post-content img.yepc-zoomable:hover {
    filter: brightness(1.08);
}

@media (max-width: 760px) {
    .post-content img {
        max-width: 100%;
        max-height: 320px;
    }
}

.post-content ul,
.post-content ol {
    margin: 0 0 1.1em;
    padding-left: 1.6em;
}

.post-content li {
    margin: 0.35em 0;
}

.post-content blockquote {
    margin: 1.2em 0;
    padding: 10px 18px;
    border-left: 3px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0 10px 10px 0;
    color: rgba(255, 255, 255, 0.75);
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

.post-content code {
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.35);
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 0.9em;
    color: #ffd9a0;
}

.post-content pre {
    margin: 1.2em 0;
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
    line-height: 1.6;
}

.post-content pre code {
    padding: 0;
    background: none;
    color: #e6e6e6;
    font-size: 13px;
}

.post-content table {
    width: 100%;
    margin: 1.2em 0;
    border-collapse: collapse;
    font-size: 14px;
}

.post-content th,
.post-content td {
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-align: left;
}

.post-content th {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.post-content hr {
    margin: 2em 0;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* 正文里的折叠框（兼容手写的 <details>） */
.post-content details {
    margin: 1.2em 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.post-content summary {
    display: block;
    padding: 10px 14px;
    cursor: pointer;
    list-style: none;
    background: rgba(255, 255, 255, 0.06);
    font-size: 14px;
}

.post-content summary::-webkit-details-marker {
    display: none;
}

/* ---------- 文末：标签与上下篇 ---------- */
.post-single-footer {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--white-10);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.post-tags a {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--white-10);
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    text-decoration: none;
    transition: var(--transition);
}

.post-tags a:hover {
    background: var(--white-20);
    color: #fff;
}

.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
    color: var(--white-50);
}

.post-nav a {
    color: var(--white-50);
    text-decoration: none;
}

.post-nav a:hover {
    color: #93c5fd;
}

/* ---------- 分页 ---------- */
.page-navigator {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 26px 0 6px;
    padding: 0;
    list-style: none;
}

.page-navigator li {
    list-style: none;
}

.page-navigator a,
.page-navigator span {
    display: inline-block;
    min-width: 34px;
    padding: 6px 12px;
    border-radius: 19px;
    background: var(--white-5);
    border: 1px solid var(--white-10);
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    text-align: center;
    text-decoration: none;
    transition: var(--transition);
}

.page-navigator a:hover {
    background: var(--white-15);
    color: #fff;
}

.page-navigator .current span {
    background: var(--white-20);
    color: #fff;
    border-color: var(--white-30);
}

.page-navigator .prev a,
.page-navigator .next a {
    padding: 6px 14px;
}

/* ---------- 空数据 / 404 ---------- */
.empty-message {
    grid-column: 1 / -1;
    padding: 26px;
    text-align: center;
    color: var(--white-50);
    background: var(--white-5);
    border-radius: 12px;
}

.not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    padding: 60px 20px;
    margin: 0 auto;
}

.not-found-code {
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 4px;
}

.not-found-text {
    color: var(--white-50);
    margin: 0 0 8px;
}

/* 搜索结果里的星标 */
.stars-badge {
    font-size: 12px;
    opacity: 0.75;
    margin-left: 4px;
}

@media (max-width: 768px) {
    .post-single-title {
        font-size: 1.35rem;
    }

    .post-content {
        font-size: 15px;
        line-height: 1.75;
    }

    .post-content pre {
        padding: 12px;
    }

    .post-nav {
        flex-direction: column;
        gap: 8px;
    }

    .not-found-code {
        font-size: 56px;
    }
}
/* ---------- 分页隐藏 / 自动加载 ---------- */
.page-navigator.is-hidden {
    display: none;
}

.posts-sentinel {
    padding: 18px 0 6px;
    text-align: center;
    font-size: 13px;
    color: var(--white-50);
    cursor: pointer;
    user-select: none;
}

.posts-sentinel .posts-loading::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border: 2px solid var(--white-20);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: -2px;
    animation: yepc-spin 0.8s linear infinite;
}

.posts-sentinel .posts-end {
    opacity: 0.6;
}

.posts-sentinel .posts-error {
    color: #f87171;
}

@keyframes yepc-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- 小屏阅读尺寸 ---------- */
@media (max-width: 768px) {
    body.yepc-single .frosted-glass,
    body.yepc-reading .frosted-glass {
        width: 96%;
        height: 90vh;
    }

    body.yepc-single .post-single-title,
    body.yepc-reading .post-single-title {
        font-size: 1.45rem;
    }

    body.yepc-single .post-content,
    body.yepc-reading .post-content {
        font-size: 16px;
    }
}

/* ==================== 图片放大查看（在文章框内） ==================== */
.frosted-glass {
    position: relative;
}

body.yepc-lightbox-open .content-container {
    overflow: hidden;
}

.yepc-lightbox {
    position: absolute;
    inset: 0;
    z-index: 900;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(6, 8, 12, 0.9);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.yepc-lightbox.show {
    display: flex;
    opacity: 1;
}

.yepc-lightbox-img {
    /* 等比放大，只给最大宽高，宽高 auto */
    max-width: 90%;
    max-height: 84%;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: none;
}

/* 右上角醒目的关闭按钮 */
.yepc-lightbox-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    color: #1b2027;
    font: 600 20px/1 Arial, sans-serif;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease, background 0.15s ease;
}

.yepc-lightbox-close:hover {
    background: #e9eef6;
    transform: scale(1.06);
}

.yepc-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.72);
    font: 26px/1 Georgia, "Times New Roman", serif;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.yepc-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.yepc-lightbox-nav.prev {
    left: 20px;
}

.yepc-lightbox-nav.next {
    right: 20px;
}

.yepc-lightbox-counter {
    position: absolute;
    top: 22px;
    left: 22px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    letter-spacing: 0.5px;
    pointer-events: none;
}

.yepc-lightbox-hint {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.yepc-lightbox-hint.show {
    opacity: 1;
}

.yepc-lightbox-toast {
    position: absolute;
    bottom: 54px;
    left: 50%;
    transform: translate(-50%, 8px);
    padding: 8px 18px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.yepc-lightbox-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 768px) {
    .yepc-lightbox-close {
        top: 10px;
        right: 10px;
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .yepc-lightbox-nav {
        width: 38px;
        height: 38px;
        font-size: 22px;
    }

    .yepc-lightbox-nav.prev {
        left: 10px;
    }

    .yepc-lightbox-nav.next {
        right: 10px;
    }

    .yepc-lightbox-hint {
        display: none;
    }
}
