/* Anime Grid & Card System */

/* 1. 网格容器 */
.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* 2. 单个卡片容器 */
.anime-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.5s ease; /* 排序时的平滑过渡 */
}

/* 3. 图片包装层 */
.poster-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    cursor: pointer;
}

.poster-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.poster-wrapper:hover img {
    transform: scale(1.1);
}

/* 4. 评语遮罩层 */
.review-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
    box-sizing: border-box;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: justify;
}

.poster-wrapper:hover .review-overlay {
    opacity: 1;
}

/* 5. 卡片标题和年份 */
.anime-info {
    margin-top: 0.5rem;
    text-align: center;
    width: 100%;
}

.anime-title {
    font-weight: bold;
    font-size: 1rem;
    color: var(--md-typeset-color); /* 适配 Material 主题变量 */
    display: block;
}

.anime-year {
    font-size: 0.8rem;
    color: #888;
    margin-top: 2px;
    display: block;
}

/* 6. 排序下拉菜单样式 */
.sort-container {
    margin-bottom: 1.5rem;
    text-align: right;
    display: flex;
    justify-content: flex-end; 
    align-items: center;       
}

.sort-container label {
    font-size: 0.9rem;
    color: #666;
    margin-right: 8px;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

.sort-select {
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    padding: 8px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    /* 自定义箭头 */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px auto;
    padding-right: 30px;
}

.sort-select:hover {
    border-color: #bbb;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.sort-select:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* 7. 手机端微调 */
@media (max-width: 768px) {
    .anime-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .review-overlay {
        font-size: 0.8rem;
        padding: 5px;
    }
}