/* 博客系统自定义样式 */

/* 字体安全策略 - 禁用可能的HTTP字体引用 */
@font-face {
    font-family: 'iconfont';
    src: none !important;
}

/* 基础样式变量 */
:root {
    --color-text-primary: #1a1a1a;
    --color-text-secondary: #6b7280;
    --color-text-tertiary: #9ca3af;
    --color-border-light: #f3f4f6;
    --color-bg-subtle: #fafafa;
}

/* 简洁的基础样式 */
.divider-subtle {
    height: 1px;
    background: #f3f4f6;
}

/* 渐变文字效果 */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 技能标签动画 */
.skill-tag {
    transition: all 0.3s ease;
}

.skill-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 统计卡片样式 */
.stat-card {
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* 阅读全文按钮样式 */
.read-more-btn {
    font-size: 0.75rem !important;
    padding: 0.375rem 0.75rem !important;
    border-radius: 0.375rem !important;
    transition: all 0.2s ease !important;
    background-color: #f3f4f6 !important;
    color: #6b7280 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.read-more-btn:hover {
    background-color: #e5e7eb !important;
    color: #374151 !important;
}

/* 文章底部容器样式 */
.flex.flex-col.sm\\:flex-row.sm\\:items-center.sm\\:justify-between {
    min-height: 2.5rem !important;
    margin-top: 1.5rem !important;
    padding-top: 1rem !important;
}

/* 统计信息容器样式 */
.flex.items-center.flex-wrap {
    flex: 1 !important;
    min-width: 0 !important;
}

/* 文章卡片内容区域优化 */
.bg-white.border.border-gray-100.rounded-lg .p-6,
.bg-white.border.border-gray-100.rounded-xl .p-8 {
    padding-bottom: 1.5rem !important;
}

/* 最终强制覆盖 - 所有可能的引用块样式 - 无左边框 */
div[style*="border-left"],
.custom-blockquote,
blockquote,
.prose blockquote,
.prose-lg blockquote,
*[class*="blockquote"] {
    border-left: none !important;
    background: #f9fafb !important;
    background-color: #f9fafb !important;
    color: #4b5563 !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    padding: 1rem !important;
    margin: 1rem 0 !important;
    border-radius: 0.5rem !important;
    font-style: italic !important;
}

/* 最终覆盖 - 引用块样式强制应用灰色主题 - 无左边框 */
* blockquote,
*:where(blockquote),
.prose :where(blockquote):not(:where([class~="not-prose"] *)),
.prose-lg :where(blockquote):not(:where([class~="not-prose"] *)) {
    border-left: none !important;
    background-color: #f9fafb !important;
    border-left-width: 0 !important;
    border-left-style: none !important;
}

/* 终极覆盖 - 使用最高优先级 - 无左边框 */
html body .prose blockquote,
html body .prose-lg blockquote,
html body div.prose blockquote,
html body div.prose-lg blockquote,
.custom-blockquote {
    border-left: none !important;
    background: #f9fafb !important;
    background-color: #f9fafb !important;
    padding: 1rem !important;
    margin: 1rem 0 !important;
    border-radius: 0.5rem !important;
    color: #4b5563 !important;
    font-style: italic !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    position: relative !important;
    z-index: 1 !important;
}

/* 标签区域与底部统计的间距 */
.flex.flex-wrap.gap-2.mb-4 {
    margin-bottom: 1.5rem !important;
}

/* 文章标签样式统一 */
.flex.flex-wrap.gap-2 a[href*="/tag/"] {
    font-size: 0.75rem !important;
    padding: 0.25rem 0.75rem !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .skill-tag {
        font-size: 0.75rem;
        padding: 0.25rem 0.75rem;
    }

    .read-more-btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

/* ========== 文章详情页样式 ========== */

/* 渐变文字效果 */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* 点赞按钮样式 */
.like-button {
    transition: all 0.3s ease;
}

.like-button:hover {
    transform: scale(1.05);
}

.like-button.liked {
    color: #ef4444;
}

/* 文章内容样式 - 清爽简洁的排版标准 */
.prose {
    max-width: none;
    font-size: 16px;
    line-height: 1.5;
    color: #374151;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 标题样式 - 与文章主标题保持层次一致 */
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    line-height: 1.7;
    letter-spacing: -0.025em;
}

.prose h1 {
    font-size: 1.5rem;  /* text-2xl = 24px，与文章主标题一致 */
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.prose h2 {
    font-size: 1.25rem;  /* text-xl = 20px，略小于H1 */
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.prose h3 {
    font-size: 1.125rem;  /* text-lg = 18px */
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.prose h4 {
    font-size: 1rem;  /* text-base = 16px */
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.prose h5, .prose h6 {
    font-size: 0.875rem;  /* text-sm = 14px */
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

/* 段落样式 - 清爽间距 */
.prose p {
    margin-bottom: 1rem;
    line-height: 1.5;
    text-align: left;
    hyphens: auto;
    word-break: break-word;
}

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

.prose p:first-child {
    margin-top: 0;
}

/* 文章详情页标题样式统一 */
.article-title {
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    line-height: 1.6 !important;
}

/* EasyMDE编辑器标题样式 - 与前台保持一致 */
.cm-s-easymde .cm-header-1 {
    font-size: 1.5rem !important;  /* 24px - 与前台H1一致 */
    font-weight: 600 !important;
    line-height: 1.7 !important;
    margin-bottom: 0.5rem !important;
}

.cm-s-easymde .cm-header-2 {
    font-size: 1.25rem !important;  /* 20px - 与前台H2一致 */
    font-weight: 600 !important;
    line-height: 1.7 !important;
    margin-bottom: 0.5rem !important;
}

.cm-s-easymde .cm-header-3 {
    font-size: 1.125rem !important;  /* 18px - 与前台H3一致 */
    font-weight: 600 !important;
    line-height: 1.7 !important;
    margin-bottom: 0.5rem !important;
}

.cm-s-easymde .cm-header-4 {
    font-size: 1rem !important;  /* 16px - 与前台H4一致 */
    font-weight: 600 !important;
    line-height: 1.7 !important;
    margin-bottom: 0.5rem !important;
}

.cm-s-easymde .cm-header-5 {
    font-size: 0.875rem !important;  /* 14px - 与前台H5一致 */
    font-weight: 600 !important;
    line-height: 1.7 !important;
    margin-bottom: 0.5rem !important;
}

.cm-s-easymde .cm-header-6 {
    font-size: 0.875rem !important;  /* 14px - 与前台H6一致 */
    font-weight: 600 !important;
    line-height: 1.7 !important;
    margin-bottom: 0.5rem !important;
}

/* 编辑器预览区域的标题样式也保持一致 */
.editor-preview h1 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    line-height: 1.7 !important;
    color: #1f2937 !important;
    margin-top: 2.5rem !important;
    margin-bottom: 1rem !important;
}

.editor-preview h2 {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    line-height: 1.7 !important;
    color: #1f2937 !important;
    margin-top: 2.5rem !important;
    margin-bottom: 1rem !important;
}

.editor-preview h3 {
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    line-height: 1.7 !important;
    color: #1f2937 !important;
    margin-top: 2rem !important;
    margin-bottom: 0.75rem !important;
}

.editor-preview h4 {
    font-size: 1rem !important;
    font-weight: 600 !important;
    line-height: 1.7 !important;
    color: #1f2937 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.5rem !important;
}

.editor-preview h5,
.editor-preview h6 {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    line-height: 1.7 !important;
    color: #1f2937 !important;
    margin-top: 1.25rem !important;
    margin-bottom: 0.5rem !important;
}

/* 代码块样式 - 清爽灰色主题 */
.code-block-wrapper {
    margin: 2rem 0;
}

.code-block {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1.5rem;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    color: #374151;
}

.code-block code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-weight: normal;
    font-family: inherit;
}

/* 内联代码样式 */
.inline-code {
    background: #f1f3f4;
    color: #5f6368;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

/* 兼容旧的prose样式 */
.prose pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 2rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.prose code {
    background: #f1f3f4;
    color: #5f6368;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.prose pre code {
    background: transparent;
    padding: 0;
    color: #374151;
    font-weight: normal;
}

/* 引用块样式 - 灰色主题 - 强制覆盖 - 无左边框 */
.prose blockquote,
.prose-lg blockquote,
.prose-xl blockquote,
.prose.prose-lg blockquote,
div.prose blockquote,
div.prose-lg blockquote,
article blockquote,
blockquote {
    border-left: none !important;
    background-color: #f9fafb !important;
    background: #f9fafb !important;
    padding: 1rem !important;
    margin: 1rem 0 !important;
    font-style: italic !important;
    border-radius: 0.5rem !important;
    color: #4b5563 !important;
    border: none !important;
}

/* 列表样式 - 完全左对齐，统一间距 */
.prose ul, .prose ol, .prose-ul, .prose-ol {
    margin: 1rem 0;
    padding-left: 0;
}

/* 无序列表样式 */
.prose ul, .prose-ul {
    list-style: none;
}

.ul-item {
    margin: 0.5rem 0;
    line-height: 1.5;
    padding-left: 1rem;
    text-align: left;
    position: relative;
}

.ul-item::before {
    content: "•";
    color: #3b82f6;
    font-weight: bold;
    position: absolute;
    left: 0;
    width: 0.75rem;
    text-align: center;
}

/* 有序列表样式 - 保持原始数字 */
.prose ol, .prose-ol {
    list-style: none;
    counter-reset: none;
}

.ol-item {
    margin: 0.5rem 0;
    line-height: 1.5;
    padding-left: 0;
    text-align: left;
    position: relative;
    margin-left: 0;
}

.ol-number {
    color: #3b82f6;
    font-weight: normal;
    display: inline-block;
    margin-right: 0.5rem;
    min-width: auto;
}

/* 列表项通用样式 */
.ul-item:last-child, .ol-item:last-child {
    margin-bottom: 0;
}

.ul-item:first-child, .ol-item:first-child {
    margin-top: 0;
}

/* 嵌套列表样式 */
.prose ul ul, .prose ol ol, .prose ul ol, .prose ol ul {
    margin: 0.75rem 0 0.75rem 1.5rem;
    padding-left: 0;
}

/* 确保列表项内容紧凑 */
.ul-item > *, .ol-item > * {
    margin-top: 0;
    margin-bottom: 0;
}

.ul-item > *:not(:last-child), .ol-item > *:not(:last-child) {
    margin-bottom: 0.25rem;
}

/* 强调文本样式 */
.prose strong {
    font-weight: 600;
    color: #1a202c;
}

.prose em {
    font-style: italic;
    color: #4a5568;
}

/* 链接样式 - 简洁设计 */
.prose-link {
    color: #4f46e5;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
}

.prose-link:hover {
    color: #3730a3;
    border-bottom-color: #4f46e5;
}

/* 兼容旧的prose链接样式 */
.prose a {
    color: #4f46e5;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
}

.prose a:hover {
    color: #3730a3;
    border-bottom-color: #4f46e5;
}

/* 表格样式 - 整齐清爽 */
.table-wrapper {
    margin: 2rem 0;
    overflow-x: auto;
}

.prose-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.prose-table th, .prose-table td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: top;
}

.prose-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.prose-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.prose-table tbody tr:hover {
    background-color: #f3f4f6;
}

/* 兼容旧的prose表格样式 */
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.9rem;
}

.prose th, .prose td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: top;
}

.prose th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.prose tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.prose tbody tr:hover {
    background-color: #f3f4f6;
}

/* 分隔线样式 */
.prose hr {
    border: none;
    height: 1px;
    background-color: #e5e7eb;
    margin: 3rem 0;
}

/* 图片样式 */
.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* 相关文章推荐样式 */
.related-articles {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 2rem;
    margin-top: 2.5rem;
}

.related-articles h3 {
    color: #374151;
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

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

.related-articles li {
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: flex-start;
}

.related-articles li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.related-articles li:first-child {
    padding-top: 0;
}

.related-articles a {
    color: #1f2937;
    text-decoration: none;
    font-weight: 500;
    line-height: 1.6;
    transition: color 0.2s ease;
    display: block;
}

.related-articles a:hover {
    color: #3b82f6;
}

.related-articles .meta {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.related-articles .number {
    background: #e5e7eb;
    color: #6b7280;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    margin-right: 1rem;
    margin-top: 0.125rem;
}
