/* 全局样式重置 - 基础通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 头部样式 - 居中显示，宽度与卡牌容器对齐 */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 10px 0;
}

.header-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Logo区域样式 */
.logo-container {
    text-align: center;
    padding: 10px 0;
}

.logo-container a {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.site-name {
    font-size: 28px;
    color: #2c3e50;
    font-weight: bold;
}

/* 导航栏样式 */
.main-nav {
    background-color: #2c3e50;
    margin: 10px 0;
    border-radius: 6px;
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
}

.main-nav ul li {
    margin: 0 15px;
}

.main-nav ul li a {
    color: #fff;
    text-decoration: none;
    padding: 12px 20px;
    display: block;
    font-size: 16px;
    transition: background-color 0.3s;
}

.main-nav ul li a:hover, .main-nav ul li a.active {
    background-color: #34495e;
    border-radius: 4px;
}

/* 搜索筛选栏：居中对齐，与导航栏同宽 */
.search-filter-container {
    background-color: #fff;
    padding: 15px;
    border-radius: 6px;
    margin: 10px 0;
    box-sizing: border-box;
    width: 100%; /* 强制填满header-inner宽度，与导航栏对齐 */
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-start; /* 元素左对齐，整体容器居中 */
    width: 100%;
}

.basic-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.advanced-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    width: 100%;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
}

.search-form input[type="text"], .search-form select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

.search-btn, .expand-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.search-btn {
    background-color: #3498db;
    color: #fff;
}

.expand-btn {
    background-color: #2ecc71;
    color: #fff;
}

/* 卡牌列表样式 - 核心：3行×8列 + 名称显示 + 图片比例正常 */
.card-container {
    max-width: 1600px;
    margin: 20px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* 强制3行核心：适配8列×3行=24张/页，精准校准高度 */
.card-grid-wrapper {
    max-height: 930px !important; /* 适配8列宽度的3行总高度 */
    overflow: hidden !important; /* 强制隐藏超出内容，仅显示3行 */
    margin: 20px 0;
    width: 100%;
}

/* 核心修改：默认每行8列，平衡数量与图片宽度 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr) !important; /* 每行8列 */
    gap: 20px !important; /* 合理间距，避免拥挤 */
    width: 100%;
    justify-items: center; /* 卡牌居中显示，留白均匀 */
}

.card-item {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 180px !important; /* 适配8列的卡牌宽度，保证图片比例 */
    height: 300px !important; /* 固定高度：图片区260px + 名称区40px */
}

.card-item:hover {
    transform: translateY(-5px);
}

/* 卡牌图片容器：严格保持745:1040比例，图片不失真 */
.card-img-container {
    width: 100%;
    padding-top: 139.6% !important; /* 卡牌原始比例，取消固定height */
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* 图片完整显示，比例正常 */
    background-color: #f8f8f8;
    cursor: pointer;
}

/* 卡牌名称区：强制显示，保留中英文逻辑，样式清晰 */
.card-info {
    padding: 8px 6px !important; /* 足够内边距，保证文字显示 */
    text-align: center;
    flex: 0 0 auto;
    display: flex !important; /* 强制显示，避免被隐藏 */
    align-items: center;
    justify-content: center;
    height: 40px !important; /* 固定高度，适配8列卡牌 */
    background-color: #fff; /* 背景色保证文字对比 */
}

.card-name {
    font-size: 15px !important; 
    font-weight: 500;
    color: #2c3e50 !important; /* 文字颜色醒目，避免透明/白色 */
    white-space: nowrap;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
    display: block !important; /* 强制显示名称文本 */
}

/* 分页样式 - 横版排版，样式正常 */
.pagination {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    list-style: none !important; /* 隐藏默认列表点 */
}

.pagination ul {
    display: flex !important; /* 强制ul横排 */
    list-style: none !important;
    gap: 5px; /* 页码间距 */
}

.pagination li {
    margin: 0 !important; /* 重置margin，用gap控制间距 */
}

.pagination li a {
    display: block;
    padding: 8px 15px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #3498db;
    transition: all 0.3s;
}

.pagination li a:hover, .pagination li.active a {
    background-color: #3498db;
    color: #fff;
    border-color: #3498db;
}

/* 禁用状态的分页按钮 */
.pagination li.disabled a {
    color: #999;
    cursor: not-allowed;
    background-color: #f5f5f5;
    border-color: #eee;
    pointer-events: none;
}

/* 详情页样式 - 左3右7布局 */
.card-detail {
    max-width: 1600px;
    margin: 20px auto;
    padding: 30px 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    gap: 30px;
    align-items: flex-start;
    box-sizing: border-box;
}

.detail-img-area {
    width: 30%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-img-container {
    width: 100%;
    padding-top: 139.6%; /* 745:1040比例 */
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8f8f8;
    margin-bottom: 15px;
}

.detail-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.detail-title-wrap {
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.detail-title {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.detail-subtitle {
    font-size: 16px;
    color: #7f8c8d;
}

.detail-info-area {
    width: 70%;
    padding: 0 10px;
}

.detail-content {
    display: block;
    width: 100%;
}

.detail-sidebar {
    background-color: #f8f8f8;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 25px;
}

.detail-sidebar h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
    font-size: 18px;
}

.detail-main h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
    font-size: 18px;
}

.detail-info {
    line-height: 2.2;
    font-size: 15px;
}

.detail-info p {
    margin-bottom: 8px;
}

.detail-label {
    font-weight: bold;
    color: #2c3e50;
    display: inline-block;
    width: 90px;
}

.detail-main {
    padding: 0 5px;
}

.detail-main > div {
    line-height: 1.8;
    font-size: 16px;
    color: #444;
}

/* 底部样式 - 和卡牌容器精准对齐 */
.site-footer {
    background-color: #2c3e50;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.footer-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.footer-content {
    line-height: 1.8;
    font-size: 14px;
    margin-bottom: 10px;
    max-width: none;
    width: 100%;
    box-sizing: border-box;
}

.icp-info {
    font-size: 14px;
    color: #bdc3c7;
    margin-top: 5px;
    max-width: none;
    width: 100%;
    box-sizing: border-box;
}

.icp-info a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s;
}

.icp-info a:hover {
    color: #fff;
    text-decoration: underline;
}

/* 响应式适配 - 同步调整各尺寸下的列数，保证体验 */
@media (max-width: 1440px) {
    .card-grid {
        grid-template-columns: repeat(7, 1fr) !important; /* 1440px下每行7列 */
    }
    .card-grid-wrapper {
        max-height: 900px !important;
    }
    .card-item {
        max-width: 170px !important;
        height: 290px !important;
    }
}

@media (max-width: 1200px) {
    .card-grid {
        grid-template-columns: repeat(6, 1fr) !important; /* 1200px下每行6列 */
    }
    .card-grid-wrapper {
        max-height: 870px !important;
    }
    .card-item {
        max-width: 160px !important;
        height: 280px !important;
    }
    .card-name {
        font-size: 14px !important;
    }
}

@media (max-width: 992px) {
    .card-grid {
        grid-template-columns: repeat(5, 1fr) !important; /* 992px下每行5列 */
    }
    .card-grid-wrapper {
        max-height: 840px !important;
    }
    .card-item {
        max-width: 150px !important;
        height: 270px !important;
    }
    .card-name {
        font-size: 14px !important;
    }
    .card-detail {
        flex-direction: column;
    }
    .detail-img-area, .detail-info-area {
        width: 100%;
    }
    .detail-img-container {
        max-width: 400px;
        margin: 0 auto 15px;
    }
}

@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: repeat(4, 1fr) !important; /* 768px下每行4列 */
    }
    .card-grid-wrapper {
        max-height: 810px !important;
    }
    .card-item {
        max-width: 140px !important;
        height: 260px !important;
    }
    .card-name {
        font-size: 13px !important;
    }
    .main-nav ul {
        flex-direction: column;
        align-items: center;
    }
    .main-nav ul li {
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* 480px下每行2列 */
    }
    .card-grid-wrapper {
        max-height: 780px !important;
    }
    .card-item {
        max-width: 130px !important;
        height: 250px !important;
        margin: 0 auto;
    }
    .card-name {
        font-size: 12px !important;
        line-height: 1.1;
    }
    .detail-title {
        font-size: 24px;
    }
    .detail-sidebar, .detail-main {
        padding: 15px;
    }
    .footer-content, .icp-info {
        font-size: 13px;
    }
}