/* 重置与全局样式 */
body {
    margin: 0;
    padding: 0px 0 20px; /* 修复：顶部70px，底部20px */
    font-family: "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background-color: #f9f9f9;
    color: #333;
}

/* 顶部导航栏 */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    color: white;
    width: 100%;
    z-index: 1000;
    background-color: rgba(33, 160, 86, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px 0; /* 修改左右padding为0 */
}
.logo {
    font-size: 24px;
    font-weight: bold;
}

/* 顶部导航栏容器 */
.topbar-container {
    max-width: 1300px; /* 已修改 */
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between; 
    align-items: center;
    flex-wrap: wrap;
}

/* 修复.top-links对齐问题 */
.top-links {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    margin-left: auto; /* 新增此属性 */
    justify-content: flex-end; /* 保持原有属性 */
}

/* 搜索容器 */
.search-container {
    display: flex;
    align-items: center;
}
.search-container form {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}
.search-container input[type="text"] {
    padding: 5px 10px;
    border: none;
    outline: none;
    border-radius: 4px 0 0 4px;
    margin: 0;
    height: 30px;
    box-sizing: border-box;
    background-color: #fff;
    font-size: 14px;
    min-width: 200px;
    flex: 1;
}
.search-container input[type="text"]:focus {
    box-shadow: 0 0 5px rgba(33, 160, 86, 0.5);
}
.search-container input[type="text"]::placeholder {
    color: #999;
}
.search-btn {
    padding: 5px 10px; /* 减小高度 */
    background-color: #21a056;
    border: none;
    border-radius: 0 4px 4px 0;
    color: white;
    cursor: pointer;
    font-size: 16px;
    height: 30px; /* 减小高度 */
    box-sizing: border-box;
    transition: background-color 0.3s ease;
}
.search-btn:hover {
    background-color: #1a8a47;
}

.search-btn:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

/* 保持搜索框在移动端的显示 */
@media (max-width: 768px) {
    .top-links {
        width: 100%;
        justify-content: space-between;
    }
    .search-container {
        width: 100%;
        margin-top: 10px;
    }
    .search-container input[type="text"] {
        flex: 1;
    }
}

/* 用户下拉菜单样式 */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-info {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.user-info:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-arrow {
    margin-left: 5px;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.user-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    background-color: white !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    min-width: 200px !important;
    z-index: 1001 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s ease !important;
    margin-top: 5px !important;
    display: block !important;
}

.user-dropdown.active .user-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.menu-item span {
    color: #333 !important;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background-color: #f8f9fa;
}

.menu-icon {
    margin-right: 10px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.menu-separator {
    height: 1px;
    background-color: #e0e0e0;
    margin: 5px 0;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .user-menu {
        right: -50px;
        min-width: 180px;
    }
}
.top-links a {
    color: white;
    text-decoration: none;
    font-size: 14px;
}

/* 图标导航区域 */
.icon-nav {
    background-color: #2c2c2c;
    padding: 100px 0 20px; /* 统一上边距 */
    position: relative;
    z-index: 999;
}

.icon-wrapper {
    max-width: 1300px; /* 原为1200px */
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
}

/* 图标导航项 */
.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    width: 80px;
    text-align: center;
    transition: transform 0.2s ease, background-color 0.2s ease;
    padding: 10px;
    border-radius: 8px;
    position: relative; /* 确保定位上下文 */
    z-index: 1; /* 新增层级控制 */
}

/* 确保链接图标项样式正常 */
.icon-item {
    /* 保持原有样式... */
    color: white; /* 确保颜色继承 */
    text-decoration: none; /* 移除下划线 */
}

/* 激活状态指示 */
.icon-item.active::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background-color: #21a056;
    border-radius: 2px;
}

.icon-item.active {
    transform: scale(1.1);
    background-color: rgba(58, 58, 58, 0.6);
    z-index: 2; /* 确保激活状态在上层 */
}

.icon-item.active::after {
    /* 保持原有样式... */
    z-index: 3; /* 横条显示在最上层 */
}
.icon-item:hover {
    background-color: #3a3a3a;
    transform: scale(1.05);
}

.icon-item img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 6px;
}

/* 筛选区域 */
.filters {
    max-width: 1300px; /* 原为1200px */
    margin: 20px auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-tag {
    background-color: #f0f0f0;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    color: #666;
}

.filter-tag:hover {
    background-color: #e0e0e0;
    transform: translateY(-1px);
}

.filter-tag.active {
    background-color: #21a056;
    color: white;
    border-color: #21a056;
}

.tags span {
    background-color: #ddd;
    padding: 6px 12px;
    margin-right: 10px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
}

.selects label {
    margin-right: 15px;
    font-size: 14px;
}

.selects select {
    padding: 4px 8px;
    border-radius: 4px;
}

/* 资源卡片区域 */
.resource-grid {
    max-width: 1300px;  /* 确保与网站宽度一致 */
    margin: 20px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 35px 20px;
}

.card {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.2s ease;
    display: block; /* 确保链接作为块级元素 */
    text-decoration: none; /* 移除下划线 */
    color: #333; /* 保持原有文本颜色 */
}

.card:hover {
    transform: translateY(-5px);
}

.card:hover {
    color: #21a056; /* 鼠标悬停时变为绿色 */
}

.card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.card .title {
    font-size: 14px;
    font-weight: bold;
    padding: 10px 12px 0 12px;
    margin: 0;
}

.card .author {
    font-size: 12px;
    padding: 0 12px 0 12px;
    margin: 0 0 5px 0;
}
.card .author::before {
    content: "By ";
    color: #666; /* "By" 保持灰色 */
}
.card .author {
    color: #21a056; /* 整个作者文本变为绿色，但会被 ::before 覆盖 "By" 部分 */
}

.card .details {
    font-size: 12px;
    color: #666;
    padding: 0 12px 12px 12px;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card .details .price {
    color: #21a056;
    font-weight: bold;
}
.card .details .price .price-value {
    color: rgb(202, 119, 119);
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
}

.card .details .downloads {
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px; /* 确保图标和文字在同一行且有间距 */
}


/* 分页组件 */
.pagination {
    max-width: 1300px; /* 原为1200px */
    margin: 30px auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.pagination a {
    color: #333;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    margin: 0 4px;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.pagination a.active {
    background-color: #21a056;
    color: white;
}

.pagination a:hover:not(.active) {
    background-color: #ddd;
}

/* 保持原有.green样式不变 */
.green {
    color: #2e8b57;
}

/* 页尾样式 */
.footer {
    background-color: #2c2c2c;
    color: rgb(197, 197, 197);
    padding: 20px;
    text-align: center;
    margin-top: 40px;
}

.footer p {
    margin: 5px 0;
    font-size: 14px;
}

.footer a {
    color: #21a056;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* 顶部导航激活状态 */
.top-links a.active {
    background-color: rgba(252, 248, 248, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
}

/* 图标导航链接样式 */

/* 新增链接状态修复 */
.logo-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lang-select {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
}

.lang-select option {
    background: #2c2c2c;
    color: white;
}

.lang-select:focus {
    outline: none;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: none;
}

@media (max-width: 768px) {
    .logo-container {
        width: 100%;
        justify-content: space-between;
    }
    .lang-select {
        margin-left: auto;
    }
}