/* ==========================================================
   DETAIL.CSS - 详情页专属样式 (相关推荐列表调整为严格 4 列布局和卡片尺寸)
   ========================================================== */

.breadcrumb {
    padding: 15px 0;
    font-size: 14px;
    color: #6b7280;
}

.breadcrumb span {
    color: var(--secondary-color);
    font-weight: 500;
}

.detail-layout {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

/* 图片展示区 */
.image-viewer {
    flex: 2;
    display: flex;
    position: relative;
    background-color: #1f2937;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.image-viewer img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 80vh;
    object-fit: contain;
}

.preview-notice {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 13px;
}

/* 信息侧边栏 */
.info-sidebar {
    flex: 1;
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.detail-title {
    font-size: 28px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    color: #1f2937;
    font-weight: 600;
}

.stats-box {
    margin-bottom: 30px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.stats-box p {
    margin-bottom: 8px;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
}

.stats-box strong {
    color: var(--primary-color);
    font-weight: bold;
}

.download-options h3, .wallpaper-tags h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #374151;
    font-weight: 600;
}

.download-btn {
    display: block;
    width: 100%;
    margin-bottom: 10px;
}

/* 标签样式 */
.wallpaper-tags {
    margin-top: 30px;
}
.tag-link {
    display: inline-block;
    background-color: #eef2ff;
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 4px;
    margin: 0 8px 8px 0;
    font-size: 14px;
    transition: background-color 0.3s;
}

.tag-link:hover {
    background-color: #dbeafe;
}

/* 相关推荐 */
.related-wallpapers {
    margin-top: 50px;
}

.related-wallpapers h2 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #1f2937;
    font-weight: 600;
}

/* 列表卡片 (PC) - 核心修改：固定 4 列，并固定高度 */
.grid-view {
    display: grid;
    /* 采用 4 列等宽布局，保证在 PC 宽度下，卡片严格为 4 列 */
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.item-card {
    background-color: var(--card-bg);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s, transform 0.3s;
}
.item-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    transform: translateY(-3px);
}
.card-link {
    display: block;
    position: relative;
    /* PC 模式下卡片高度严格设置为 230px */
    height: 230px;
    overflow: hidden;
}
.item-card img {
    width: 100%;
    height: 100%;
    /* 确保图片填充卡片，保持宽高比并居中截取 */
    object-fit: cover;
    display: block;
    transition: transform 0.5s;
}
.item-card:hover img {
    transform: scale(1.05);
}
.quality-tag {
    position: absolute;
    top: 0;
    left: 0;
    background-color: var(--primary-color);
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 6px 0 6px 0;
    z-index: 10;
    pointer-events: none;
}
.info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0;
    padding: 0 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0));
    color: white;
    opacity: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: opacity 0.3s ease, height 0.3s ease;
    z-index: 5;
    pointer-events: none;
}
.card-link:hover .info-overlay {
    height: 40px;
    opacity: 1;
    padding: 0 10px 10px 10px;
}
.overlay-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}
.overlay-res {
    font-size: 12px;
    color: #cccccc;
}


/* 详情页响应式 */
@media (max-width: 900px) {
    .detail-layout {
        flex-direction: column;
    }
    .info-sidebar {
        flex: auto;
    }
    .image-viewer img {
        max-height: 60vh;
    }
}

@media (max-width: 768px) {
    /* 手机模式下，强制 2 列 */
    .grid-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .card-link {
        /* 手机模式下卡片高度严格设置为 170px */
        height: 170px;
    }

    /* 调整移动端覆盖层字体大小 */
    .overlay-title {
        font-size: 12px;
    }
    .overlay-res {
        font-size: 10px;
    }
}