/* 芝麻软件下载站 - IE 兼容样式表 */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f4f7f9;
}

a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    overflow: hidden; /* 清除浮动 */
    padding: 0 10px;
}

/* 头部样式 */
#header {
    background-color: #0056b3;
    color: #fff;
    border-bottom: 3px solid #004494;
    height: 60px; /* 增加整体高度 */
}

#header .container {
    height: 60px;
    line-height: 60px;
}

.logo {
    float: left;
    height: 60px;
    line-height: 60px;
}

.logo a {
    color: #fff;
    font-size: 22px;
    font-weight: bold;
    text-decoration: none;
    display: block;
}

.nav {
    float: left;
    margin-left: 20px;
    height: 60px;
}

.nav ul {
    height: 60px;
}

.nav li {
    float: left;
    margin-right: 5px;
    height: 60px;
}

.nav li a {
    color: #fff;
    font-size: 14px;
    padding: 0 10px;
    display: block;
    height: 60px;
    line-height: 60px;
}

.nav li a:hover, .nav li a.active {
    background-color: #004494;
    text-decoration: none;
}

.search-box {
    float: right;
    height: 60px;
    line-height: 60px;
    margin-top: 0;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 0 85px 0 35px; /* 为左侧图标和右侧按钮留出空间 */
    width: 200px;
    border: 1px solid #004494;
    border-radius: 20px;
    outline: none;
    height: 36px; /* 统一高度 */
    line-height: 36px;
    background: #fff url('https://img.icons8.com/material-outlined/16/999999/search--v1.png') no-repeat 12px center;
    transition: all 0.3s ease;
    color: #333;
    font-size: 14px;
}

.search-box input:focus {
    width: 240px;
    border-color: #ff9900;
    box-shadow: 0 0 8px rgba(255,153,0,0.3);
}

.search-box button {
    position: absolute;
    right: 3px;
    height: 30px; /* 略小于输入框，实现嵌套感 */
    padding: 0 15px;
    background-color: #ff9900;
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 15px;
    line-height: 30px;
    font-weight: bold;
    font-size: 13px;
    transition: background 0.3s;
}

.search-box button:hover {
    background-color: #e68a00;
}

.search-box button:hover {
    background-color: #e68a00;
}

/* 主体内容 */
.main-content {
    margin-top: 20px;
    margin-bottom: 40px;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    float: left;
}

.widget {
    background-color: #fff;
    border: 1px solid #ddd;
    margin-bottom: 20px;
    padding: 15px;
}

.widget-title {
    font-size: 16px;
    border-bottom: 2px solid #0056b3;
    padding-bottom: 8px;
    margin-bottom: 12px;
    color: #0056b3;
}

.category-list li, .recent-list li {
    padding: 6px 0;
    border-bottom: 1px dashed #eee;
    overflow: hidden;
}

.recent-list li a {
    float: left;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-list .date {
    float: right;
    font-size: 12px;
    color: #999;
}

/* 下载排行 */
.rank-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f9f9f9;
}

.rank-list .num {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    background-color: #eee;
    color: #666;
    margin-right: 10px;
    font-size: 12px;
}

.rank-list .top3 {
    background-color: #ff9900;
    color: #fff;
}

/* 内容列表 */
.content-list {
    width: 940px;
    float: right;
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    overflow: hidden; /* 确保包含内部浮动元素 */
}

.loading {
    padding: 20px;
    text-align: center;
    color: #999;
}

.module {
    display: none;
}

.module.active {
    display: block;
}

.section-title {
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.section-title h2 {
    font-size: 20px;
    color: #333;
}

.software-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    overflow: hidden;
    min-height: 200px; /* 统一基础高度 */
}

.software-item:last-child {
    border-bottom: none;
}

.item-icon {
    float: left;
    width: 60px;
    height: 60px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    text-align: center;
    padding-top: 5px;
}

.item-icon img {
    max-width: 48px;
    max-height: 48px;
}

.item-info {
    margin-left: 80px;
}

.item-info h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.item-info .desc {
    color: #666;
    font-size: 13px;
    margin-bottom: 8px;
}

.item-meta {
    font-size: 12px;
    color: #999;
    float: left;
    margin-top: 8px;
}

.download-btn {
    float: right;
    background-color: #28a745;
    color: #fff;
    padding: 6px 15px;
    border-radius: 4px;
    font-weight: bold;
}

.download-btn:hover {
    background-color: #218838;
    text-decoration: none;
}

/* 底部样式 */
#footer {
    background-color: #333;
    color: #999;
    padding: 30px 0;
    text-align: center;
    border-top: 5px solid #0056b3;
}

.footer-links, .footer-tags {
    margin-bottom: 20px;
}

.footer-links h4, .footer-tags h4 {
    color: #fff;
    margin-bottom: 10px;
}

.footer-links a {
    color: #999;
    margin: 0 5px;
}

.footer-tags .tag {
    display: inline-block;
    padding: 3px 10px;
    background-color: #444;
    color: #ccc;
    margin: 3px;
    border-radius: 3px;
    font-size: 12px;
}

.footer-divider {
    border: 0;
    border-top: 1px solid #444;
    margin: 20px 0;
}

#footer p {
    margin-bottom: 10px;
}

#footer a {
    color: #ccc;
}

/* 回到顶部按钮 */
#backToTop {
    display: none; /* 初始隐藏 */
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: #0056b3;
    color: #fff;
    text-align: center;
    line-height: 40px;
    font-size: 20px;
    border-radius: 4px;
    text-decoration: none;
    filter: alpha(opacity=80); /* IE8 透明度 */
    opacity: 0.8;
}

#backToTop:hover {
    opacity: 1;
    filter: alpha(opacity=100);
}

/* 版本列表样式 */
.version-list {
    margin-top: 10px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    padding: 10px;
    clear: both;
}

.version-list h4 {
    font-size: 13px;
    color: #333;
    margin-bottom: 8px;
    border-left: 3px solid #0056b3;
    padding-left: 8px;
}

.version-item {
    padding: 5px 0;
    border-bottom: 1px dashed #ddd;
    overflow: hidden;
    font-size: 12px;
}

.version-item:last-child {
    border-bottom: none;
}

.v-name {
    float: left;
    font-weight: bold;
    color: #555;
    width: 200px;
}

.v-meta {
    float: left;
    color: #999;
    width: 300px;
}

.v-download {
    float: right;
    color: #28a745;
    text-decoration: none;
}

.v-download:hover {
    text-decoration: underline;
}

/* 清除浮动补丁 */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* 菜单切换按钮 (移动端) */
.menu-toggle {
    display: none;
    float: right;
    width: 30px;
    height: 30px;
    margin-top: 15px;
    cursor: pointer;
    position: relative;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #fff;
    margin-bottom: 5px;
    border-radius: 2px;
}

/* 移动端搜索框样式 (初始隐藏) */
.mobile-search {
    display: none;
    margin-bottom: 20px;
    background: #fff;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    position: relative;
}

.mobile-search input {
    width: 100%;
    padding: 12px 90px 12px 40px;
    border: 2px solid #eee;
    border-radius: 25px;
    outline: none;
    font-size: 15px;
    background: #f8f9fa url('https://img.icons8.com/material-outlined/20/999999/search--v1.png') no-repeat 15px center;
    transition: all 0.3s;
}

.mobile-search input:focus {
    border-color: #ff9900;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(255,153,0,0.1);
}

.mobile-search button {
    position: absolute;
    right: 17px;
    top: 17px;
    width: 70px;
    padding: 8px 0;
    background-color: #ff9900;
    border: none;
    color: #fff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

/* 响应式媒体查询 (针对手机和窄屏) */
@media screen and (max-width: 768px) {
    .mobile-search {
        display: block; /* 手机端显示 */
        overflow: hidden;
    }
    .menu-toggle {
        display: block; /* 显示汉堡菜单按钮 */
        float: right;
        margin-top: 15px;
    }

    .menu-toggle span {
        background-color: #fff;
    }

    #header {
        height: 60px;
        position: relative;
        z-index: 10000; /* 提升整个头部的层级 */
    }

    #header .container {
        height: 60px;
        line-height: normal;
        position: relative;
        overflow: visible !important; /* 关键：确保导航菜单不会被容器裁剪 */
    }

    .logo {
        float: left;
        line-height: 60px;
        height: 60px;
    }

    .search-box {
        display: none; /* 手机端隐藏搜索框以简化导航 */
    }

    /* 侧边栏在手机端隐藏，因为已整合到顶部菜单 */
    .sidebar {
        display: none;
    }

    .content-list {
        width: 100% !important;
        float: none !important;
    }

    .nav {
        display: none; /* 初始隐藏 */
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: #004494;
        z-index: 9999; /* 确保在最上层 */
        float: none;
        margin-left: 0;
        height: auto;
        box-shadow: 0 4px 10px rgba(0,0,0,0.3); /* 添加阴影增强浮动感 */
    }

    /* 强制显示打开状态的导航 */
    #nav-menu.open {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .nav ul {
        height: auto;
    }

    .nav li {
        float: none;
        width: 100%;
        height: auto;
        border-bottom: 1px solid #0056b3;
    }

    .nav li a {
        height: 50px;
        line-height: 50px;
        padding: 0 20px;
        text-align: left;
    }
}

/* 针对 IE8 的降级处理 (IE8 不支持 media queries，强制显示桌面版布局) */
@media \0screen {
    .container {
        width: 1000px !important;
    }
    .sidebar { width: 240px !important; float: left !important; }
    .content-list { width: 740px !important; float: right !important; }
}
