@charset "UTF-8";

/* 基本样式重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
}

/* 页头样式 */
header {
    background-color: #333;
    color: white;
    padding: 20px 0;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header h1 {
    margin: 0;
}

/* 搜索容器样式 */
.search-container {
    display: flex;
    align-items: center;
}

.search-container input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 20px 0 0 20px;
}

.search-container button {
    padding: 10px 20px;
    border: none;
    background-color: #555;
    color: white;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
}

.search-container button:hover {
    background-color: #666;
}

/* 容器样式 */
.container {
    display: flex;
    flex-wrap: wrap;
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    padding-top: 10px; /* 为页头留出空间 */
}

/* 侧边菜单样式 */
.menu {
    flex: 1;
    min-width: 250px;
    background-color: #444;
    color: white;
    padding: 20px;
    border-radius: 20px 0 0 20px;
    overflow: hidden; /* 防止内容溢出 */
}

.menu nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.menu nav ul li {
    margin-bottom: 15px;
}

.menu nav ul li a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 10px;
    display: block; /* 使链接块级显示，便于点击 */
}

.menu nav ul li a:hover {
    background-color: #555;
    padding-left: 20px;
}

/* 主要内容区域样式 */
.content {
    flex: 3;
    padding: 20px;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 0 20px 20px 0;
}

/* 分类和链接项样式 */
.category-section {
    margin-bottom: 40px;
    display: none; /* 默认隐藏所有分类 */
}

.category-section.active {
    display: block; /* 显示当前活动的分类 */
}

.category-section h2 {
    margin-bottom: 20px;
}

.link-item {
    margin-bottom: 30px;
}

.link-item h3 {
    margin-bottom: 10px;
}

.link-item p {
    margin-bottom: 15px;
}

.downloads {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap; /* 允许下载链接换行 */
}

.download-link {
    background-color: #4CAF50;
    color: white;
    padding: 3px 6px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    border-radius: 25px;
    transition: background-color 0.3s;
    margin-bottom: 5px; /* 增加下边距，以便换行时链接之间有空隙 */
}

.download-link:hover {
    background-color: #45a049;
}

/* 返回顶部按钮的基本样式 */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: none; /* 初始不显示，需要通过JavaScript控制显示 */
    padding: 12px;
    font-size: 16px;
    color: #fff;
    background-color: #87CEEB;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    animation: fadeIn 0.5s ease-in-out;
    z-index: 1000;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    box-sizing: border-box;
    max-width: 60px;
    max-height: 60px;
    transition: background-color 0.3s ease;
}

/* 鼠标悬停时的样式变化 */
#back-to-top:hover {
    background-color: #00BFFF;
}

/* 自适应屏幕大小，调整内边距和字体大小 */
@media (max-width: 768px) {
    #back-to-top {
        padding: 10px;
        font-size: 14px;
        bottom: 20px;
        right: 20px;
    }
}

/* 淡入动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 页尾样式 */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 20px;
    border-radius: 20px 20px 0 0;
}

footer p,
#copyright-notice-trigger {
    color: white;
}

/* 链接样式 */
#website-name {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

#website-name:hover {
    color: #FF5733;
    text-shadow: 1px 1px 2px #000000;
}

/* 弹出窗口样式 */
.popup {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.popup-content p {
    color: #000;
    margin: 0;
}

#popup-close-button {
    margin-top: 10px;
    padding: 5px 10px;
    background-color: #ccc;
    border: none;
    cursor: pointer;
}

#popup-close-button:hover {
    background-color: #ddd;
}

/* 默认样式，适用于移动设备和较小屏幕 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .menu {
        width: 100%;
        min-width: auto;
        border-radius: 20px 20px 0 0;
    }

    .content {
        width: 100%;
        border-radius: 0 0 20px 20px;
    }

    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }

    /* 默认隐藏手机端菜单内容，除非通过菜单按钮显示 */
    #menu-content {
        display: none;
        flex-direction: row; /* 使分类一行显示 */
        justify-content: space-around; /* 分类均匀分布 */
    }

    /* 当添加active类时显示菜单内容 */
    #menu-content.active {
        display: flex;
    }

    .menu nav ul {
        flex-direction: row; /* 改为行方向布局 */
    }

    .menu nav ul li {
        margin-bottom: 0;
        width: auto; /* 宽度自适应 */
    }

    .menu nav ul li a {
        font-size: 13px; /* 可以适当调整字体大小 */
    }

    /* 菜单按钮样式 */
    #menu-toggle {
        display: block;
        cursor: pointer;
        background-color: #f1f1f1;
        padding: 10px;
        text-align: center;
        border: none;
        width: 100%;
    }

    /* 自适应屏幕大小，调整内边距和字体大小 */
    #back-to-top {
        padding: 10px;
        font-size: 14px;
        bottom: 20px;
        right: 20px;
    }

    footer {
        font-size: 14px; /* 减小字体大小 */
    }
}

/* 桌面端样式 */
@media (min-width: 769px) {
    /* 桌面端显示菜单内容 */
    #menu-content {
        display: flex;
        flex-direction: column; /* 保持原有的列方向布局 */
    }

    /* 隐藏菜单按钮 */
    #menu-toggle {
        display: none;
    }
}