/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局样式 */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #0d0d0d;
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
}
/* 搜索框样式 */
.search-container {
    margin: 20px auto;
    max-width: 500px;
    position: relative;
}

#searchInput {
    width: 100%;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #ffd700;
    border-radius: 25px;
    color: #fff;
    font-size: 1rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

#searchInput::placeholder {
    color: #cccccc;
}

/* 搜索模式下的卡片布局 */
.search-mode .card {
    width: calc(20% - 20px); /* 每行显示5个 */
    animation: scaleUp 0.3s ease;
}

@keyframes scaleUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 1200px) {
    .search-mode .card {
        width: calc(25% - 20px); /* 每行4个 */
    }
}

@media (max-width: 768px) {
    .search-mode .card {
        width: calc(33.33% - 20px); /* 每行3个 */
    }
}

@media (max-width: 480px) {
    .search-mode .card {
        width: calc(50% - 10px); /* 每行2个 */
    }
}
/* 动态背景层 */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* 渐变色背景 */
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    /* 添加微妙的纹理 */
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.05) 10%, transparent 10%);
    background-size: 20px 20px;
}

/* 头部样式 */
header {
    background: rgba(26, 26, 26, 0.8);
    padding: 40px 20px;
    text-align: center;
    border-bottom: 2px solid #ffd700;
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 3rem;
    margin: 0;
}

header p {
    font-size: 1.2rem;
    color: #cccccc;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

nav ul li a {
    font-size: 1.1rem;
    padding: 10px 20px;
    border-radius: 5px;
    color: #ffffff; /* 默认白色字体 */
    text-decoration: none; /* 取消下划线 */
    transition: color 0.3s ease, background-color 0.3s ease;
}

nav ul li a.active,
nav ul li a:hover {
    color: #000000; /* 选中后黑色字体 */
    background-color: #ffd700; /* 选中后背景变为金色 */
}

/* 分类标题 */
.category h2 {
    text-align: center;
    margin: 40px 0 20px;
    font-size: 2.5rem;
}

/* 卡片容器 */
.card-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 卡片布局 */
.card {
    background: rgba(26, 26, 26, 0.8);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    width: calc(33.33% - 40px); /* 每排显示 3 个装备 */
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative; /* 确保提示框相对于卡片定位 */
    overflow: visible; /* 确保提示框不会被裁剪 */
    z-index: 1; /* 设置卡片的层级 */
}

@media (max-width: 768px) {
    .card {
        width: calc(50% - 20px); /* 手机端每排显示 2 个装备 */
    }
}

@media (max-width: 480px) {
    .card {
        width: 100%; /* 手机端每排显示 1 个装备 */
    }
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7);
    z-index: 1000; /* 悬停时提高层级 */
}

/* 卡片内容布局 */
.card-content {
    display: flex;
    align-items: center;
    gap: 20px; /* 图片和名称之间的间距 */
}

/* 图片样式 */
.card-image {
    width: 70px;
    height: 70px; /* 正方形图片 */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #add8e6; /* 淡蓝色边框 */
    border-radius: 5px; /* 圆角 */
    overflow: visible; /* 确保提示框不会被裁剪 */
}

.card-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.card-image:hover img {
    transform: scale(1.1);
}

/* 属性提示框 */
.card-image .tooltip {
    position: absolute;
    top: 100%; /* 提示框在图片下方 */
    left: 0; /* 提示框在图片左侧 */
    background: rgba(26, 26, 26, 0.95);
    border: 2px solid #ffd700;
    border-radius: 5px;
    padding: 10px;
    width: 160px;
    text-align: left;
    font-size: 0.9rem;
    color: #ffffff;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000; /* 提高层级，确保提示框在最上层 */
}

.card-image:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

/* 装备名称 */
.card h3 {
    font-size: 1.2rem;
    margin: 0;
    color: #ffd700;
}

/* 页脚样式 */
footer {
    background: rgba(26, 26, 26, 0.8);
    padding: 10px;
    text-align: center;
    border-top: 2px solid #ffd700;
    margin-top: 40px;
    backdrop-filter: blur(10px);
}

footer p {
    margin: 0;
    font-size: 0.9rem;
    color: #cccccc;
}