/* blog-new-theme.css - 博客扁平化重构样式 */

:root {
    /* 配色方案 - 统一主站风格 */
    --blog-bg-body: #2b2b2b; /* 统一主站背景 */
    --blog-bg-content: #3a3a3a; /* 内容区域背景 */
    --blog-bg-hover: #424242; /* 悬浮背景 */
    --blog-bg-active: #4a4a4a; /* 激活背景 */
    
    --blog-border: rgba(255, 255, 255, 0.1); /* 统一主站边框 */
    --blog-border-light: rgba(255, 255, 255, 0.15);
    
    --blog-text-primary: #ffffff;
    --blog-text-secondary: #d0d0d0;
    --blog-text-muted: #888888;
    
    --blog-accent: #00D9FF; /* 统一主站强调色 */
    --blog-accent-brand: #3b82f6;
    
    --blog-font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    --header-height: 80px; /* 统一主站 header 高度 */
    --sidebar-width: 260px;
}

/* Reset & Global */
.blog-page-body {
    background-color: var(--blog-bg-body);
    color: var(--blog-text-primary);
    font-family: var(--blog-font-sans);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ------------------------------------------------
   Header (统一主站风格)
   ------------------------------------------------ */
/* 博客页面使用主站的 site-header 样式，这里只需要覆盖搜索框样式 */
.blog-header-search {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 16px;
}

.blog-header-search input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 10px 20px; /* 移除左侧额外 padding，因为已无图标 */
    color: var(--text, #fff);
    font-size: 14px; /* 增大字体 */
    width: 280px; /* 增大宽度 */
    height: 40px; /* 增加高度 */
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.blog-header-search input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    outline: none;
    width: 320px; /* 聚焦时更大 */
}

.blog-header-search input::placeholder {
    color: var(--muted, #888);
    font-size: 14px;
}

/* ------------------------------------------------
   Layout (左右布局)
   ------------------------------------------------ */
.blog-container-flat {
    max-width: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr; /* 左侧固定，右侧自适应 */
    gap: 0; /* 移除 gap，让侧边栏紧贴左侧 */
    padding: 40px 0 40px 0; /* 左侧无 padding，右侧无 padding */
    min-height: calc(100vh - var(--header-height));
}

/* ------------------------------------------------
   Sidebar (左侧面板)
   ------------------------------------------------ */
.blog-sidebar-flat {
    position: sticky;
    top: calc(var(--header-height) + 40px);
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 0 20px 0 24px; /* 左侧紧贴，右侧留出间距 */
    border-right: 1px solid var(--blog-border); /* 添加右边框分隔 */
}

/* Profile */
.sidebar-profile {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--blog-border);
}

.sidebar-profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.sidebar-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-info {
    flex: 1;
    min-width: 0;
}

.sidebar-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--blog-text-primary);
    margin-bottom: 2px;
}

.sidebar-bio {
    font-size: 12px;
    color: var(--blog-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-social {
    display: flex;
    gap: 10px;
}

.profile-social-link {
    font-size: 14px;
    color: var(--blog-text-muted);
    opacity: 0.7;
}

.profile-social-link:hover {
    opacity: 1;
    color: var(--blog-text-primary);
}

/* Navigation List */
.nav-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--blog-text-muted);
    margin-bottom: 12px;
    font-weight: 600;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item, .nav-group-title, .nav-link-sub {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--blog-text-secondary);
    font-size: 14px;
    transition: background 0.15s ease;
}

.nav-link {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    color: inherit;
}

.nav-item:hover, .nav-group-title:hover, .nav-link-sub:hover {
    background-color: var(--blog-bg-hover);
    color: var(--blog-text-primary);
}

.blog-category-link.active {
    background-color: var(--blog-bg-active);
    color: var(--blog-text-primary);
    font-weight: 500;
}

.nav-badge {
    font-size: 11px;
    color: var(--blog-text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Submenu */
details summary {
    list-style: none;
}
details summary::-webkit-details-marker {
    display: none;
}

.nav-group-list {
    padding-left: 16px; /* 缩进 */
    margin-top: 2px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-left: 1px solid var(--blog-border);
    margin-left: 8px;
}

.nav-link-sub {
    font-size: 13px;
}

/* ------------------------------------------------
   Content (右侧内容区)
   ------------------------------------------------ */
.blog-main-flat {
    padding: 0 24px 0 40px; /* 左侧留出更多空间，右侧紧贴 */
}

.blog-article-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.blog-card {
    background: rgba(58, 58, 58, 0.8); /* 统一主站卡片背景 */
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.1); /* 统一主站边框 */
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.blog-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(66, 66, 66, 0.85);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.blog-card-image-wrapper {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--blog-bg-content);
    position: relative;
    width: 100%;
}

/* 封面标签样式（与主页保持一致） */
.blog-card-image-wrapper .card-cover-tag-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: calc(100% - 60px);
    pointer-events: none;
    z-index: 5;
}

.blog-card-image-wrapper .card-cover-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 0.72em;
    font-weight: 600;
    line-height: 1;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(15, 15, 20, 0.78), rgba(15, 15, 20, 0.45));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    letter-spacing: 0.03em;
    text-transform: none;
    backdrop-filter: blur(6px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
    pointer-events: auto;
    white-space: nowrap;
    text-decoration: none;
}

.blog-card-image-wrapper .card-cover-tag-dot {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tag-color, #5ac8fa);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.blog-card-image-wrapper .card-cover-tag-more {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
}

/* 修复 renderOptimizedImage 生成的图片定位问题 */
.blog-card-image-wrapper picture {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    top: 0 !important;
    left: 0 !important;
    background: transparent !important;
}

.blog-card-image-wrapper picture img {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    top: 0 !important;
    left: 0 !important;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

/* 兼容直接使用 img 标签的情况 */
.blog-card-image-wrapper img:not(picture img) {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.blog-card:hover .blog-card-image-wrapper img,
.blog-card:hover .blog-card-image-wrapper picture img {
    opacity: 1;
}

.blog-card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.blog-card-meta {
    font-size: 12px;
    color: var(--blog-text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.blog-card-categories {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.blog-category-tag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 11px;
    color: var(--blog-text-secondary);
    transition: all 0.2s ease;
}

.blog-category-tag:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--blog-text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.blog-card-summary {
    font-size: 13px;
    color: var(--blog-text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.blog-card-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--blog-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--blog-text-muted);
    gap: 12px;
}

.blog-card-footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.blog-card-reading-time {
    color: var(--blog-text-muted);
    font-size: 12px;
}

.blog-card-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.blog-stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--blog-text-muted);
    font-size: 12px;
}

.blog-stat-icon {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.blog-stat-item span {
    min-width: 16px;
    text-align: right;
}

/* ------------------------------------------------
   Detail Page (详情页)
   ------------------------------------------------ */
/* 详情页布局：TOC放在右侧，内容在左侧 (沿用 Grid 结构，但可能需要不同的比例) */
.blog-post-page .blog-container-flat {
    display: grid;
    /* 左侧边栏(Nav) | 中间内容 | 右侧目录 */
    grid-template-columns: var(--sidebar-width) 1fr 240px;
    gap: 40px;
}

.blog-post-page .blog-sidebar-flat {
    display: block; /* 详情页也显示左侧导航，方便跳转 */
}

.blog-article-container {
    min-width: 0; /* 防止Grid溢出 */
}

.blog-post-header {
    margin-bottom: 40px;
    border-bottom: 1px solid var(--blog-border);
    padding-bottom: 20px;
}

.blog-post-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
    color: var(--blog-text-primary);
}

.blog-post-content {
    font-size: 16px;
    line-height: 1.8;
    color: #d4d4d4;
}

.blog-post-content h1, 
.blog-post-content h2, 
.blog-post-content h3 {
    color: var(--blog-text-primary);
    margin-top: 2em;
    margin-bottom: 0.8em;
    font-weight: 600;
}

.blog-post-content h2 {
    font-size: 24px;
    border-bottom: 1px solid var(--blog-border);
    padding-bottom: 8px;
}

.blog-post-content p {
    margin-bottom: 1.5em;
}

.blog-post-content img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid var(--blog-border);
}

.blog-post-content code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
    color: #ff79c6;
}

.blog-post-content pre {
    background: var(--blog-bg-content);
    border: 1px solid var(--blog-border);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
}

/* TOC Sidebar - 优化颜色和布局 */
.blog-toc-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 40px);
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 12px;
    padding-left: 8px;
}

.blog-toc-sidebar .blog-widget-title,
.blog-toc-sidebar h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--blog-text-primary);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.75;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.blog-toc-sidebar .blog-widget {
    padding: 0;
}

.blog-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-toc-item {
    margin-bottom: 2px;
}

.blog-toc-item a {
    display: block;
    font-size: 13px;
    color: var(--blog-text-secondary);
    padding: 8px 12px;
    line-height: 1.5;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 6px;
    margin-left: -12px;
    margin-right: -12px;
    position: relative;
}

.blog-toc-item a:hover {
    color: var(--blog-text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.blog-toc-item a:active {
    background-color: rgba(255, 255, 255, 0.08);
}

/* 当前激活的目录项 */
.blog-toc-item a.active {
    color: var(--blog-brand);
    background-color: rgba(0, 122, 255, 0.1);
    font-weight: 500;
}

.blog-toc-item.level-3 a {
    padding-left: 28px;
    font-size: 12px;
    opacity: 0.9;
}

.blog-toc-item.level-3 a::before {
    content: '•';
    position: absolute;
    left: 20px;
    color: var(--blog-text-muted);
    opacity: 0.5;
}

.blog-toc-item-empty {
    font-size: 12px;
    color: var(--blog-text-muted);
    padding: 16px 0;
    opacity: 0.5;
    text-align: center;
    font-style: italic;
}

/* Pagination, Comments, etc. */
.blog-empty-state {
    background: var(--blog-bg-content);
    border: 1px solid var(--blog-border);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    color: var(--blog-text-muted);
}

/* 快速定位按钮 - 参考图一风格（深灰色方块，浅灰色箭头） */
.blog-scroll-buttons {
    position: fixed;
    right: 24px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
}

.blog-scroll-btn {
    width: 44px;
    height: 44px;
    background-color: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(200, 200, 200, 0.8);
    font-size: 18px;
    font-weight: normal;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.blog-scroll-btn:hover {
    background-color: rgba(40, 40, 40, 0.95);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(240, 240, 240, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.blog-scroll-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .blog-scroll-buttons {
        right: 16px;
        bottom: 16px;
        gap: 6px;
    }
    
    .blog-scroll-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Comments Section - 美化样式 */
.blog-comments-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: none;
}

.blog-comments-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--blog-text-primary);
    margin-bottom: 16px;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.9;
}

/* 评论排序标签 */
.blog-comment-sort-tabs {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-comment-sort-tab {
    background: none;
    border: none;
    color: var(--blog-text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s ease;
    position: relative;
}

.blog-comment-sort-tab:hover {
    color: var(--blog-text-primary);
}

.blog-comment-sort-tab.active {
    color: #ff6b9d;
    font-weight: 600;
}

.blog-comment-sort-tab.active::after {
    content: '';
    position: absolute;
    bottom: -13px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #ff6b9d;
}

.blog-comment-view-author-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    color: var(--blog-text-secondary);
    font-size: 13px;
    cursor: pointer;
}

.blog-comment-view-author-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.blog-comment-view-author-checkbox:hover {
    color: var(--blog-text-primary);
}

.blog-comments-list {
    margin-bottom: 32px;
}

.blog-comments-empty {
    text-align: center;
    color: var(--blog-text-muted);
    padding: 48px 20px;
    font-size: 14px;
    opacity: 0.7;
}

/* 评论代码块样式 */
.blog-comment-code-block {
    margin: 8px 0;
    background-color: rgba(40, 44, 52, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.blog-comment-code-block pre {
    margin: 0;
    padding: 12px;
    overflow-x: auto;
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #abb2bf;
}

.blog-comment-code-block code {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    padding: 0;
    border: none;
}

.blog-comment-code-block::after {
    content: attr(data-lang);
    position: absolute;
    top: 0;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 0 0 4px 4px;
    text-transform: uppercase;
    font-weight: 500;
}

.blog-comment-inline-code {
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    background-color: rgba(135, 131, 120, 0.15);
    color: #eb5757;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

/* 评论表单 - 去除边框，使用更简洁的设计 */
.blog-comment-form-container {
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 32px;
}

.blog-comment-form-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--blog-text-primary);
    margin-bottom: 16px;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.9;
}

.blog-comment-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.blog-comment-editor {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.blog-comment-input {
    width: 100%;
    min-height: 120px;
    padding: 14px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--blog-text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
}

.blog-comment-input:focus {
    border-color: var(--blog-brand);
    background-color: rgba(255, 255, 255, 0.05);
    outline: none;
}

.blog-comment-input::placeholder {
    color: var(--blog-text-muted);
    opacity: 0.6;
}

.blog-comment-input-disabled {
    background-color: rgba(255, 255, 255, 0.02);
    cursor: not-allowed;
    opacity: 0.5;
}

.blog-comment-images-preview {
    margin-top: 10px;
}

.blog-comment-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.blog-comment-toolbar-left {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.blog-comment-btn {
    padding: 6px 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--blog-text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.blog-comment-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--blog-text-primary);
}

.blog-comment-btn span {
    font-size: 14px;
}

.blog-comment-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.blog-comment-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.blog-comment-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    opacity: 0.9;
}

.blog-comment-username {
    color: var(--blog-text-primary);
    font-size: 13px;
    font-weight: 500;
}

.blog-comment-user-badge {
    background-color: rgba(0, 122, 255, 0.2);
    color: var(--blog-brand);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    border: 1px solid rgba(0, 122, 255, 0.3);
}

.blog-comment-submit-btn {
    padding: 10px 20px;
    background-color: var(--blog-brand);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.blog-comment-submit-btn:hover {
    background-color: rgba(0, 122, 255, 0.9);
    transform: translateY(-1px);
}

.blog-comment-submit-btn:disabled {
    background-color: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    opacity: 0.5;
}

.blog-comment-login-prompt {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 30px;
}

.blog-comment-login-prompt .blog-comment-input {
    flex: 1;
}

/* 评论功能增强样式 */
.blog-comments-count {
    color: var(--blog-brand);
    font-weight: 600;
}

.blog-comment-nickname-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.blog-comment-nickname-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.blog-comment-nickname-label {
    font-size: 13px;
    color: var(--blog-text-muted);
}

.blog-comment-btn-code,
.blog-comment-btn-nickname,
.blog-comment-btn-quick-reply {
    /* 继承基础按钮样式 */
}

.blog-comment-view-author-only {
    color: var(--blog-text-muted);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-comment-view-author-only:hover {
    color: var(--blog-brand);
}

/* ============================
   [B站风格] 评论列表重构样式
   ============================ */

/* 重置部分旧样式 */
.blog-comment-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.blog-comment-item {
    display: flex !important;
    flex-direction: row !important; /* 强制横向排列 */
    gap: 16px;
    padding: 24px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    align-items: flex-start;
    background-color: transparent !important; /* 移除背景色 */
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}

/* 子评论样式重置 */
.blog-comment-item.is-reply {
    border-bottom: none;
    padding: 10px 0;
    margin-top: 0;
    margin-left: 0 !important; /* 交给容器控制缩进 */
    background-color: transparent !important;
}

/* 左侧头像区域 */
.blog-comment-left {
    flex-shrink: 0;
    width: 48px; /* 固定宽度 */
}

.blog-comment-item.is-reply .blog-comment-left {
    width: 24px;
}

.blog-comment-avatar-container {
    display: block;
    position: relative;
    cursor: pointer;
}

/* 头像样式 */
.blog-comment-item-avatar {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    object-fit: cover;
    border: none !important;
    transition: transform 0.2s;
}

.blog-comment-item.is-reply .blog-comment-item-avatar {
    width: 24px !important;
    height: 24px !important;
}

.blog-comment-avatar-container:hover .blog-comment-item-avatar {
    transform: scale(1.1);
}

/* 右侧内容区域 */
.blog-comment-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 用户信息行 */
.blog-comment-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 24px;
}

.blog-comment-username {
    font-size: 13px;
    font-weight: 600;
    color: #FB7299 !important; /* B站粉 */
    text-decoration: none;
    line-height: 1.2;
}

.blog-comment-username:hover {
    color: #ff85ad !important;
}

/* 等级徽章 */
.blog-comment-level {
    font-size: 10px;
    height: 16px;
    line-height: 14px;
    padding: 0 4px;
    border-radius: 2px;
    border: 1px solid currentColor;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    font-weight: normal;
}

.blog-comment-level.lv1 {
    color: #9499A0;
    border-color: #9499A0;
}

.blog-comment-level.lv6 {
    color: #FF6699;
    border-color: #FF6699;
}

.blog-comment-level.author {
    color: #FFB027;
    border-color: #FFB027;
}

/* UP主标签 */
.blog-comment-tag-author {
    font-size: 10px;
    background-color: #FFB027;
    color: #fff;
    padding: 0 4px;
    border-radius: 2px;
    height: 16px;
    line-height: 16px;
    display: inline-flex;
    align-items: center;
}

/* 评论内容 */
.blog-comment-content-container {
    margin-top: 2px;
}

.blog-comment-text {
    font-size: 15px;
    line-height: 24px;
    color: var(--blog-text-primary);
    word-wrap: break-word;
}

.blog-comment-text.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-comment-reply-at {
    color: var(--blog-text-primary);
    margin-right: 5px;
}

.blog-comment-expand-btn {
    color: #00A1D6;
    font-size: 13px;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    margin-top: 4px;
}

/* 图片展示 */
.blog-comment-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.blog-comment-image-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 4px;
    overflow: hidden;
    cursor: zoom-in;
    background: rgba(255,255,255,0.05);
}

.blog-comment-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 底部操作栏 */
.blog-comment-footer {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 4px;
    color: #99A2AA;
    font-size: 13px;
}

.blog-comment-time {
    color: #99A2AA;
}

.blog-comment-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.blog-comment-action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #99A2AA !important;
    font-size: 13px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s;
}

.blog-comment-action-btn:hover {
    color: #00A1D6 !important;
}

.blog-comment-action-btn.liked {
    color: #00A1D6 !important;
}

.blog-comment-action-btn.blog-comment-delete-btn {
    color: rgba(255, 82, 82, 0.8) !important;
    opacity: 0.7;
}

.blog-comment-action-btn.blog-comment-delete-btn:hover {
    color: #ff5252 !important;
    opacity: 1;
    background-color: rgba(255, 82, 82, 0.1);
}

.like-icon, .dislike-icon {
    font-style: normal;
    font-size: 14px;
    line-height: 1;
}

/* ============================
   回复区域样式 (B站风格 - 单行紧凑布局)
   ============================ */

.replies-container {
    margin-top: 10px;
    background: rgba(241, 242, 243, 0.05);
    border-radius: 4px;
    padding: 8px 12px;
}

.replies-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 单条回复项 - 紧凑布局 */
.reply-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    line-height: 22px;
}

.reply-avatar-link {
    flex-shrink: 0;
    margin-top: 2px;
}

.reply-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.reply-avatar:hover {
    opacity: 0.8;
}

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

/* B站风格：用户名、等级、内容在同一行流动 */
.reply-main-content {
    font-size: 14px;
    line-height: 22px;
    color: var(--blog-text-primary);
    word-wrap: break-word;
}

.reply-username {
    font-size: 13px;
    font-weight: 500;
    color: #FB7299;
    text-decoration: none;
    margin-right: 4px;
}

.reply-username:hover {
    color: #ff85ad;
}

.reply-level {
    font-size: 9px;
    height: 12px;
    line-height: 10px;
    padding: 0 3px;
    border-radius: 2px;
    border: 1px solid currentColor;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-right: 6px;
}

.reply-level.lv1 { color: #9499A0; border-color: #9499A0; }
.reply-level.lv6 { color: #FF6699; border-color: #FF6699; }
.reply-level.author { color: #FFB027; border-color: #FFB027; }

.reply-tag-author {
    font-size: 9px;
    background-color: #FFB027;
    color: #fff;
    padding: 0 3px;
    border-radius: 2px;
    height: 12px;
    line-height: 12px;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-right: 6px;
}

/* 回复内容直接跟在用户信息后面 */
.reply-text-inline {
    color: var(--blog-text-primary);
}

.reply-at-link {
    color: #00A1D6;
    text-decoration: none;
}

.reply-at-link:hover {
    text-decoration: underline;
}

.reply-images {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.reply-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: zoom-in;
}

.reply-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 4px;
    font-size: 12px;
    color: #99A2AA;
}

.reply-time {
    color: #99A2AA;
}

.reply-action-btn {
    background: none;
    border: none;
    padding: 0;
    color: #99A2AA;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    transition: color 0.2s;
}

.reply-action-btn:hover {
    color: #00A1D6;
}

.reply-action-btn.liked {
    color: #00A1D6;
}

.reply-action-btn.blog-comment-delete-btn {
    color: rgba(255, 82, 82, 0.8);
    opacity: 0.7;
}

.reply-action-btn.blog-comment-delete-btn:hover {
    color: #ff5252;
    opacity: 1;
    background-color: rgba(255, 82, 82, 0.1);
}

/* 展开/收起按钮 */
.replies-toggle {
    margin-top: 8px;
    padding: 4px 0;
    color: #00A1D6;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s;
}

.replies-toggle:hover {
    color: #23ade5;
}

.replies-toggle.expanded {
    color: #99A2AA;
}

.replies-toggle.expanded:hover {
    color: #00A1D6;
}

/* 用户信息卡片 */
.blog-user-card {
    position: fixed !important;
    width: 280px !important;
    max-width: 280px !important;
    max-height: 90vh !important;
    background-color: rgba(30, 30, 30, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 12px !important;
    padding: 0 !important;
    z-index: 10000 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: block !important;
    visibility: visible !important;
    transform: translateY(-10px) scale(0.95);
    animation: blogUserCardFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@keyframes blogUserCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes blogUserCardFadeOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
}

.blog-user-card:hover {
    transform: translateY(-2px) scale(1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7) !important;
}

/* 滚动条样式 */
.blog-user-card::-webkit-scrollbar {
    width: 6px;
}

.blog-user-card::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.blog-user-card::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.blog-user-card::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.blog-user-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.blog-user-card-avatar {
    width: 56px !important;
    height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid rgba(100, 150, 255, 0.5) !important;
    flex-shrink: 0 !important;
    display: block !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.blog-user-card-header:hover .blog-user-card-avatar {
    transform: scale(1.1) rotate(5deg);
    border-color: rgba(100, 150, 255, 0.8) !important;
    box-shadow: 0 0 20px rgba(100, 150, 255, 0.4);
}

.blog-user-card-info {
    flex: 1;
    min-width: 0;
}

.blog-user-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    transition: color 0.2s ease;
    cursor: pointer;
}

.blog-user-card-header:hover .blog-user-card-name {
    color: rgba(100, 150, 255, 1);
}

.blog-user-card-id {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.blog-user-card-stats {
    display: flex;
    justify-content: space-around;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-user-card-stat-item {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex: 1;
    padding: 8px 4px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.blog-user-card-stat-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(100, 150, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.blog-user-card-stat-item:hover {
    color: rgba(100, 150, 255, 1);
    background-color: rgba(100, 150, 255, 0.08);
    transform: translateY(-2px);
}

.blog-user-card-stat-item:hover::before {
    width: 100px;
    height: 100px;
}

.blog-user-card-stat-item > div:first-child {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
    position: relative;
    z-index: 1;
}

.blog-user-card-stat-item:hover > div:first-child {
    transform: scale(1.15);
    color: rgba(100, 150, 255, 1);
}

.blog-user-card-stat-item > div:last-child {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.blog-user-card-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.08);
    margin: 0;
}

.blog-user-card-action-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.blog-user-card-action-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.blog-user-card-action-item:hover {
    background-color: rgba(100, 150, 255, 0.15);
    transform: translateX(4px);
    color: rgba(100, 150, 255, 1);
}

.blog-user-card-action-item:hover::before {
    left: 100%;
}

.blog-user-card-action-item:active {
    transform: translateX(2px) scale(0.98);
    background-color: rgba(100, 150, 255, 0.25);
}

.blog-user-card-action-item.active {
    color: rgba(255, 255, 255, 0.9);
}

.blog-user-card-action-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.blog-user-card-action-item.disabled:hover {
    background-color: transparent;
}

.blog-user-card-action-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), stroke 0.2s ease;
    position: relative;
    z-index: 1;
}

.blog-user-card-action-item:hover .blog-user-card-action-icon {
    transform: scale(1.2) rotate(5deg);
    stroke: rgba(100, 150, 255, 1);
}

.blog-user-card-action-item:active .blog-user-card-action-icon {
    transform: scale(1.1) rotate(-5deg);
}

.blog-user-card-action-item.active .blog-user-card-action-icon {
    stroke: currentColor;
    fill: currentColor;
}

.blog-user-card-action-text {
    flex: 1;
    font-weight: 400;
}

.blog-user-card-loading,
.blog-user-card-error {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

/* 评论等级徽章 */
.blog-comment-item-badge.lv1 {
    background-color: rgba(100, 100, 100, 0.3);
    color: var(--blog-text-secondary);
}

.blog-comment-item-badge.lv6 {
    background-color: rgba(0, 122, 255, 0.3);
    color: var(--blog-brand);
}

.blog-comment-item-badge.author {
    background-color: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

/* 快捷回复菜单 */
.blog-quick-reply-menu {
    position: fixed;
    background-color: rgba(20, 20, 20, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 8px;
    z-index: 10001;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 120px;
}

.blog-quick-reply-item {
    padding: 8px 12px;
    color: var(--blog-text-primary);
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.blog-quick-reply-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 图片模态框动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .blog-container-flat {
        grid-template-columns: 200px 1fr; /* 缩小侧边栏 */
        gap: 20px;
        padding: 20px;
    }
    
    .blog-post-page .blog-container-flat {
        grid-template-columns: 1fr; /* 平板/详情页单列 */
    }
    
    .blog-post-page .blog-sidebar-flat,
    .blog-post-page .blog-toc-sidebar {
        display: none; /* 详情页隐藏侧边栏 */
    }
}

@media (max-width: 768px) {
    .blog-container-flat {
        grid-template-columns: 1fr;
    }
    
    .blog-sidebar-flat {
        display: none; /* 移动端隐藏侧边栏 */
    }
    
    .blog-header-container {
        padding: 0 16px;
    }
    
    .blog-header-search input {
        width: 120px;
    }
    .blog-header-search input:focus {
        width: 160px;
    }
    
    .blog-nav-left .blog-nav-link:not(.brand) {
        display: none; /* 移动端隐藏部分链接，或改用汉堡菜单 */
    }
}

/* Admin Todo Styles (Minimal) */
.sidebar-admin-tools {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--blog-border);
}

.todo-mini-widget {
    font-size: 12px;
    color: var(--blog-text-muted);
}

.todo-input-mini {
    width: 100%;
    background: transparent;
    border: 1px solid var(--blog-border);
    border-radius: 4px;
    padding: 4px;
    color: white;
    font-size: 12px;
    margin-top: 8px;
}
