/* 基础通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "Heiti SC", sans-serif;
}

html {
    scroll-behavior: smooth;
    font-size: 15px;
}

body {
    line-height: 1.6;
    color: #333;
    padding-top: 70px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f5f7fa;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* 固定导航栏 */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo_icon {
    font-size: 24px;
    color: #3498db;
    margin-right: 15px;
}

.logo_text {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links_item {
    margin-left: 30px;
}

.nav-links_link {
    text-decoration: none;
    color: #666;
    font-size: 16px;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links_link:hover,
.nav-links_link.active {
    color: #3498db;
}

.nav-links_link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #3498db;
    transition: width 0.3s ease;
}

.nav-links_link:hover::after,
.nav-links_link.active::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.mobile-menu-btn:hover {
    transform: rotate(90deg);
}

/* 主内容区域 */
.main-content {
    flex: 1;
    padding: 60px 0;
    position: relative;
}

/* 主横幅样式 */
.main-banner {
    background: linear-gradient(135deg, #5dade2 0%, #3498db 100%);
    color: white;
    padding: 40px 0;
    border-radius: 8px;
    margin-bottom: 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.banner-content {
    max-width: 800px;
    margin: 0 auto;
}

.banner-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.banner-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* 顶部渐变线 */
.gradient-top-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #f1c40f, #e74c3c);
    background-size: 400% 100%;
    animation: gradient 15s ease infinite;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 筛选和搜索区域 */
.filter-search-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

/* 分类筛选样式 */
.category-container {
    flex: 1;
    min-width: 250px;
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.category-btn {
    padding: 8px 18px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.category-btn:hover:not(.active) {
    background-color: #e0e0e0;
}

/* 搜索框样式 */
.search-container {
    position: relative;
    min-width: 300px;
}

#searchInput {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
}

#searchInput:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
}

/* 软件列表样式 */
.software-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.software-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 20px;
    display: flex;
    flex-direction: column;
    text-align: left;
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
    min-height: 200px;
}

/* 提取码标识 */
.software-card.has-code::before {
    content: '需要提取码';
    position: absolute;
    top: 15px;
    right: 10px;
    background-color: #f39c12;
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
}

.software-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* 顶部信息区 - 包含图标和基本信息 */
.software-card-header {
    display: flex;
    align-items: center;
}

.software-card_icon {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-color: #e3f2fd;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.software-card:hover .software-card_icon {
    background-color: #3498db;
    transform: scale(1.1);
}

.software-card_icon i {
    font-size: 26px;
    color: #3498db;
    transition: color 0.3s ease;
}

.software-card:hover .software-card_icon i {
    color: white;
}

.software-card_basic-info {
    flex-grow: 1;
}

.software-card_title {
    color: #333;
    margin-bottom: 6px;
    font-size: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.software-card_meta {
    color: #999;
    font-size: 13px;
    display: flex;
    gap: 15px;
}

.software-card_meta .size,
.software-card_meta .date {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 软件描述 - 完全依赖数据库内容 */
.software-card_desc {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 15px 0;
    flex-grow: 1;
    text-align: justify;
}

/* 下载按钮区域 - 右下角固定定位 */
.software-card_action {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
    padding-top: 10px;
}

/* 下载按钮样式 */
.btn-download {
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    width: 120px; /* 固定宽度 */
}

.btn-download:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}

.btn-download:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-download.loading {
    background-color: #95a5a6;
    cursor: not-allowed;
    position: relative;
    overflow: hidden;
}

.btn-download.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-100%);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 无搜索结果样式 */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* 提取码模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    transition: opacity 0.3s ease;
    opacity: 0;
}

.modal.active {
    display: block;
    opacity: 1;
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-content #confirmCodeBtn {
    display: block;
    margin: 15px auto 0; /* 上外边距15px，左右自动居中 */
    width: 120px; /* 固定宽度，与外部按钮一致 */
    padding: 8px 16px;
    font-size: 14px;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    margin-bottom: 20px;
}

.modal-header h3 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.modal-header p {
    color: #666;
    font-size: 0.9rem;
}

#extractCodeInput {
    width: 100%;
    padding: 12px 15px;
    margin: 15px 0 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

#extractCodeInput:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 错误信息样式 */
.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    height: 20px;
    margin-bottom: 15px;
    visibility: hidden;
}

.error-message.show {
    visibility: visible;
}

.close-btn {
    float: right;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #333;
}

/* 悬浮客服样式 */
.floating-customer-service {
    position: fixed;
    right: 30px;
    bottom: 50px;
    background-color: white;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 6px 10px;
    display: flex;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
}

.floating-customer-service:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.customer-service-icon {
    width: 35px;
    height: 35px;
    background-color: #3498db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    margin-right: 10px;
    animation: pulse 2s infinite;
}

.customer-service-info {
    margin-right: 5px;
}

.customer-service-name {
    font-weight: 600;
    color: #333;
    font-size: 12px;
    animation: fadeIn 2s ease-in-out infinite alternate;
}

.customer-service-status {
    font-size: 14px;
    color: #27ae60;
    padding: 2px 6px;
    border-radius: 5px;
}

.customer-service-message {
    width: 35px;
    height: 35px;
    background-color: #e74c3c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    position: relative;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(39, 174, 96, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0);
    }
}

@keyframes pulseText {
    0% {
        color: #27ae60;
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.2);
    }
    70% {
        color: #1e8449;
        box-shadow: 0 0 0 5px rgba(39, 174, 96, 0);
    }
    100% {
        color: #27ae60;
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0);
    }
}

/* 页脚样式 */
.site-footer {
    background-color: #f8f8f8;
    color: #666;
    padding: 40px 0 20px;
    text-align: center;
    margin-top: auto;
    border-top: 1px solid #eee;
}

.copyright p {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.5;
}

/* 响应式调整 */
@media (max-width: 768px) {
    html {
        font-size: 13px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        flex-direction: column;
        background-color: #fff;
        padding: 20px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links_item {
        margin: 10px 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    .software-list {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 50px 0;
    }
    
    .filter-search-container {
        flex-direction: column;
        align-items: stretch;
    }

    .search-container {
        min-width: auto;
    }

    .modal-content {
        margin: 40% auto;
        padding: 20px;
    }
    
    .btn-download {
        font-size: 13px;
        height: 34px;
        width: 110px; /* 响应式调整宽度 */
    }
}

@media (max-width: 480px) {
    html {
        font-size: 12px;
    }

    .software-card {
        padding: 1rem;
        min-height: 260px;
    }
    
    .btn-download {
        font-size: 12px;
        height: 32px;
        width: 100px; /* 响应式调整宽度 */
    }
}

/* 分页控件样式 */
.pagination-container {
    margin-top: 40px;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
    cursor: pointer;
}

.page-btn:hover:not(.disabled) {
    background-color: #f5f5f5;
    border-color: #ccc;
    transform: translateY(-1px);
}

.page-btn.active {
    background-color: #3498db;
    border-color: #3498db;
    color: #fff;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f5f5f5;
    border-color: #ddd;
    color: #999;
    pointer-events: none;
}

.page-btn i {
    font-size: 12px;
}

/* 响应式分页样式 */
@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .pagination-controls {
        justify-content: center;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .page-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .pagination-info {
        font-size: 12px;
    }
}

/* 全局加载遮罩样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-text {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes fadeIn {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* 按钮加载状态样式 */
button.loading {
    position: relative;
    pointer-events: none;
}

button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

button.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: inherit;
}
