/* 公共样式：列表页 + 详情页 统一使用 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", sans-serif;
}

body {
    background-color: #f8f8f8;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 搜索框 */
.search-bar {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    outline: none;
    font-size: 14px;
}

.search-btn {
    padding: 10px 20px;
    background: #ff4444;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* 分类导航 */
.category-bar {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow-x: auto;
    white-space: nowrap;
}

.category-item {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 5px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
}

.category-item.active {
    background: #ff4444;
    color: #fff;
}

/* 面包屑导航（详情页） */
.breadcrumb {
    background: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: #ff4444;
}

.breadcrumb span {
    color: #999;
    margin: 0 8px;
}

.breadcrumb .current {
    color: #333;
    font-weight: 500;
}

/* 图片列表（列表页） */
.img-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.img-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.img-item:hover {
    transform: translateY(-3px);
}

.img-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.img-item .title {
    padding: 10px;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 空数据 */
.empty-tip {
    text-align: center;
    padding: 50px;
    color: #999;
    font-size: 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 详情页主体 */
.detail-wrap {
    display: grid;
    grid-template-columns: 70% 28%;
    gap: 2%;
    margin-bottom: 24px;
}

.img-preview {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    position: relative;
}

.main-img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
    background: #f0f0f0;
    position: relative;
    cursor: zoom-in;
}

/* 图片切换按钮 */
.img-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.prev-btn {
    left: 15px;
}

.next-btn {
    right: 15px;
}

.img-nav-btn:hover {
    background: rgba(255, 68, 68, 0.8);
}

.img-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.3);
}

/* 缩略图 */
.img-thumb-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
}

.img-thumb-list::-webkit-scrollbar {
    display: none;
}

.img-thumb {
    width: 80px;
    height: 100px;
    border-radius: 4px;
    cursor: pointer;
    object-fit: cover;
    border: 2px solid transparent;
    background: #f0f0f0;
    transition: border-color 0.2s ease;
}

.img-thumb.active {
    border-color: #ff4444;
}

/* 详情信息 */
.detail-info {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.detail-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.4;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.detail-tag {
    padding: 6px 12px;
    background: #f7f7f7;
    color: #666;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.detail-tag:hover {
    background: #ff4444;
    color: #fff;
}

/* 推荐列表 */
.recommend-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.recommend-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.recommend-item {
    text-decoration: none;
}

.recommend-item img {
    width: 100%;
    height: 150px;
    border-radius: 6px;
    object-fit: cover;
    background: #f0f0f0;
}

.recommend-item .title {
    font-size: 12px;
    color: #333;
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 图片懒加载占位动画 */
img[loading="lazy"], img[data-src] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 底部版权 */
.footer-declare {
    background: #fff;
    padding: 15px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-top: 30px;
    text-align: center;
    font-size: 12px;
    color: #999;
}

/* 全屏查看器 */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.viewer-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #fff;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10;
}

.viewer-close:hover {
    color: #ff4444;
}

.viewer-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    cursor: move;
}

.viewer-image {
    max-width: 100%;
    max-height: 100%;
    transition: transform 0.2s ease;
    transform-origin: center center;
}

.empty-thumb {
    padding: 20px;
    color: #999;
    text-align: center;
}

/* 响应式 */
@media (max-width: 768px) {
    .detail-wrap {
        grid-template-columns: 100%;
    }
    .recommend-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    .img-nav-btn {
        width: 40px;
        height: 40px;
    }
}