/* =========================================
   PAGE: 图鉴 (Gallery)
   ========================================= */

/* 网格布局　自适应照片墙 */
.gallery-container {
    max-width: 1400px; /* 图鉴可以宽一点 */
    margin: 0 auto 100px auto;
    padding: 0 20px;
    display: grid;
    /* 核心：每张卡片最小 260px，不够就换行 */
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* 角色卡 */
.char-card {
    position: relative;
    height: 450px; /* 竖构图的高度 */
    border-radius: 12px;
    overflow: hidden; /* 这一步很重要，为了裁切放大的图片 */
    background-color: #000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: box-shadow 0.3s ease;
}

.char-card:hover {
    box-shadow: 0 0 20px rgba(57, 197, 187, 0.3); /* 默认发绿光 */
}

/* 图片/占位符区域 */
.char-image-placeholder {
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.char-card img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保证图片填满不拉伸 */
    transition: transform 0.5s ease;
}

/* 鼠标悬停时，图片/背景放大 */
.char-card:hover .char-image-placeholder,
.char-card:hover img {
    transform: scale(1.1);
}

/* 信息遮罩层 */
.char-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%; /* 初始也是全高，靠渐变遮挡 */
    background: linear-gradient(
            to top,
            rgba(0,0,0,0.95) 0%,
            rgba(0,0,0,0.6) 30%,
            transparent 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* 内容沉底 */
    padding: 25px;
    transition: backdrop-filter 0.3s ease;
}

/* 头部信息 (名字) */
.char-header {
    transform: translateY(20px); /* 初始位置稍微靠下 */
    transition: transform 0.3s ease;
}

.engine-tag {
    display: inline-block;
    padding: 4px 8px;
    border: 1px solid var(--primary);
    color: var(--primary);
    font-size: 0.7rem;
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 5px;
    border-radius: 4px;
    background: rgba(0,0,0,0.5);
}

.char-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    color: white;
    line-height: 1;
    margin-bottom: 5px;
}

.jp-name {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
}

/* 详细数据 (初始隐藏或半隐藏) */
.char-stats {
    max-height: 0; /* 初始高度为0，隐藏 */
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    border-top: 1px solid rgba(255,255,255,0.2);
    margin-top: 10px;
    padding-top: 10px;
}

.char-stats p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.char-stats span {
    display: inline-block;
    width: 50px;
    font-family: 'Orbitron', sans-serif;
    color: var(--primary);
    font-size: 0.7rem;
    opacity: 0.7;
}

.char-stats .desc {
    margin-top: 10px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.4;
    font-style: italic;
}

.char-stats a {
    color: var(--primary);
    font-weight: bold;
    text-decoration: none;
    display: block;
    text-align: right;
}

/* ========== 交互 ========== */
/* 鼠标放上去时，把名字顶上去，显示详细数据 */
.char-card:hover .char-header {
    transform: translateY(0);
}

.char-card:hover .char-stats {
    max-height: 200px; /* 展开高度 */
    opacity: 1;
}

.char-card:hover .char-overlay {
    background: linear-gradient(
            to top,
            rgba(0,0,0,1) 0%,
            rgba(0,0,0,0.8) 50%,
            rgba(0,0,0,0.2) 100%
    ); /* 加深背景，让字更清楚 */
}

/* 个性化边框色 */
.teto:hover { border-color: #FF0045; box-shadow: 0 0 20px rgba(255, 0, 69, 0.3); }
.teto .engine-tag { color: #FF0045; border-color: #FF0045; }
.teto .char-stats span { color: #FF0045; }
.teto a { color: #FF0045; }
