﻿/* ---------- 颜色变量 ---------- */
:root {
    --primary-color: #0078ff; /* 主题色 */
    --primary-hover: #0056b3; /* 主题色 hover */
    --accent-color: #ffeb3b; /* 高亮色 */
    --bg-color: #f5f5f5; /* 页面背景 */
    --text-color: #555; /* 一般文字 */
    --white: #fff; /* 白色 */
    --shadow-color: rgba(0,0,0,0.1); /* 阴影 */
    --success-color: #28a745; /* 成功提示颜色 */
    --error-color: #dc3545; /* 错误提示颜色 */
    --modal-bg: var(--white); /* 弹窗背景色 */
    --modal-input-border: #ccc; /* 弹窗输入框边框色 */
    --modal-input-focus: var(--primary-color); /* 弹窗输入框聚焦色 */
    --modal-btn-bg: var(--primary-color); /* 弹窗按钮背景色 */
    --modal-btn-hover: var(--primary-hover); /* 弹窗按钮 hover 色 */
    --modal-btn-cancel-bg: #999; /* 弹窗取消按钮背景色 */
    --modal-btn-cancel-hover: #777; /* 弹窗取消按钮 hover 色 */
}

/* ---------- 基本样式 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei",sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
}

/* ---------- 容器 ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
/*    padding: 0 20px;*/
}

/* ---------- 顶部导航 ---------- */
.header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 10px 0;
    box-shadow: 0 2px 5px var(--shadow-color);
    position: relative;
}

    .header .logo {
        font-size: 1.8em;
        font-weight: bold;
    }

.nav-links a {
    color: var(--white);
    text-decoration: none;
    margin-left: 20px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: 0.3s;
}

    .nav-links a:hover {
        background: rgba(255,255,255,0.2);
        color: var(--accent-color);
    }

/* ---------- 移动端汉堡 ---------- */
/* ---------- 移动端汉堡 ---------- */
.hamburger {
    display: none;
    font-size: 1.8em;
    cursor: pointer;
    color: var(--white);
    z-index: 10001; /* 高于遮罩层 */
    padding: 5px 10px;
    user-select: none;
}

/* 左侧滑出菜单 */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -250px; /* 初始隐藏在左边 */
    width: 250px;
    height: 100%;
    background: var(--primary-color);
    flex-direction: column;
    padding-top: 60px;
    box-shadow: 2px 0 12px rgba(0,0,0,0.3);
    transition: left 0.3s ease;
    z-index: 10002; /* 确保在遮罩层上方 */
    display: flex;
}

    /* 展开状态 */
    .mobile-menu.show {
        left: 0;
    }

/* 遮罩层 */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10000; /* 遮罩层在菜单下方 */
}

    .mobile-menu-overlay.show {
        opacity: 1;
        pointer-events: all;
    }

/* 菜单链接 */
.mobile-menu a {
    color: var(--white);
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    text-decoration: none;
    font-size: 16px;
    transition: background 0.3s;
}

    .mobile-menu a:hover {
        background: rgba(255,255,255,0.1);
    }

/* ---------- 搜索栏 ---------- */
.search-bar {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
}

    .search-bar input {
        width: 70%;
        padding: 8px 10px;
        border-radius: 4px 0 0 4px;
        border: 1px solid #ccc;
        outline: none;
    }

    .search-bar button {
        padding: 8px 15px;
        border: none;
        background: var(--primary-color);
        color: var(--white);
        border-radius: 0 4px 4px 0;
        cursor: pointer;
        transition: 0.3s;
    }

        .search-bar button:hover {
            background: var(--primary-hover);
        }

/* ---------- 轮播图 ---------- */
.banner {
    position: relative;
    max-width: 1200px;
    margin: 20px auto;
    overflow: hidden;
    border-radius: 6px;
    padding-top: 25%;
}

    .banner img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: 0;
        transition: opacity 0.5s;
    }

        .banner img.active {
            opacity: 1;
        }

.banner-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
}

    .banner-dots span {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #ccc;
        cursor: pointer;
        transition: 0.3s;
    }

        .banner-dots span.active {
            background: var(--primary-color);
        }

/* ---------- 分类 ---------- */
.categories {
    margin: 20px auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    max-width: 1200px;
    padding: 0 20px;
}

.category {
    background: var(--white);
    padding: 10px 15px;
    border-radius: 4px;
    box-shadow: 0 2px 5px var(--shadow-color);
    cursor: pointer;
    transition: 0.3s;
}

    .category:hover {
        transform: translateY(-3px);
    }

/* ---------- 热门文档 ---------- */
.hot-docs1 {
    max-width: 1200px;
    margin: 20px auto;
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(220px,1fr));
    gap: 20px;
    padding: 0 20px;
}

.doc-card {
    background: var(--white);
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 2px 5px var(--shadow-color);
    cursor: pointer;
    transition: 0.3s;
}

    .doc-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 5px 15px var(--shadow-color);
    }

    .doc-card img {
        width: 100%;
        border-radius: 4px;
        margin-bottom: 10px;
    }

    .doc-card h3 {
        font-size: 1.1em;
        margin-bottom: 5px;
        color: #333;
    }

    .doc-card p {
        font-size: 0.9em;
        color: var(--text-color);
    }

    .doc-card button {
        margin-top: 10px;
        padding: 5px 10px;
        border: none;
        border-radius: 4px;
        background: var(--primary-color);
        color: var(--white);
        cursor: pointer;
        transition: 0.3s;
    }

        .doc-card button:hover {
            background: var(--primary-hover);
        }

/* ---------- 验证码弹窗 ---------- */
#captchaModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

    #captchaModal .modal-content {
        background: var(--modal-bg);
        padding: 25px 20px;
        border-radius: 10px;
        min-width: 320px;
        max-width: 400px;
        text-align: center;
        box-shadow: 0 8px 20px rgba(0,0,0,0.2);
        animation: fadeIn 0.3s ease;
    }

    #captchaModal h3 {
        margin-bottom: 15px;
        font-size: 1.3em;
        color: #333;
    }

    #captchaModal input[type="text"] {
        width: 80%;
        padding: 10px;
        margin: 10px 0;
        border: 1px solid var(--modal-input-border);
        border-radius: 6px;
        font-size: 1em;
        transition: all 0.3s;
    }

        #captchaModal input[type="text"]:focus {
            outline: none;
            border-color: var(--modal-input-focus);
            box-shadow: 0 0 5px var(--modal-input-focus);
        }

    #captchaModal button {
        padding: 8px 20px;
        margin: 5px;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        font-size: 0.95em;
        color: var(--white);
        background: var(--modal-btn-bg);
        transition: all 0.3s;
    }

        #captchaModal button:hover {
            background: var(--modal-btn-hover);
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }

        #captchaModal button:nth-child(2) {
            background: var(--modal-btn-cancel-bg);
        }

            #captchaModal button:nth-child(2):hover {
                background: var(--modal-btn-cancel-hover);
            }

/* ---------- 底部 ---------- */
.footer {
    background: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 20px 0;
}

/* ---------- 消息提示框 ---------- */
.msg-box {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    min-width: 200px;
    max-width: 300px;
    padding: 12px 20px;
    border-radius: 8px;
    background: var(--primary-color);
    color: var(--white);
    font-size: 14px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s, transform 0.5s;
    z-index: 9999;
}

    .msg-box.show {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    .msg-box.success {
        background: var(--success-color);
    }

    .msg-box.error {
        background: var(--error-color);
    }

/* ---------- 动画 ---------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- 响应式 ---------- */
@media(max-width:480px) {
    #captchaModal .modal-content {
        width: 90%;
        padding: 20px;
    }

    #captchaModal input[type="text"] {
        width: 90%;
    }
}

@media(max-width:768px) {
    .container {
        flex-direction: row;
        justify-content: space-between;
    }

    .nav-links {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .categories {
        justify-content: center;
    }

    .search-bar input {
        width: 60%;
    }
}

/* ---------- 下载内容 ---------- */
.download-box {
    background: var(--white);
    padding: 20px;
/*    border-radius: 6px;*/
    box-shadow: 0 2px 5px var(--shadow-color);
}

    .download-box h2 {
        margin-bottom: 15px;
        color: #333;
    }

    .download-box p {
        margin-bottom: 10px;
    }

    .download-box button {
        padding: 8px 15px;
        border: none;
        border-radius: 4px;
        background: var(--primary-color);
        color: var(--white);
        cursor: pointer;
        transition: 0.3s;
    }

        .download-box button:hover {
            background: var(--primary-hover);
        }

/* ---------- 相关文档 ---------- */
.related-box {
/*    margin-top: 20px;*/
    background: var(--white);
    padding: 15px;
/*    border-radius: 6px;*/
    box-shadow: 0 2px 5px var(--shadow-color);
}

    .related-box h3 {
        margin-bottom: 10px;
    }

    .related-box ul {
        list-style: none;
        padding-left: 0;
    }

        .related-box ul li {
            margin-bottom: 5px;
        }


.content-wrapper {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.hot-docs, .hot-downloads {
    flex: 1;
}

    .hot-docs h2, .hot-downloads h2 {
        margin-bottom: 15px;
        font-size: 1.5em;
        color: #333;
    }

/* 保持 doc-card 样式一致 */
.doc-card {
    background: var(--white);
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 2px 5px var(--shadow-color);
    cursor: pointer;
    margin-bottom: 20px;
    transition: 0.3s;
}

    .doc-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 5px 15px var(--shadow-color);
    }

/* 每行两个卡片 */
.doc-row {
    display: flex;
    gap: 20px; /* 卡片间距 */
    margin-bottom: 20px;
}

.doc-card {
    flex: 1; /* 平分每行空间 */
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: 0.3s;
}

    .doc-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    }


/* 移动端响应式 */
@media(max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }

    .doc-row {
        display:block;
    }
}


/* 分页容器样式 */
.paginator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 30px auto;
    padding: 10px 0;
    list-style: none;
}

    /* 分页按钮样式 */
    .paginator a,
    .paginator span {
        display: inline-block;
        min-width: 36px;
        padding: 8px 12px;
        border-radius: 6px;
        border: 1px solid #dcdcdc;
        color: #333;
        text-decoration: none;
        font-size: 14px;
        background: #fff;
        transition: all 0.2s ease;
    }

        /* 悬停效果 */
        .paginator a:hover {
            background-color: #007bff;
            color: #fff;
            border-color: #007bff;
        }

        /* 当前页 */
        .paginator span.current {
            background-color: #007bff;
            color: #fff;
            border-color: #007bff;
            cursor: default;
        }

        /* 禁用状态 */
        .paginator span.disabled {
            background-color: #f2f2f2;
            color: #ccc;
            border-color: #ddd;
            cursor: not-allowed;
        }

        /* “首页”“尾页”等特殊按钮 */
        .paginator a:first-child,
        .paginator a:last-child {
            font-weight: bold;
        }


.doc-img {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f4f4f4; /* 灰色底 */
    position: relative;
    overflow: hidden;
    font-size: 16px;
    color: #666;
    text-align: center;
}

    .doc-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .doc-img .placeholder {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }
