/* 文章内容中的图片样式 - 防止变形和保持响应式 */
.prose img {
    display: inline-block !important;
    height: auto !important;
    max-width: 100% !important;
    /* width: auto !important; */
    cursor: pointer; /* 为文章中的图片添加鼠标指针样式 */
    transition: transform 0.2s ease, box-shadow 0.2s ease; /* 添加悬停动画 */
    margin:20px 0;
}

/* 文章内容区域的默认样式 */
.prose a {
    color: #3b82f6 ; /* 蓝色链接 */
    text-decoration: underline ; /* 下划线 */
    transition: color 0.2s ease ; /* 颜色过渡效果 */
}

.prose a:hover {
    color: #1d4ed8 ; /* 悬停时更深的蓝色 */
    text-decoration: underline ; /* 保持下划线 */
}

.prose a:active {
    color: #1e40af ; /* 点击时的颜色 */
}

.prose p {
    line-height: 1.5 ; /* 行高1.5 */
    margin-top: 15px !important; /* 上边距15px */
    margin-bottom: 15px !important; /* 下边距15px */
    color:#333
}

/* 第一个p标签去除上边距，最后一个p标签去除下边距 */
.prose p:first-child {
    margin-top: 0 !important;
}

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

/* 文章图片悬停效果 */
.prose img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 通用图片样式 - 确保所有图片都不会变形 */
img {
    height: auto !important;
    max-width: 100%;
}

/* 编辑器内容区域的图片样式 */
.w-e-text-container img,
.w-e-text img {
    height: auto !important;
    max-width: 100% !important;
    width: auto !important;
}

/* 文本截断样式 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    max-height: 2.8em;
}

/* 自定义滚动条样式 */
.overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

.overflow-y-auto::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.overflow-y-auto::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 屏幕阅读器专用样式 - 视觉上隐藏但对屏幕阅读器可见 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 语义化标签的基础样式优化 */
article {
    position: relative;
}

/* 文章标签样式优化 */
article footer .inline-block {
    transition: all 0.2s ease-in-out;
}

article footer .inline-block:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 导航链接的焦点样式 */
nav a:focus,
article a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* 时间标签样式 */
time {
    font-variant-numeric: tabular-nums;
}

/* 去除所有a标签的默认边框和焦点样式 */
a {
    text-decoration: none;
    outline: none;
    border: none;
}

/* 去除a标签点击后的蓝色边框 */
a:focus,
a:active,
a:visited {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* 去除按钮和输入框的默认焦点边框 */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
    border-color: #3b82f6;
}

/* 确保链接在不同状态下都没有边框 */
a:link,
a:visited,
a:hover,
a:active {
    outline: none;
    border: none;
    text-decoration: none;
}

/* 图片预览遮罩层 */
.image-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: pointer;
}

/* 遮罩层显示状态 */
.image-preview-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 图片预览容器 */
.image-preview-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

/* 预览图片样式 */
.image-preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

/* 预览图片显示动画 */
.image-preview-overlay.show .image-preview-img {
    transform: scale(1);
}

/* 关闭按钮 */
.image-preview-close {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    transition: background-color 0.2s ease, transform 0.2s ease;
    z-index: 10001;
}

/* 关闭按钮悬停效果 */
.image-preview-close:hover {
    background-color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

/* 加载指示器 */
.image-preview-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
}

/* 旋转动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .image-preview-container {
        max-width: 95%;
        max-height: 95%;
    }
    
    .image-preview-close {
        top: -30px;
        right: -30px;
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
}

/* 防止图片预览时页面滚动 */
body.image-preview-open {
    overflow: hidden;
}

/* ===== 固定导航栏相关样式 ===== */

/* 确保固定导航栏在所有内容之上 */
nav.fixed {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* 添加阴影效果 */
    backdrop-filter: blur(8px); /* 添加背景模糊效果（现代浏览器支持） */
    -webkit-backdrop-filter: blur(8px); /* Safari支持 */
}

/* 为所有主内容区域添加上边距，避免被固定导航栏遮挡 */
main {
    padding-top: 76px !important; /* 导航栏高度60px + 16px额外间距 */
}

/* 移动端适配 - 确保导航栏在小屏幕上正常显示 */
@media (max-width: 768px) {
    /* 移动端导航栏样式调整 */
    nav.fixed {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    /* 移动端主内容区域上边距调整 */
    main {
        padding-top: 76px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* 确保页面滚动时导航栏保持固定 */
html {
    scroll-padding-top: 76px; /* 锚点跳转时的偏移量 */
}

/* 优化导航栏链接的悬停效果 */
nav a {
    transition: color 0.2s ease, opacity 0.2s ease;
}

nav a:hover {
    opacity: 0.8;
}

/* 导航栏logo图片优化 */
nav img {
    height: 24px;
    width: auto;
    object-fit: contain;
}
