/**
 * Blog 样式
 * 版本: v1.0.8 — 统一使用 app.css 变量
 */

/* ==================== 容器布局 ==================== */
.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 40px;
    overflow-x: hidden;
}

/* ==================== 页面头部（编辑感，左对齐） ==================== */
.blog-header {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.blog-header-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
}

@media (max-width: 700px) {
    .blog-header-inner {
        flex-direction: column;
        gap: 16px;
    }
}

.blog-header-text {
    flex: 1;
    min-width: 0;
}

.blog-header-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}

.blog-header-eyebrow::before {
    content: '';
    display: block;
    width: 20px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.blog-header h1 {
    font-family: var(--font-zh);
    font-size: 2rem;
    color: var(--ink);
    margin: 0 0 14px 0;
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

@media (max-width: 600px) {
    .blog-header h1 {
        font-size: 1.6rem;
    }
}

.blog-subtitle {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
    max-width: 520px;
}

/* 博客总文章数角标 */
.blog-header-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 28px;
    text-align: center;
    flex-shrink: 0;
}

@media (max-width: 700px) {
    .blog-header-stat {
        flex-direction: row;
        gap: 16px;
        align-items: center;
        padding: 14px 20px;
        text-align: left;
    }
}

.blog-stat-number {
    font-family: var(--font-zh);
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
    letter-spacing: -0.02em;
}

@media (max-width: 700px) {
    .blog-stat-number {
        font-size: 1.8rem;
    }
}

.blog-stat-label {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 6px;
    font-weight: 500;
}

@media (max-width: 700px) {
    .blog-stat-label {
        margin-top: 0;
    }
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    align-items: start;
}

@media (max-width: 900px) {
    .blog-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ==================== 分类筛选（分类页用） ==================== */
.blog-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.filter-item {
    padding: 5px 14px;
    border-radius: 20px;
    background: var(--cream);
    color: var(--ink);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.filter-item:hover {
    background: var(--border);
}

.filter-item.active {
    background: var(--accent);
    color: white;
}

/* ==================== 文章卡片 ==================== */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.blog-card {
    display: flex;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.blog-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 600px) {
    .blog-card {
        flex-direction: column;
    }
}

.blog-card-cover {
    flex: 0 0 240px;
}

@media (max-width: 600px) {
    .blog-card-cover {
        flex: none;
    }
}

.blog-card-cover img {
    width: 100%;
    height: 100%;
    min-height: 160px;
    object-fit: cover;
}

@media (max-width: 600px) {
    .blog-card-cover img {
        min-height: 180px;
    }
}

.blog-card-content {
    padding: 20px;
}

.blog-card-title {
    font-family: var(--font-zh);
    font-size: 1.15rem;
    margin: 0 0 10px 0;
    line-height: 1.4;
    font-weight: 700;
}

.blog-card-title a {
    color: var(--ink);
    text-decoration: none;
}

.blog-card-title a:hover {
    color: var(--accent);
}

.featured-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

.blog-card-excerpt {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 15px 0;
}

.blog-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--muted);
}

.blog-card-meta a {
    color: var(--muted);
    text-decoration: none;
}

.blog-card-meta a:hover {
    color: var(--accent);
}

.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.blog-card-tags .tag {
    padding: 3px 10px;
    background: var(--cream);
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--muted);
}

/* ==================== 分页 ==================== */
.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.page-btn {
    padding: 8px 20px;
    background: var(--accent);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.page-btn:hover {
    background: #c73d14;
}

.page-info {
    color: var(--muted);
}

/* ==================== 右侧侧边栏 ==================== */
.blog-sidebar {
    position: sticky;
    top: 80px;
}

.blog-sidebar .sidebar-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.blog-sidebar .sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-title {
    font-family: var(--font-zh);
    font-size: 0.95rem;
    margin: 0 0 15px 0;
    color: var(--ink);
    font-weight: 700;
}

/* 侧边栏搜索 */
.sidebar-search-form {
    display: flex;
    gap: 8px;
}

.sidebar-search-input {
    flex: 1;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    background: var(--paper);
    color: var(--ink);
}

.sidebar-search-input:focus {
    border-color: var(--accent);
    outline: none;
}

.sidebar-search-btn {
    padding: 9px 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.sidebar-search-btn:hover {
    background: #c73d14;
}

/* 分类列表 */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.category-list li:last-child {
    border-bottom: none;
}

.category-list a {
    color: var(--ink);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
}

.category-list a:hover {
    color: var(--accent);
}

.category-list .count {
    color: var(--muted);
    font-size: 0.85rem;
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud .tag {
    padding: 5px 12px;
    background: var(--cream);
    border-radius: 15px;
    font-size: 0.85rem;
    color: var(--muted);
    text-decoration: none;
    transition: all 0.2s;
}

.tag-cloud .tag:hover {
    background: var(--accent);
    color: white;
}

/* 热门文章 */
.hot-posts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hot-posts li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.hot-posts li:last-child {
    border-bottom: none;
}

.hot-posts .rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--cream);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--muted);
    flex-shrink: 0;
}

.hot-posts li:nth-child(1) .rank {
    background: var(--accent);
    color: white;
}

.hot-posts li:nth-child(2) .rank {
    background: var(--accent2);
    color: white;
}

.hot-posts li:nth-child(3) .rank {
    background: var(--warn);
    color: white;
}

.hot-posts a {
    color: var(--ink);
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.4;
}

.hot-posts a:hover {
    color: var(--accent);
}

/* ==================== 面包屑导航 ==================== */
/* 面包屑（详情页用，随内容滚动） */
.breadcrumb-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    font-size: 0.85rem;
    color: var(--muted);
    padding: 10px 0;
    margin-bottom: 24px;
    overflow: hidden;
}

@media (max-width: 600px) {
    .breadcrumb-bar {
        font-size: 0.78rem;
    }
    .bc-current {
        max-width: 60vw;
    }
}

.breadcrumb-inline a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-inline a:hover {
    color: var(--accent);
}

.bc-sep {
    margin: 0 8px;
    color: var(--border);
    font-size: 0.9rem;
}

.bc-current {
    color: var(--ink);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== 文章详情 ==================== */
.blog-detail {
    /* 不再限宽，由 blog-layout 两栏控制 */
}

.detail-container {
    padding-top: 32px;
}

@media (max-width: 600px) {
    .detail-container {
        padding-top: 20px;
    }
    .blog-detail-header {
        margin-bottom: 24px;
    }
}

.blog-detail-header {
    margin-bottom: 36px;
}

.detail-category-badge {
    display: inline-block;
    padding: 4px 14px;
    background: var(--accent);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 16px;
    transition: background 0.2s;
}

.detail-category-badge:hover {
    background: #c73d14;
}

.blog-detail-header h1 {
    font-family: var(--font-zh);
    font-size: 2.1rem;
    color: var(--ink);
    margin: 0 0 20px 0;
    line-height: 1.35;
    font-weight: 900;
    letter-spacing: -0.01em;
    overflow-wrap: break-word;
    word-break: break-word;
}

@media (max-width: 600px) {
    .blog-detail-header h1 {
        font-size: 1.5rem;
        line-height: 1.4;
    }
}

.blog-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

@media (max-width: 600px) {
    .blog-detail-meta {
        gap: 12px;
        font-size: 0.8rem;
    }
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
}

.meta-item svg {
    opacity: 0.6;
}

.blog-detail-meta a {
    color: var(--muted);
    text-decoration: none;
}

.blog-detail-meta a:hover {
    color: var(--accent);
}

.blog-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.blog-detail-tags .tag {
    padding: 5px 14px;
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.82rem;
    color: var(--muted);
    text-decoration: none;
    transition: all 0.2s;
}

.blog-detail-tags .tag:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.blog-detail-cover {
    margin-bottom: 30px;
    border-radius: var(--radius);
    overflow: hidden;
}

.blog-detail-cover img {
    width: 100%;
    height: auto;
    display: block;
}

.blog-detail-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--ink);
    overflow-wrap: break-word;
    word-break: break-word;
}

.blog-detail-content * {
    max-width: 100%;
}

.blog-detail-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 600px) {
    .blog-detail-content {
        font-size: 0.92rem;
        line-height: 1.75;
    }
    .blog-detail-content h2 {
        font-size: 1.25rem;
    }
    .blog-detail-content h3 {
        font-size: 1.1rem;
    }
    .blog-detail-content pre {
        padding: 14px;
        font-size: 0.82rem;
    }
}

.blog-detail-content h2 {
    font-family: var(--font-zh);
    font-size: 1.5rem;
    margin: 40px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.blog-detail-content h3 {
    font-size: 1.25rem;
    margin: 30px 0 15px 0;
}

.blog-detail-content p {
    margin: 0 0 20px 0;
}

.blog-detail-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 20px 0;
}

.blog-detail-content pre {
    background: var(--cream);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid var(--border);
}

.blog-detail-content code {
    background: var(--cream);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
}

.blog-detail-content pre code {
    background: none;
    padding: 0;
}

.blog-detail-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 20px;
    margin: 20px 0;
    color: var(--muted);
    font-style: italic;
}

.blog-detail-content ul,
.blog-detail-content ol {
    margin: 0 0 20px 0;
    padding-left: 30px;
}

.blog-detail-content li {
    margin-bottom: 8px;
}

/* ==================== 上一篇/下一篇 ==================== */
.prev-next-section {
    margin: 56px 0 0 0;
    padding: 28px 24px 24px;
    background: var(--cream);
    border-radius: 14px;
    border: 1px solid var(--border);
}

@media (max-width: 600px) {
    .prev-next-section {
        padding: 16px 14px;
        border-radius: 10px;
    }
}

.prev-next-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .prev-next-row {
        grid-template-columns: 1fr;
    }
}

.pn-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.25s;
    min-height: 72px;
}

@media (max-width: 600px) {
    .pn-card {
        gap: 10px;
        padding: 12px 14px;
    }
    .pn-arrow {
        width: 32px;
        height: 32px;
    }
}

.pn-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(233, 82, 28, 0.08);
    transform: translateY(-1px);
}

.pn-card:hover .pn-arrow {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.pn-card:hover .pn-title {
    color: var(--accent);
}

.pn-empty {
    background: transparent;
    border: 1px dashed var(--border);
    min-height: auto;
}

.pn-arrow {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: all 0.25s;
}

.pn-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.pn-next .pn-info {
    text-align: right;
}

.pn-label {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pn-title {
    color: var(--ink);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

/* ==================== 相关推荐（精简版：无缩略图） ==================== */
.related-section {
    margin-top: 20px;
    padding: 20px 24px;
    background: var(--cream);
    border-radius: 14px;
    border: 1px solid var(--border);
}

@media (max-width: 600px) {
    .related-section {
        padding: 14px;
        border-radius: 10px;
    }
    .related-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

.related-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.related-header h3 {
    font-family: var(--font-zh);
    font-size: 1rem;
    margin: 0;
    font-weight: 700;
    color: var(--ink);
}

.related-more {
    font-size: 0.82rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.related-more:hover {
    opacity: 0.7;
}

.related-list {
    display: flex;
    flex-direction: column;
}

.related-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    transition: color 0.2s;
}

.related-item:last-child {
    border-bottom: none;
}

.related-item:hover .related-item-title {
    color: var(--accent);
}

.related-item-title {
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.45;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s;
}

.related-item-date {
    font-size: 0.75rem;
    color: var(--muted);
    flex-shrink: 0;
}

/* ==================== 搜索页 ==================== */
.search-section {
    margin-bottom: 30px;
}

.search-form-large {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.search-input-large {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--card);
    color: var(--ink);
}

.search-input-large:focus {
    border-color: var(--accent);
    outline: none;
}

.search-btn-large {
    padding: 15px 30px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.search-btn-large:hover {
    background: #c73d14;
}

.result-count {
    color: var(--muted);
    margin-bottom: 20px;
}

.blog-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

.blog-empty .hint {
    font-size: 0.9rem;
    color: var(--muted);
}
