/* =====================================================
   毅霖文章页 UI —— single post 效果图风格
   仅作用于 single-post 页面，通过 body.single-post 限定
   ===================================================== */

/* ---------- 容器：主内容 + 右侧边栏 ---------- */
/* 由 JS 在 article 的直接父容器上动态添加 .yilin-article-grid 触发两栏布局 */
body.single-post .yilin-article-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 36px;
    align-items: start;
}

/* 文章与侧边栏之外的元素（评论区、文章导航等）跨满两列 */
body.single-post .yilin-article-grid > *:not(article.post):not(.yilin-article-sidebar) {
    grid-column: 1 / -1;
}

body.single-post .yilin-article-grid > article.post {
    min-width: 0;
}

body.single-post .yilin-article-grid > .yilin-article-sidebar {
    min-width: 0;
    align-self: start;
    position: sticky;
    top: 24px;
}

@media (max-width: 1024px) {
    body.single-post .yilin-article-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    body.single-post .yilin-article-grid > .yilin-article-sidebar {
        position: static;
        margin-top: 8px;
    }
}

/* ---------- Hero / entry-header 重排 ---------- */
body.single-post .hero-section {
    padding-top: 16px;
    padding-bottom: 0;
}

body.single-post .entry-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

body.single-post .entry-header h1.page-title {
    display: block !important;
    visibility: visible !important;
    font-size: 28px;
    line-height: 1.35;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

@media (min-width: 768px) {
    body.single-post .entry-header h1.page-title {
        font-size: 32px;
    }
}

/* 面包屑 */
.yl-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
}

.yl-breadcrumbs a {
    color: #2563eb;
    text-decoration: none;
}

.yl-breadcrumbs a:hover {
    text-decoration: underline;
}

.yl-breadcrumbs .sep {
    color: #d1d5db;
}

.yl-breadcrumbs .current {
    color: #6b7280;
}

/* 分类 badge */
.yl-cat-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.yl-cat-badge {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 12px;
    border-radius: 4px;
    background: #2563eb;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background .2s ease;
}

.yl-cat-badge:hover {
    background: #1d4ed8;
    color: #fff;
}

/* meta 行 */
.yl-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px 24px;
    font-size: 14px;
    color: #6b7280;
}

.yl-meta-row .yl-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.yl-meta-row svg {
    width: 16px;
    height: 16px;
    color: #9ca3af;
}

.yl-meta-row .yl-author a {
    color: #2563eb;
    text-decoration: none;
}

.yl-meta-row .yl-views {
    color: #9ca3af;
}

/* 分享按钮 */
.yl-share-mini {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.yl-share-mini span {
    color: #6b7280;
}

.yl-share-mini button {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease;
}

.yl-share-mini button:hover {
    background: #e5e7eb;
}

.yl-share-mini button svg {
    width: 14px;
    height: 14px;
    color: #4b5563;
}

/* 导语 */
.yl-lead {
    font-size: 15px;
    line-height: 1.75;
    color: #4b5563;
    background: #f8fafc;
    border-left: 3px solid #2563eb;
    padding: 14px 16px;
    border-radius: 0 8px 8px 0;
    margin: 0;
}

.yl-lead p {
    margin: 0;
}

/* 特色图 */
.yl-featured-image {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 4px;
}

.yl-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* 隐藏主题原生的 page-description 与 entry-meta（我们已重建） */
body.single-post .entry-header .page-description,
body.single-post .entry-header .entry-meta {
    display: none;
}

/* ---------- 正文内容区美化 ---------- */
body.single-post .entry-content {
    font-size: 16px;
    line-height: 1.85;
    color: #374151;
    margin-top: 24px;
}

body.single-post .entry-content p {
    margin-bottom: 18px;
}

body.single-post .entry-content h2,
body.single-post .entry-content h3 {
    color: #111827;
    font-weight: 700;
    margin-top: 32px;
    margin-bottom: 16px;
}

body.single-post .entry-content h2 {
    font-size: 20px;
    border-left: 4px solid #2563eb;
    padding-left: 12px;
    line-height: 1.35;
}

body.single-post .entry-content h3 {
    font-size: 17px;
    padding-left: 12px;
    border-left: 3px solid #60a5fa;
}

body.single-post .entry-content strong {
    color: #111827;
}

/* 表格 */
body.single-post .entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    font-size: 14px;
}

body.single-post .entry-content thead {
    background: #eff6ff;
}

body.single-post .entry-content th {
    color: #1e40af;
    font-weight: 600;
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid #dbeafe;
}

body.single-post .entry-content td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
}

body.single-post .entry-content tbody tr:last-child td {
    border-bottom: none;
}

body.single-post .entry-content tbody tr:nth-child(even) td {
    background: #f8fafc;
}

/* 勾选列表 */
body.single-post .entry-content ul {
    list-style: none;
    padding-left: 0;
    margin: 16px 0;
}

body.single-post .entry-content ul li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 10px;
    line-height: 1.7;
}

body.single-post .entry-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

body.single-post .entry-content ol {
    padding-left: 22px;
    margin: 16px 0;
}

body.single-post .entry-content ol li {
    margin-bottom: 10px;
}

/* 链接 */
body.single-post .entry-content a {
    color: #2563eb;
    text-decoration: none;
}

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

/* 来源标注与提示 */
body.single-post .entry-content .yl-note,
body.single-post .entry-content .yl-src {
    font-size: 14px;
    color: #6b7280;
    background: #f8fafc;
    padding: 12px 14px;
    border-radius: 8px;
    margin: 20px 0;
}

body.single-post .entry-content .yl-note {
    border-left: 3px solid #f59e0b;
}

body.single-post .entry-content .yl-src {
    border-left: 3px solid #10b981;
}

/* ---------- 底部标签云与互动 ---------- */
.yl-article-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.yl-article-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.yl-article-tags > span {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.yl-article-tags a {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 13px;
    text-decoration: none;
    transition: all .2s ease;
}

.yl-article-tags a:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.yl-article-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}

.yl-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    transition: all .2s ease;
}

.yl-like-btn:hover {
    border-color: #f87171;
    color: #ef4444;
}

.yl-like-btn.liked {
    background: #fef2f2;
    border-color: #f87171;
    color: #ef4444;
}

.yl-like-btn svg {
    width: 16px;
    height: 16px;
}

.yl-share-bar {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #6b7280;
}

.yl-share-bar button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease;
}

.yl-share-bar button:hover {
    background: #e5e7eb;
}

.yl-share-bar button svg {
    width: 16px;
    height: 16px;
    color: #4b5563;
}

/* ---------- 右侧边栏 ---------- */
.yilin-article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.yl-widget {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    padding: 20px;
    border: 1px solid #f1f5f9;
}

.yl-widget-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

/* 文章分类 */
.yl-cat-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.yl-cat-list li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8fafc;
    color: #374151;
    font-size: 14px;
    text-decoration: none;
    transition: all .2s ease;
}

.yl-cat-list li a:hover {
    background: #eff6ff;
    color: #2563eb;
}

.yl-cat-list .yl-cat-left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.yl-cat-list .yl-cat-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.yl-cat-list .yl-cat-count {
    color: #9ca3af;
    font-size: 13px;
}

/* 相关文章 */
.yl-related-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.yl-related-item {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.yl-related-thumb {
    width: 70px;
    height: 52px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #e0e7ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #4338ca;
}

.yl-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yl-related-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.yl-related-title {
    font-size: 14px;
    line-height: 1.45;
    color: #111827;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yl-related-meta {
    font-size: 12px;
    color: #9ca3af;
}

/* CTA 卡片 */
.yl-cta-card {
    position: relative;
    border-radius: 12px;
    padding: 28px 22px;
    color: #fff;
    overflow: hidden;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.yl-cta-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 90% 10%, rgba(255,255,255,.18) 0%, transparent 45%);
    pointer-events: none;
}

.yl-cta-card h4 {
    position: relative;
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 8px;
}

.yl-cta-card p {
    position: relative;
    font-size: 13px;
    opacity: .9;
    margin: 0 0 18px;
    line-height: 1.5;
}

.yl-cta-card .yl-cta-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    border-radius: 8px;
    background: #fff;
    color: #2563eb;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: transform .2s ease;
}

.yl-cta-card .yl-cta-btn:hover {
    transform: translateY(-1px);
}

.yl-cta-card .yl-cta-btn svg {
    width: 16px;
    height: 16px;
}

/* Toast 提示 */
.yl-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(100px);
    background: rgba(17,24,39,.9);
    color: #fff;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: all .3s ease;
    pointer-events: none;
}

.yl-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 移动端微调 */
@media (max-width: 768px) {
    body.single-post .entry-header h1.page-title {
        font-size: 22px;
    }
    .yl-meta-row .yl-share-mini {
        width: 100%;
        margin-left: 0;
        margin-top: 4px;
    }
    .yl-article-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}
