/* 文章列表 / 文章详情 / 归档 / 搜索 / 单页面 / 评论 */

:root {
    --bd-bg: #f7f9fc;
    --bd-card: #fff;
    --bd-text: #10131a;
    --bd-text-2: #495366;
    --bd-muted: #818999;
    --bd-border: #e5e6eb;
    --bd-border-light: #eef1f6;
    --bd-primary: #1677ff;
    --bd-radius: 18px;
    --bd-shadow: 0 4px 18px rgba(16, 19, 26, .05);
}

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- 面包屑 ---------- */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--bd-muted);
}

.breadcrumbs a {
    color: var(--bd-text-2);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--bd-primary);
}

.breadcrumbs__sep {
    color: #c9cdd4;
}

.breadcrumbs__current {
    color: var(--bd-muted);
}

/* ---------- 列表页骨架 ---------- */
.blog-wrap {
    background: var(--bd-bg);
    min-height: calc(100vh - 108px);
    padding: 48px 16px 72px;
}

.blog-container {
    max-width: 1200px;
    margin: 0 auto;
}

.blog-hero {
    padding: 8px 0 4px;
    text-align: center;
}

.blog-hero .breadcrumbs {
    justify-content: center;
    margin-bottom: 14px;
}

.blog-hero h1 {
    margin: 0 0 10px;
    font-size: 32px;
    font-weight: 700;
    color: var(--bd-text);
}

.blog-hero > p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--bd-muted);
}

/* ---------- 搜索表单 ---------- */
.search-form {
    display: flex;
    max-width: 460px;
    margin: 20px auto 0;
}

.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 20px;
    font-size: 14px;
    color: var(--bd-text);
    background: #fff;
    border: 1px solid var(--bd-border);
    border-right: 0;
    border-radius: 22px 0 0 22px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
}

.search-form input[type="search"]::placeholder {
    color: #a9aeb8;
}

.search-form input[type="search"]:focus {
    border-color: var(--bd-primary);
    box-shadow: 0 0 0 3px rgba(22, 119, 255, .12);
}

.search-form button {
    height: 44px;
    padding: 0 22px;
    font-size: 14px;
    color: #fff;
    background: var(--bd-text);
    border: 0;
    border-radius: 0 22px 22px 0;
    cursor: pointer;
    transition: background .2s;
}

.search-form button:hover {
    background: #4d4d4d;
}

/* ---------- 文章卡片 ---------- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 32px;
}

.post-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bd-card);
    border-radius: var(--bd-radius);
    box-shadow: var(--bd-shadow);
    transition: transform .2s, box-shadow .2s;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(16, 19, 26, .08);
}

.post-card__thumb {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, #eef4ff, #f7f9fc);
}

.post-card__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card__thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #a9aeb8;
    font-size: 14px;
}

.post-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    padding: 20px 22px 22px;
}

.post-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--bd-muted);
}

.post-card__cat {
    display: inline-block;
    padding: 2px 10px;
    font-size: 12px;
    color: var(--bd-primary);
    text-decoration: none;
    background: #eef4ff;
    border-radius: 999px;
}

.post-card__cat:hover {
    background: #dbe9ff;
}

.post-card__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--bd-text);
}

.post-card__title a {
    color: inherit;
    text-decoration: none;
}

.post-card__title a:hover {
    color: var(--bd-primary);
}

.post-card__excerpt {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.75;
    color: var(--bd-text-2);
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.post-card__more {
    margin-top: auto;
    font-size: 14px;
    color: var(--bd-primary);
    text-decoration: none;
}

.post-card__more:hover {
    text-decoration: underline;
}

.post-meta__comments {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--bd-muted);
    text-decoration: none;
}

.post-meta__comments svg {
    width: 14px;
    height: 14px;
}

/* ---------- 分页 ---------- */
.pagination,
.comment-navigation,
.comments-pagination {
    margin-top: 32px;
}

.pagination .nav-links,
.comment-navigation .nav-links,
.comments-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.pagination .page-numbers,
.comment-navigation .page-numbers,
.comments-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
    color: var(--bd-text-2);
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--bd-border);
    border-radius: 18px;
}

.pagination .page-numbers:hover,
.comment-navigation .page-numbers:hover,
.comments-pagination .page-numbers:hover {
    color: var(--bd-primary);
    border-color: var(--bd-primary);
}

.pagination .page-numbers.current,
.comment-navigation .page-numbers.current,
.comments-pagination .page-numbers.current {
    color: #fff;
    background: var(--bd-text);
    border-color: var(--bd-text);
}

.pagination .page-numbers.dots,
.comment-navigation .page-numbers.dots,
.comments-pagination .page-numbers.dots {
    background: transparent;
    border-color: transparent;
}

.empty-state {
    margin: 40px 0 0;
    padding: 56px 20px;
    font-size: 14px;
    color: var(--bd-muted);
    text-align: center;
    background: #fff;
    border-radius: var(--bd-radius);
    box-shadow: var(--bd-shadow);
}

/* ---------- 文章详情 ---------- */
.single-wrap {
    background: var(--bd-bg);
    min-height: calc(100vh - 108px);
    padding: 40px 16px 72px;
}

.single-container {
    max-width: 1200px;
    margin: 0 auto;
}

.single-container--narrow {
    max-width: 900px;
}

.single-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.single-main {
    min-width: 0;
}

.single-main--article {
    grid-column: 1;
    grid-row: 1;
}

.single-main--comments {
    grid-column: 1;
    grid-row: 2;
}

.single-side {
    grid-column: 2;
    grid-row: 1 / span 2;
    min-width: 0;
}

.single-side__sticky {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.single-card {
    padding: 32px 36px 40px;
    background: var(--bd-card);
    border-radius: 20px;
    box-shadow: var(--bd-shadow);
}

.single-title {
    margin: 0 0 14px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--bd-text);
}

.single-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--bd-muted);
}

.single-meta a {
    color: var(--bd-text-2);
    text-decoration: none;
}

.single-meta__cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.single-thumb {
    margin: 0 0 24px;
    overflow: hidden;
    background: var(--bd-border-light);
    border-radius: 14px;
}

.single-thumb__img {
    display: block;
    width: 100%;
    height: auto;
}

/* ---------- 正文排版 ---------- */
.entry-content {
    font-size: 15px;
    line-height: 1.9;
    color: #1f2329;
    word-break: break-word;
}

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

.entry-content p {
    margin: 0 0 16px;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin: 30px 0 12px;
    font-weight: 700;
    line-height: 1.5;
    color: #1f2329;
}

.entry-content h2 {
    font-size: 22px;
}

.entry-content h3 {
    font-size: 18px;
}

.entry-content h4 {
    font-size: 16px;
}

.entry-content ul,
.entry-content ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.entry-content li {
    margin: 6px 0;
}

.entry-content strong {
    font-weight: 700;
}

.entry-content a {
    color: var(--bd-primary);
    text-decoration: none;
}

.entry-content a:hover {
    text-decoration: underline;
}

.entry-content img {
    max-width: 100%;
    height: auto;
}

.entry-content figure {
    margin: 0 0 16px;
}

.entry-content figcaption {
    margin-top: 6px;
    font-size: 13px;
    color: var(--bd-muted);
    text-align: center;
}

.entry-content table {
    width: 100%;
    margin: 0 0 16px;
    border-collapse: collapse;
    font-size: 14px;
}

.entry-content th,
.entry-content td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid var(--bd-border);
}

.entry-content th {
    background: #f7f8fa;
}

.entry-content blockquote {
    margin: 0 0 16px;
    padding: 10px 16px;
    color: var(--bd-text-2);
    background: #f7f8fa;
    border-left: 4px solid #d9dbe0;
}

.entry-content pre {
    padding: 14px 16px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.7;
    background: #f7f8fa;
    border-radius: 10px;
}

.entry-content code {
    padding: 1px 5px;
    font-size: 13px;
    background: #f2f4f7;
    border-radius: 4px;
}

.entry-content iframe {
    max-width: 100%;
}

.entry-content .wp-block-image {
    margin: 0 0 16px;
}

.entry-content .wp-block-image img {
    border-radius: 10px;
}

.single-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--bd-border-light);
}

.single-tag {
    padding: 3px 12px;
    font-size: 13px;
    color: var(--bd-text-2);
    text-decoration: none;
    background: #f2f5fa;
    border-radius: 999px;
}

.single-tag:hover {
    color: var(--bd-primary);
    background: #eef4ff;
}

.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    padding: 18px 0 0;
    border-top: 1px solid var(--bd-border-light);
}

.post-nav__item {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    line-height: 1.7;
}

.post-nav__item:empty {
    display: none;
}

.post-nav__next {
    text-align: right;
}

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

.post-nav a:hover {
    color: var(--bd-primary);
}

/* ---------- 右侧栏 ---------- */
.sidebar-card {
    padding: 20px 20px 16px;
    background: var(--bd-card);
    border-radius: var(--bd-radius);
    box-shadow: var(--bd-shadow);
}

.sidebar-title {
    margin: 0 0 14px;
    padding-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--bd-text);
    border-bottom: 1px solid #f0f2f5;
}

.sidebar-post-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sidebar-post__link {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    text-decoration: none;
}

.sidebar-post__thumb {
    flex: 0 0 96px;
    width: 96px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #eef1f6;
    border-radius: 8px;
}

.sidebar-post__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-post__info {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.sidebar-post__title {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--bd-text);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sidebar-post__link:hover .sidebar-post__title {
    color: var(--bd-primary);
}

.sidebar-post__date {
    font-size: 12px;
    color: var(--bd-muted);
}

/* ---------- 评论 ---------- */
#comments {
    scroll-margin-top: 100px;
}

.comments-area {
    margin-top: 24px;
    padding: 28px 36px 32px;
    background: var(--bd-card);
    border-radius: 20px;
    box-shadow: var(--bd-shadow);
}

.comments-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    font-size: 18px;
    font-weight: 600;
    color: var(--bd-text);
}

.comments-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    font-size: 12px;
    color: var(--bd-text-2);
    background: #f2f4f7;
    border-radius: 11px;
}

.comments-note {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--bd-muted);
}

.comment-list,
.comment-list .children {
    margin: 0;
    padding: 0;
    list-style: none;
}

.comment-list .children {
    margin-top: 10px;
    padding-left: 18px;
    border-left: 2px solid var(--bd-border-light);
}

.comment-item {
    margin-top: 18px;
}

.comment-item--pingback .comment-meta {
    font-size: 13px;
}

.comment-inner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.comment-avatar {
    display: flex;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    border-radius: 50%;
}

.comment-avatar--c0 { background: #1677ff; }
.comment-avatar--c1 { background: #5c61ff; }
.comment-avatar--c2 { background: #13c2c2; }
.comment-avatar--c3 { background: #fa8c16; }
.comment-avatar--c4 { background: #eb2f96; }
.comment-avatar--c5 { background: #52c41a; }

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    line-height: 1.6;
}

.comment-author {
    font-weight: 600;
    color: var(--bd-text);
}

.comment-time {
    color: var(--bd-muted);
}

.comment-pending {
    padding: 1px 8px;
    font-size: 12px;
    color: #d46b08;
    background: #fff7e6;
    border-radius: 999px;
}

.comment-text {
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--bd-text-2);
}

.comment-text p {
    margin: 0 0 8px;
}

.comment-text p:last-child {
    margin-bottom: 0;
}

.comment-reply {
    margin-top: 4px;
}

.comment-reply a {
    font-size: 13px;
    color: var(--bd-primary);
    text-decoration: none;
}

.comment-reply a:hover {
    text-decoration: underline;
}

.comments-area .comment-form {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--bd-border-light);
}

.comment-form-title {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--bd-text);
}

.comment-form .comment-notes,
.comment-form .logged-in-as {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--bd-muted);
}

.comment-form p {
    margin: 0 0 14px;
}

.comment-form .comment-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--bd-text-2);
}

.comment-form .comment-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--bd-text);
    background: #fff;
    border: 1px solid var(--bd-border);
    border-radius: 10px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
}

.comment-form .comment-textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-form .comment-input:focus {
    border-color: var(--bd-primary);
    box-shadow: 0 0 0 3px rgba(22, 119, 255, .12);
}

.comment-form .form-submit {
    margin: 18px 0 0;
}

.comment-form .comment-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 24px;
    font-size: 14px;
    color: #fff;
    background: var(--bd-text);
    border: 0;
    border-radius: 20px;
    cursor: pointer;
    transition: background .2s;
}

.comment-form .comment-submit:hover {
    background: #4d4d4d;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
    .single-grid {
        grid-template-columns: 1fr;
    }

    .single-main--article,
    .single-main--comments,
    .single-side {
        grid-column: auto;
        grid-row: auto;
    }

    .single-side__sticky {
        position: static;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 767px) {
    .blog-wrap,
    .single-wrap {
        padding: 28px 12px 48px;
    }

    .blog-hero h1 {
        font-size: 26px;
    }

    .post-grid {
        grid-template-columns: 1fr;
    }

    .post-card__body {
        padding: 18px 18px 20px;
    }

    .single-card {
        padding: 22px 18px 28px;
        border-radius: 16px;
    }

    .single-title {
        font-size: 22px;
    }

    .comments-area {
        padding: 20px 18px 24px;
        border-radius: 16px;
    }

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

    .post-nav__next {
        text-align: left;
    }

    .search-form {
        max-width: 100%;
    }

    .search-form button {
        padding: 0 16px;
    }
}
