/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* 头部样式 */
header {
    background-color: #333;
    color: #fff;
    padding: 20px 0;
    text-align: center;
}

header h1 {
    margin-bottom: 10px;
    font-size: 2.5em;
}

/* 导航菜单已删除，相关样式已移除 */

/* 主内容样式 */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 通用区域样式 */
section {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

section h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.5em;
    border-bottom: 2px solid #ffd700;
    padding-bottom: 8px;
}

/* 搜索区域样式 */
.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-container input {
    flex: 1;
    padding: 10px;
    font-size: 1em;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-container button {
    padding: 10px 20px;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
}

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

.search-results {
    margin-top: 10px;
    min-height: 20px;
    /* 减小最小高度，使其在没有搜索结果时不会显得太空 */
}

/* 分类横幅样式 */
.category-banner {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 4px;
}

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

.category-btn:hover {
    background-color: #f9f9f9;
}

.category-btn.active {
    background-color: #333;
    color: #fff;
    border-color: #333;
}

/* 评级分类样式 */
.rating-category {
    margin-bottom: 40px;
}

.rating-category h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5em;
    border-bottom: 2px solid #ffd700;
    padding-bottom: 10px;
}

/* 卡牌展示区域样式 */
.cards-container,
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    /* 减小最小宽度，确保显示更多列 */
    gap: 15px;
    /* 减小间距，充分利用空间 */
    justify-content: space-between;
    /* 两端对齐，充分利用空间 */
    width: 100%;
    max-width: 100%;
}

/* 直接设置列数，确保充分利用空间 */
@media (min-width: 600px) {
    .cards-container,
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
        /* 增加列数，充分利用空间 */
    }
}

@media (min-width: 900px) {
    .cards-container,
    .cards-grid {
        grid-template-columns: repeat(4, 1fr);
        /* 增加列数，充分利用空间 */
    }
}

@media (min-width: 1200px) {
    .cards-container,
    .cards-grid {
        grid-template-columns: repeat(6, 1fr);
        /* 增加列数，充分利用空间 */
    }
}

@media (min-width: 1500px) {
    .cards-container,
    .cards-grid {
        grid-template-columns: repeat(7, 1fr);
        /* 增加列数，充分利用空间 */
    }
}

.card {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0;
    margin: 0;
    /* 确保没有外边距 */
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
    min-height: 300px;
    /* 减少最小高度 */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* 从顶部开始显示 */
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

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

.card:hover .card-header {
    opacity: 0;
    /* 鼠标悬停时隐藏卡片头部 */
}

.card-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* 覆盖整个卡片 */
    width: 100%;
    height: 100%;
    /* 宽度和高度100% */
    object-fit: contain;
    /* 完全显示图片，不裁剪 */
    object-position: top center;
    /* 图片从顶部居中显示 */
    border-radius: 8px;
    /* 与卡片边框一致 */
    z-index: 1;
    /* 图片在底层 */
}

.card-header {
    position: absolute;
    bottom: 0;
    left: 0;
    text-align: center;
    margin-bottom: 0;
    flex-shrink: 0;
    width: 100%;
    padding: 10px;
    /* 保持适当的内边距 */
    background-color: rgba(0, 0, 0, 0.88);
    /* 88%透明度黑色背景，增强文字可读性 */
    color: white;
    /* 文字颜色为白色，与黑色背景形成对比 */
    z-index: 2;
    /* 内容在上层 */
    transition: opacity 0.3s ease;
    /* 添加过渡效果，使显示/隐藏更平滑 */
}

.card-hover-details {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px;
    background-color: rgba(249, 249, 249, 0.7);
    /* 70%透明度，符合用户要求 */
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    /* 默认隐藏 */
    visibility: hidden;
    /* 默认不可见 */
    transition: opacity 0.3s ease, visibility 0.3s ease;
    /* 添加过渡效果 */
    z-index: 3;
    /* 内容在上层 */
}

.card:hover .card-hover-details {
    opacity: 1;
    /* 鼠标悬停时显示 */
    visibility: visible;
    /* 鼠标悬停时可见 */
}

.card-header h3 {
    margin-bottom: 8px;
    color: white;
    /* 确保标题颜色为白色 */
    font-size: 1.2em;
}

.card-method {
    font-size: 0.9em;
    text-align: center;
    color: white;
    /* 确保方法文字颜色为白色 */
    margin-bottom: 0;
    font-weight: bold;
    /* 内容要加粗 */
}

.card-method strong {
    font-weight: normal;
    /* 标签文本不要加粗 */
}

.card-hover-details h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
}

.card-hover-details p {
    margin-bottom: 12px;
    font-size: 0.95em;
    color: #555;
    line-height: 1.4;
}

.card-hover-details strong {
    color: #333;
    font-weight: normal;
    /* 标签文本不要加粗 */
}

.card-hover-details p {
    font-weight: bold;
    /* 后面的内容要加粗 */
}

.deck-container {
    margin-top: 10px;
    /* 与上方内容保持间距 */
    text-align: center;
    /* 居中对齐所有内容 */
}

.deck-label-container {
    text-align: center;
    /* 居中对齐所有内容 */
}

.deck-label {
    font-weight: bold;
    /* 保持粗体显示 */
    margin-bottom: 10px;
    /* 与下方卡组项保持间距 */
    display: block;
    /* 确保宽度计算正确 */
    width: 100%;
    /* 宽度100%，确保文本正常显示 */
    text-align: center;
    /* 居中对齐 */
}

.deck-items {
    text-align: center;
    /* 居中对齐卡组项 */
    margin-left: 0;
    /* 移除左侧margin，确保居中对齐 */
}

.deck-item {
    margin-bottom: 8px;
    line-height: 1.4;
    /* 统一的行高和间距 */
    text-align: center;
    /* 居中对齐 */
}

/* 确保所有标签的冒号对齐 */
.card-hover-details p strong {
    display: inline-block;
    width: auto;
    /* 自动宽度，确保文本正常显示 */
    text-align: left;
    /* 左对齐文本 */
    margin-right: 5px;
    /* 与后面的内容保持间距 */
}

/* 响应式设计 */
@media (max-width: 768px) {
    main {
        padding: 10px;
    }

    section {
        padding: 20px;
    }

    .search-container {
        flex-direction: column;
    }

    .cards-container {
        grid-template-columns: 1fr;
    }
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

footer p {
    font-size: 0.9em;
}