/* style.css - 非专业技术宅博客样式 */
/* 基础样式重置 - 移至顶部，避免样式覆盖 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局样式 */
body {
    font-family: "Microsoft YaHei", sans-serif;
    line-height: 1.8;
    background-color: #f8f9fa;
}

a {
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

a:hover {
    color: #0d6efd;
}

/* 导航栏 - 与footer同底色 + 全白色字体 */
.navbar {
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    background: linear-gradient(135deg, #1a1f36 0%, #0f172a 100%) !important;
    margin-bottom: 20px; /* 增加导航栏与主内容区间距 */
}

/* 导航栏文字/图标统一白色（取消蓝色） */
.navbar-brand, .nav-link {
    color: #ffffff !important;
}

.nav-link.active {
    color: #ffffff !important; /* 激活项取消蓝色，改为白色 */
    font-weight: 600; /* 激活项加粗区分 */
}

.nav-link:hover {
    color: #ffffff !important; /* 鼠标划过保持白色 */
    opacity: 0.8; /* 划过仅降低透明度，不改变颜色 */
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-item {
    position: relative;
}

/* 二级菜单样式（全白色字体） */
.nav-item:hover .dropdown-menu {
    display: block;
    margin-top: 0;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 8px 0;
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    background-color: #343a40 !important;
}

.dropdown-item {
    padding: 8px 16px;
    transition: all 0.2s;
    color: #ffffff !important;
}

.dropdown-item:hover {
    background-color: rgba(255,255,255,0.1); /* 划过浅灰色背景，保持白色文字 */
    color: #ffffff !important;
}

.dropdown-item i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

/* 搜索栏优化 - 加宽搜索按钮+文字居中+增加间距 */
.navbar .form-control {
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    border: 1px solid #495057;
    border-radius: 8px 0 0 8px !important; /* 统一圆角样式 */
    background-color: #343a40;
    color: #ffffff;
    margin-right: 0 !important; /* 移除间距，避免按钮错位 */
    border-right: none !important;
}

.navbar .form-control::placeholder {
    color: #adb5bd;
}

.search-btn {
    height: 40px;
    width: 100px; /* 加宽搜索按钮（原80px） */
    padding: 0 10px; /* 增加左右内边距 */
    margin: 0;
    margin-left: 2px;
    border-radius: 0 8px 8px 0 !important; /* 统一圆角样式 */
    background-color: #4361ee !important;
    color: #fff !important;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center; /* 强制文字居中 */
    text-align: center;
}

.search-btn:hover {
    background-color: #3a0ca3 !important;
}

/* 新版轮播样式 */
.new-carousel {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 16px; /* 轮播与卡片间距缩短 */
}

.new-carousel .carousel-item {
    height: auto;
    position: relative;
}

.new-carousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.new-carousel .carousel-caption {
    position: absolute;
    bottom: 15px;
    left: 30px;
    right: auto;
    top: auto;
    background: rgba(0,0,0,0.6);
    padding: 8px 16px;
    border-radius: 8px;
    text-align: left;
}

.new-carousel .carousel-caption h5 {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
}

.new-carousel .carousel-caption h5 a{
  color:#fff
}

.new-carousel .carousel-caption p {
    display: none;
}

.new-carousel .carousel-indicators {
    bottom: 15px;
    right: 15px;
    left: auto;
    gap: 8px;
    margin: 0;
}

.new-carousel .carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    opacity: 0.6;
    border: none;
}

.new-carousel .carousel-indicators button.active {
    opacity: 1;
    background: #0d6efd;
}

.new-carousel .carousel-control-prev,
.new-carousel .carousel-control-next {
    width: 40px;
    height: 40px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
    margin: 0 10px;
    transition: background 0.3s;
}

.new-carousel .carousel-control-prev:hover,
.new-carousel .carousel-control-next:hover {
    background: rgba(0,0,0,0.6);
}

/* 博客卡片 - 增强轮廓 + 缩短间距 */
.blog-card {
    transition: transform 0.3s, box-shadow 0.3s;
    height: auto !important;
    overflow: hidden;
    border: 1px solid #ddd !important; /* 强化边框（从eee改为ddd） */
    border-radius: 8px;
    margin-bottom: 12px !important; /* 缩短卡片之间的间距 */
    background-color: #ffffff; /* 增加白色背景，突出轮廓 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* 基础阴影，增强轮廓感 */
    padding: 8px; /* 内边距，让内容与边框有间距 */
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1); /* hover增强阴影 */
    border-color: #0d6efd33 !important; /* hover时边框微蓝，强化交互 */
}

.blog-card .row {
    height: 100%;
}

.blog-card .card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-left: 1px solid #eee; /* 增加内容区左侧分割线，强化内部轮廓 */
    margin-left: 8px;
}

.blog-card .card-text {
    margin-bottom: 12px;
    flex: none;
}

.blog-card .blog-meta {
    padding-top: 8px;
    border-top: 1px solid #eee;
    margin-top: 8px;
    font-size: 13px;
}

.blog-card .card-img-container {
    height: 100%;
    padding: 8px; /* 图片容器增加内边距，与边框呼应 */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9; /* 图片容器浅灰背景，与白色卡片形成对比 */
    border-radius: 4px; /* 图片容器圆角，与卡片统一 */
}

.blog-card .card-img-container img {
    width: 100%; /* 宽度始终占满容器 */
    height: auto; /* 高度自动按比例缩放，关键修改 */
    object-fit: cover; /* 保持图片比例，裁剪超出部分（可选保留） */
    border-radius: 4px;
    border: 1px solid #eee;
    /* 可选：固定最大宽度，防止图片过大 */
    max-width: 100%;
    max-height: 500px; /* 根据需要设置最大高度 */
}

/* 侧边栏 - 增强所有栏目轮廓 */
.sidebar-title {
    border-bottom: 2px solid #0d6efd;
    padding-bottom: 8px;
    margin-bottom: 15px;
    color: #1a1f36;
    font-size: 0.95rem;
}

/* 右侧通用卡片样式（增强轮廓） */
.sidebar-card {
    border: 1px solid #ddd !important; /* 强化边框 */
    border-radius: 8px !important;
    background-color: #ffffff !important; /* 白色背景突出轮廓 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important; /* 基础阴影 */
    overflow: hidden !important;
    transition: box-shadow 0.3s !important;
    margin-bottom: 0.7rem !important;
}

.sidebar-card:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.08) !important; /* hover增强阴影 */
}

.sidebar-card .card-body {
    padding: 16px !important; /* 统一内边距 */
}

/* 广告位 - 增强轮廓 */
.ad-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: auto;
    margin-bottom: 17px;
    overflow: hidden; /* 新增：防止内容溢出容器 */
}

.ad-cardx {
    flex: 1;
    width: 100%;
    overflow: hidden;
    position: relative;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #ddd !important; /* 广告卡片增加边框 */
    background-color: #ffffff; /* 白色背景 */
 

}

.ad-cardx:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.ad-cardx img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
    
}

.ad-cardx:hover img {
    transform: scale(1.08);
}

/* 右侧栏目互动增强 */
.hot-article-item {
    transition: all 0.2s;
    border-radius: 6px;
    padding: 4px;
    margin-bottom: 8px;
}

.hot-article-item:hover {
    background-color: #e9f5ff;
    transform: translateX(4px);
}

.hot-article-item img {
    transition: transform 0.3s;
    border: 1px solid #eee; /* 热门文章图片增加边框 */
}

.hot-article-item:hover img {
    transform: scale(1.1);
}

/* 热门文章列表三列布局（替换之前的两列样式） */
.hot-article-list .notice-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* 项目间距（上下左右各10px），可按需调整 */
    margin: 0 -5px; /* 抵消左右侧间距溢出，避免容器横向滚动 */
}

.hot-article-list .notice-item {
    width: calc(33.333% - 10px); /* 三列平分宽度 - 间距补偿 */
    box-sizing: border-box; /* 确保padding/border不影响宽度计算 */
    padding: 0 5px; /* 配合外层margin，保证间距均匀 */
}

/* 公告栏目样式 */
.notice-item {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center; /* 垂直居中 */
    transition: all 0.2s;
    margin-bottom: 0.15rem;
    padding-bottom: 0.15rem;
    border-bottom: 1px dashed #e5e7eb;
}

.notice-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.notice-item:hover {
    background-color: #e9f5ff;
    padding-left: 4px;
    border-radius: 4px;
}

.notice-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: #4361ee;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
    margin-right: 10px;
    flex-shrink: 0;
}

.notice-content {
    flex: 1;
}

.notice-content a {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    transition: color 0.2s;
}

.notice-content a:hover {
    color: #4361ee;
}

.notice-time {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #6b7280;
}

.page-link {
    transition: all 0.2s;
}

.page-link:hover:not(.disabled) {
    background-color: #e9f5ff;
    color: #0d6efd;
    transform: translateY(-2px);
}

/* 页脚 */
footer {
    background-color: #212529 !important;
    color: #6b7280 !important;
    margin-top: 3rem !important;
    border-top: 1px solid #e9ecef !important;
    width: 100%;
    clear: both;
    padding: 2rem 0 !important;
}

footer h5 {
    color: #fff !important; /* 标题保持白色 */
}

footer a {
    color: #6b7280 !important;
    transition: all 0.2s;
}

footer a:hover {
    color: #fff !important;
    text-decoration: underline !important;
}

/* 修复页脚分割线颜色 */
footer hr.text-white-50 {
    border-color: #dee2e6 !important;
    opacity: 1 !important;
}

/* 图片懒加载占位样式（可选） */
img[loading="lazy"] {
    background: #f5f5f5;
    min-height: 50px;
}

/* 品牌图标样式 */
.navbar-brand img {
    filter: brightness(1.2); /* 提亮图标（适配深色导航栏） */
    transition: transform 0.2s; /* 鼠标悬浮动画 */
}

.navbar-brand:hover img {
    transform: scale(1.1); /* 悬浮时轻微放大 */
}

/* 返回顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #4361ee !important;
    color: white !important;
    border: none;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
    font-size: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease !important;
    transform: translateY(20px);
    z-index: 999;
}

.back-to-top:hover {
    background-color: #3a0ca3 !important;
    transform: translateY(-5px) !important;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    display: flex !important;
}

/* 侧边栏容器样式 */
.sidebar-container {
    position: sticky;
    top: 80px; /* 与导航栏高度匹配 */
    height: auto; /* 视口高度减去导航栏高度 */
    overflow-y: auto; /* 侧边栏内容过长时允许滚动 */
    padding-bottom: 5px; /* 底部留白 */
}

/* 滚动条样式 */
.sidebar-container::-webkit-scrollbar {
    width: 0px;
}

.sidebar-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0px;
}

.sidebar-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 0px;
}

.sidebar-container::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* 确保主内容区可以正常滚动 */
.col-lg-8 {
    height: auto;
    overflow: visible;
}

/* 文章内容外轮廓样式 */
.article-content {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 2rem;
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    /* 给问题 div 添加这 3 行样式，直接解决溢出不换行 */
word-break: break-all; /* 允许任意字符拆分（包括符号、英文），强制换行 */
overflow-wrap: break-word; /* 长文本/单词自动拆分到下一行，优先保证不溢出 */
width: 100%; /* 限制 div 宽度为父容器宽度，避免被文本撑大（若已有固定宽度可保留） */
}

/* 上一篇/下一篇导航样式 - 独立容器优化 */
.post-nav-container {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}
.post-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.post-nav a {
    display: flex;
    align-items: center;
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}
.post-nav a:hover {
    color: #0d6efd;
}
.prev-post i {
    margin-right: 0.5rem;
}
.next-post i {
    margin-left: 0.5rem;
}

/* 全新设计的公众号下载区 - 独立容器 + 轻奢简约风 */
.resource-section-container {
    width: 100%;
    margin: 0 0 3rem 0;
}
.resource-section {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f2f5;
    width: 100%;
}

/* 顶部装饰条 */
.resource-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4361ee, #3a0ca3);
}

/* 头部区域 */
.resource-header {
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid #f5f7fa;
}

.resource-header h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1f36;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resource-header h4 i {
    color: #4361ee;
    font-size: 1.4rem;
    margin-right: 0.75rem;
}

.resource-header p {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.6;
}

/* 主体内容 - 改为上下布局，分离验证区和下载区 */
.resource-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

/* 上半部分：二维码 + 验证区（横向布局） */
.resource-verify-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    width: 100%;
    transition: all 0.3s ease;
}

/* 隐藏验证区的类 */
.resource-verify-wrapper.hidden {
    display: none;
}

/* 二维码卡片 */
.qrcode-card {
    text-align: center;
}

.qrcode-wrapper {
    position: relative;
    display: inline-block;
    padding: 0.75rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.1);
    transition: transform 0.3s ease;
}

.qrcode-wrapper:hover {
    transform: translateY(-5px);
}

.qrcode-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(100% - 1px);
    height: calc(100% - 1px);
    border: 1px dashed #e2e8f0;
    border-radius: 8px;
    transform: translate(-50%, -50%);
}

.qrcode-img {
    width: 180px;
    height: 180px;
    border-radius: 8px;
    display: block;
}

.qrcode-desc {
    color: #4b5563;
    font-size: 0.875rem;
    line-height: 1.5;
}

.qrcode-desc span {
    color: #4361ee;
    font-weight: 600;
    font-size: 0.95rem;
}

/* 验证区域 - 独立卡片，宽度自适应 */
.verify-download {
    flex: 1;
    min-width: 280px;
    max-width: 500px;
    width: 100%;
}

.verify-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    width: 100%;
}

.verify-title {
    display: flex;
    align-items: center;
    color: #1e293b;
    font-weight: 600;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.verify-title i {
    font-size: 1.1rem;
    color: #4361ee;
    margin-right: 0.75rem;
}

.verify-form {
    margin-bottom: 1.5rem;
}

.form-control-custom {
    height: 48px;
    padding: 0 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #1e293b;
    transition: all 0.2s ease;
    background: #fff;
    width: 100%;
}

.form-control-custom:focus {
    border-color: #4361ee;
    outline: none;
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
}

.btn-custom {
    height: 48px;
    width: 100%;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(67, 97, 238, 0.2);
}

.btn-custom i {
    font-size: 1.1rem;
}

/* 下载列表 - 独立完整布局，占满宽度 */
.download-list-container {
    display: none; /* 默认隐藏 */
    width: 100%;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.3s ease; /* 显示动画 */
    padding-right: 6px;
    box-sizing: border-box;
}

/* 渐入动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.download-list-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 1.5rem;
}

.download-list-header h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.download-list-header h6 i {
    color: #4361ee;
    font-size: 1.2rem;
}

.download-count {
    font-size: 0.85rem;
    color: #6b7280;
    background: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    border: 1px solid #e2e8f0;
}

/* 下载列表标题栏样式 */
.download-list-title-bar {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
    width: 100%;
    box-sizing: border-box;
}

/* 标题栏列布局 */
.title-bar-name {
    flex: 1;
    min-width: 200px;
    padding-right: 1rem;
}

.title-bar-date {
    margin: 0 2rem;
    min-width: 100px;
    text-align: center;
    white-space: nowrap;
}

.title-bar-actions {
    min-width: 160px;
    text-align: center;
    white-space: nowrap;
}

.download-list-content {
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
    margin-right: -6px;
    padding-right: 12px;
}

/* 统一滚动条样式，固定宽度 */
.download-list-content::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.download-list-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
    margin: 5px 0;
}

.download-list-content::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
    border: none;
}

/* 滚动条hover时不改变宽度 */
.download-list-content::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

.download-item-custom {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    transition: background 0.2s ease, padding 0.2s;
    width: 100%;
    border-bottom: 1px solid #f1f5f9;
    box-sizing: border-box;
    position: relative;
    left: 0;
    justify-content: space-between;
}

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



.download-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: #e0f2fe;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.25rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.download-item-custom:hover .download-icon {
    background: #bae6fd;
    transform: scale(1.05);
}

.download-icon i {
    font-size: 1.25rem;
    color: #0284c7;
}

/* 不同文件类型的图标颜色区分 */
.download-icon.zip { background: #f0e7ff; }
.download-icon.zip i { color: #8b5cf6; }
.download-icon.code { background: #d1fae5; }
.download-icon.code i { color: #10b981; }
.download-icon.css { background: #dbeafe; }
.download-icon.css i { color: #3b82f6; }
.download-icon.pdf { background: #fee2e2; }
.download-icon.pdf i { color: #ef4444; }

.download-info {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 信息区域调整 */
.download-info-simple {
    display: flex;
    align-items: center;
    width: calc(100% - 180px); /* 预留下载按钮区域 */
    flex: 1;
    padding: 0.25rem 0;
}

.download-name {
    flex: 1;
    padding-right: 1rem; /* 与发布时间保持距离 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* 长文件名省略处理 */
    color: #1e293b;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    display: block;
    margin-bottom: 0.35rem;
    transition: color 0.2s ease;
    white-space: normal;
}



.download-desc {
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.download-date {
    font-size: 0.8rem;
    color: #64748b;
    min-width: 100px;
    text-align: center;
    margin: 0;
    padding-top: 0.25rem;
}

/* 下载按钮区域固定宽度 */
.download-actions-multiple {
    display: flex;
    align-items: center;
    gap: 0.3rem; /* 缩小按钮间距 */
    flex-shrink: 0;
    min-width: 180px;
    justify-content: flex-end;
}

.download-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* 从原来的 1rem 减小到 0.5rem 或更小 */
    flex-shrink: 0;
    min-width: 120px;
    justify-content: flex-end;
}

.download-size {
    font-size: 0.8rem;
    color: #6b7280;
    background: #f1f5f9;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    min-width: 60px;
    text-align: center;
}

.download-btn {
    padding: 0.4rem 0.8rem;
    background: #4361ee;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    min-width: 80px;
    justify-content: center;
    padding: 6px 12px;
    white-space: nowrap;
}

.download-btn:hover {
    background: #3a0ca3;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
}

/* 移动端适配 */
@media (max-width: 991px) {
    .download-list-content {
        margin-right: -4px;
        padding-right: 8px;
    }
    
    .download-list-content::-webkit-scrollbar {
        width: 4px;
    }

    .new-carousel .carousel-item {
        height: 250px;
    }
    
    .new-carousel .carousel-caption h5 {
        font-size: 18px;
    }
    
    .ad-container {
        height: auto;
        gap: 6px;
    }
    
    .new-carousel .carousel-control-prev,
    .new-carousel .carousel-control-next {
        width: 30px;
        height: 30px;
    }
    
    .dropdown-menu {
        box-shadow: none;
        border-radius: 0;
        background-color: #212529 !important;
    }
    
    .blog-card .card-img-container img {
        height: 150px;
    }
    
    .blog-card .card-body {
        border-left: none; /* 移动端取消左侧分割线 */
        margin-left: 0;
        padding-top: 12px;
        border-top: 1px solid #eee; /* 移动端改为顶部分割线 */
    }
    
    .navbar .form-control,
    .search-btn {
        height: 36px;
    }
    
    .search-btn {
        width: auto; /* 改为自动宽度，根据内容自适应 */
        min-width: 80px; /* 保留最小宽度，防止过窄 */
        padding: 0 12px; /* 增加左右内边距，给文字足够空间 */
        flex-shrink: 0; /* 防止按钮被压缩 */
    }
    
    /* 移动端侧边栏恢复默认布局 */
    .sidebar-container {
        position: static; /* 取消固定定位 */
        height: auto; /* 自动高度 */
        overflow-y: visible; /* 可见内容 */
    }

    /* 移动端上一篇/下一篇适配 */
    .post-nav {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    .post-nav-container {
        padding: 1rem 1.5rem;
    }

    /* 移动端下载区适配 */
    .resource-header {
        padding: 1.5rem 1.5rem 1rem;
    }
    
    .resource-body {
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .resource-verify-wrapper {
        gap: 1.5rem;
    }
    
    .qrcode-wrapper {
        padding: 0.5rem;
    }
    
    .qrcode-img {
        width: 150px;
        height: 150px;
    }
    
    .verify-card {
        padding: 1.25rem;
    }
    
    .article-content {
        padding: 1.5rem 1rem;
    }
}

/* 小屏移动端额外适配 */
@media (max-width: 768px) {
    .navbar .form-control {
        border-radius: 8px !important;
    }
    .search-btn {
        border-radius: 8px !important;
       /* width: 100%;
        margin-top: 8px !important;*/
        margin-left: 2px;
        margin-right: 5px;
    }
    
    .download-list-title-bar {
        display: none; /* 移动端隐藏标题栏 */
    }
    
    .download-item-custom {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
        position: relative;
    }
    
    .download-item-custom:hover {
        padding-left: calc(1rem + 5px);
        padding-right: calc(1rem - 5px);
    }
    
    .download-info-simple,
    .download-actions-multiple,
    .title-bar-name,
    .title-bar-date,
    .title-bar-actions {
        width: 100%;
        min-width: auto;
        text-align: left;
    }
    
    .download-date {
        position: absolute;
        top: 0.75rem;
        right: 1rem;
        background: rgba(255,255,255,0.8);
        padding: 0.2rem 0.5rem;
        border-radius: 4px;
    }
    
    .download-actions-multiple {
        justify-content: space-between;
        margin-top: 0.75rem;
    }

    .download-actions {
        width: 100%;
        justify-content: space-between;
        margin-top: 0.5rem;
        min-width: auto;
        gap: 0.5rem;
    }
    
    .download-icon {
        margin-right: 0;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 1rem;
        right: 1rem;
    }
    
    /* 移动端修复滚动条 */
    .download-list-container {
        padding-right: 4px;
    }
}

/* 内容框基础样式（控制内容框宽度、居中、内边距） */
.article-body.content-box {
  width: 100%;
  max-width: 1200px; /* 可根据你的网站布局调整，比如车机端设为 100% */
  margin: 0 auto; /* 页面居中显示 */
  padding: 0 20px; /* 左右留边距，避免内容贴边 */
  box-sizing: border-box; /* 防止 padding 导致内容框溢出 */
}

/* 内容框内图片自适应（核心样式） */
.article-body.content-box img {
  width: 100% !important; /* 强制适应父容器宽度 */
  height: auto !important; /* 自动保持宽高比，不拉伸 */
  max-width: 100% !important; /* 防止图片超出内容框 */
  object-fit: contain; /* 完整显示图片，不裁剪 */
  display: block; /* 消除图片底部默认空白缝隙 */
  margin: 10px 0; /* 上下留间距，更美观（可按需调整） */
  border: none; /* 去除图片默认边框（可选） */
}