/* style.css */
/* ========== 全局样式 ========== */
body {
    font-family: 'Roboto', 'Noto Serif SC', sans-serif;
    background-color: #f8f9fa;
    color: #333;
}
h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: 'Noto Serif SC', serif;
    font-weight: 700;
}

/* ========== 导航栏样式 ========== */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    background-color: #fff !important;
    transition: all 0.3s ease;
}
.navbar-brand {
    color: #2c3e50 !important;
    font-size: 1.5rem;
}

/* 导航链接：强制行内弹性布局 */
.nav-link {
    color: #555 !important;
    font-weight: 500;
    margin: 0 10px;
    position: relative;
    display: inline-flex !important;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

/* 下划线：用 ::before 避免与箭头冲突 */
.nav-link::before {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #3498db;
    transition: width 0.3s ease;
}
.nav-link:hover::before { width: 100%; }
.nav-link:hover { color: #3498db !important; }

/* 下拉箭头：独占 ::after 伪元素 */
.dropdown-toggle::after {
    display: inline-block !important;
    border-top: 0.4em solid;
    border-right: 0.4em solid transparent;
    border-bottom: 0;
    border-left: 0.4em solid transparent;
    vertical-align: middle;
    margin-left: 0;
    opacity: 0.7;
    transition: transform 0.3s ease;
}
.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* 子菜单美化 */
.dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    padding: 0.8rem 0;
    margin-top: 0.5rem;
    animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.dropdown-item {
    padding: 0.6rem 1.5rem;
    color: #555;
    font-weight: 400;
    transition: all 0.2s ease;
}
.dropdown-item:hover {
    background-color: #e8f4fd;
    color: #3498db;
    padding-left: 1.8rem;
}
.dropdown-divider { margin: 0.5rem 1rem; border-color: #eee; }
.dropdown-menu .dropdown-menu { margin-top: -0.5rem; margin-left: 0.5rem; }


/* ========== Banner 样式 ========== */
.hero-banner {
    // background: linear-gradient(rgba(44, 62, 80, 0.7), rgba(44, 62, 80, 0.7)), url('') center/cover no-repeat;
    height: 500px;
    position: relative;
    overflow: hidden;
}

.hero-banner .carousel-item {
    height: 500px;
    position: relative;
    display: none;
    align-items: center;
    justify-content: center;
}
.hero-banner .carousel-item.active { display: flex; }

/* ✅ 关键修复：放弃 .container，改用 100% 宽度 + 动态 padding */
.hero-banner .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 100px !important;
    padding-right: 100px !important;
}

.hero-banner h2 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: white;
    text-align: center;
    animation: fadeInDown 0.8s ease-out;
    margin: 0;
}

.hero-banner p {
    font-size: 1.2rem;
    font-weight: 300;
    margin-top: 1rem;
    color: rgba(255, 255, 255);
    text-align: center;
    animation: fadeInUp 0.8s ease-out 0.2s;
    animation-fill-mode: both;
    margin-bottom: 0;
}

/* ✅ 响应式适配：屏幕越宽，预留空间越大 */
@media (max-width: 768px) {
    .hero-banner .container {
        padding-left: 60px !important;
        padding-right: 60px !important;
    }
    .hero-banner h2 { font-size: 2rem; }
    .hero-banner p { font-size: 0.8rem; }
}

@media (min-width: 1400px) {
    .hero-banner .container {
        padding-left: 140px !important;
        padding-right: 140px !important;
    }
}

@media (min-width: 1920px) {
    .hero-banner .container {
        padding-left: 200px !important;
        padding-right: 200px !important;
    }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translate3d(0, -30px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translate3d(0, 30px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Banner 底部指示器 */
.carousel-indicators { bottom: 20px; margin-bottom: 0; }
.carousel-indicators [data-bs-target] {
    width: 12px; height: 12px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.6);
    background-color: transparent; margin: 0 6px;
    transition: all 0.3s ease;
}
.carousel-indicators .active {
    background-color: #fff; border-color: #fff; transform: scale(1.2);
}

/* ========== 栏目通用样式 ========== */
.section-title {
    position: relative; padding-bottom: 15px; margin-bottom: 40px;
    color: #2c3e50;
	text-align: center;
}
.section-title::after {
    content: ''; position: absolute; bottom: 0; left: 50%;
    transform: translateX(-50%); width: 60px; height: 3px;
    background-color: #3498db;
}

/* 栏目简介样式 */
.section-desc {
    color: #7f8c8d;
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* 技术文档卡片 */
.doc-card {
    border: none; border-radius: 15px; background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease; height: 100%; overflow: hidden;
    position: relative;
}
.doc-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%;
    height: 5px; background: linear-gradient(90deg, #3498db, #2ecc71);
    opacity: 0; transition: opacity 0.3s ease;
}
.doc-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
.doc-card:hover::before { opacity: 1; }
.doc-card .card-body { padding: 2rem; }
.doc-card .card-title { color: #2c3e50; margin-bottom: 1rem; }
.doc-card .card-text { color: #7f8c8d; line-height: 1.7; }

/* 技术文章瀑布流 */
.masonry-grid { column-count: 1; column-gap: 2rem; }
@media (min-width: 768px) { .masonry-grid { column-count: 2; } }
@media (min-width: 992px) { .masonry-grid { column-count: 3; } }
.masonry-item {
    break-inside: avoid; margin-bottom: 2rem; background: #fff;
    border-radius: 15px; box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease; overflow: hidden;
}
.masonry-item:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
.masonry-item .card-body { padding: 1.5rem; }
.masonry-item .card-title { color: #2c3e50; font-size: 1.2rem; margin-bottom: 1rem; }
.masonry-item .card-text { color: #7f8c8d; font-size: 0.95rem; line-height: 1.6; }
.masonry-item small { color: #95a5a6; display: block; margin-top: 1rem; text-align: right; }

/* 书籍分享 - 左图右文列表 */
.book-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* PC端一行两本 */
@media (min-width: 768px) {
    .book-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.book-list-item {
    display: flex;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    /* ✅ 关键修复：移除 overflow: hidden，避免裁剪图片圆角 */
    transition: all 0.3s ease;
    height: 100%;
}

.book-list-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.book-list-item .book-cover {
    width: 140px;
    min-width: 140px;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
    /* ✅ 关键修复：为图片单独设置圆角，确保四角全圆 */
    border-radius: 15px 0 0 15px;
}

.book-list-item:hover .book-cover {
    transform: scale(1.05);
}

.book-list-item .book-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* ✅ 改为顶端对齐 */
    flex: 1;
}

.book-list-item .book-title {
    font-size: 1.25rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.book-list-item .book-meta {
    color: #95a5a6;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.book-list-item .book-desc {
    color: #7f8c8d;
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0;
}

/* 移动端适配 */
@media (max-width: 576px) {
    .book-list-item .book-cover {
        width: 110px;
        min-width: 110px;
        height: 160px;
    }
    .book-list-item .book-info {
        padding: 1rem;
    }
    .book-list-item .book-title {
        font-size: 1.1rem;
    }
}


/* 软件分享 - 工具卡片风格 */
.software-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .software-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.software-card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    height: 100%;
}

.software-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.software-card .software-title {
    font-size: 1.25rem;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.software-card .software-desc {
    color: #7f8c8d;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex: 1;
}

.software-card .software-links {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.software-card .software-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.software-card .btn-official {
    background-color: #f0f4f8;
    color: #3498db;
}
.software-card .btn-official:hover {
    background-color: #3498db;
    color: #fff;
}

.software-card .btn-download {
    background-color: #3498db;
    color: #fff;
}
.software-card .btn-download:hover {
    background-color: #2980b9;
    color: #fff;
}

.software-card .software-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.software-card .software-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    color: #3498db;
    background-color: #e8f4fd;
    border-radius: 20px;
    white-space: nowrap;
}

/* 友情链接 */
.friend-link {
    display: inline-block; padding: 10px 20px; margin: 5px;
    border: 1px solid #e0e0e0; border-radius: 30px; color: #555;
    text-decoration: none; transition: all 0.3s ease; background-color: #fff;
}
.friend-link:hover {
    background-color: #3498db; color: #fff; border-color: #3498db;
    transform: translateY(-3px); box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

/* 页脚 */
footer {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #ecf0f1; padding: 3rem 0; margin-top: 4rem;
}
footer a { color: #bdc3c7; text-decoration: none; transition: color 0.3s ease; }
footer a:hover { color: #fff; }

/* 栏目底部“更多”入口 */
.section-more {
    text-align: center;
    margin-top: 2.5rem;
}
.section-more a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #3498db;
    font-weight: 500;
    text-decoration: none;
    padding: 0.6rem 1.5rem;
    border: 1px solid #3498db;
    border-radius: 30px;
    transition: all 0.3s ease;
}
.section-more a:hover {
    background-color: #3498db;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

/* 通用弹窗样式 */
.custom-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.custom-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}
.custom-modal {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.custom-modal-overlay.show .custom-modal {
    transform: scale(1);
}
.custom-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}
.custom-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}
.custom-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #95a5a6;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}
.custom-modal-close:hover {
    color: #2c3e50;
}
.custom-modal-body {
    flex: 1;
    overflow: auto;
    padding: 0;
}
.custom-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}
.custom-modal-body .modal-html-content {
    padding: 1.5rem;
}
/* ✅ 统一鼠标指针样式 */
.doc-card,
.masonry-item,
.book-list-item,
.software-card,
.friend-link,
.dropdown-item {
    cursor: pointer;
}

/* 联系方式栏目 */
.contact-section {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 3rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.contact-items {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-5px);
}

.contact-item .contact-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #e8f4fd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #3498db;
    transition: all 0.3s ease;
}

.contact-item:hover .contact-icon {
    background-color: #3498db;
    color: #fff;
}

.contact-item .contact-label {
    font-size: 0.95rem;
    color: #555;
    font-weight: 500;
}

.contact-item .contact-value {
    font-size: 0.85rem;
    color: #95a5a6;
}

/* 移动端适配 */
@media (max-width: 576px) {
    .contact-items {
        gap: 2rem;
    }
    .contact-item .contact-icon {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}