/**
 * 豆瓣海报样式
 * Version: 2.0.0 - 简约现代风格
 */

/* ========== 容器 ========== */
.douban-poster-container {
    background: #fff;
    box-sizing: border-box;
}

.douban-poster-container *,
.douban-poster-container *::before,
.douban-poster-container *::after {
    box-sizing: border-box;
}

/* ========== Tab 导航 ========== */
.douban-poster-container .douban-poster-tabs {
    padding: 16px 20px;
    background: #f8f8f8;
    margin: 0;
}

.douban-poster-container .tab-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0;
    padding: 0;
    list-style: none;
}

.douban-poster-container .tab-nav::-webkit-scrollbar {
    display: none;
}

.douban-poster-container .tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: transparent;
    color: #666;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin: 0;
    text-decoration: none;
    line-height: 1.4;
}

.douban-poster-container .tab-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.douban-poster-container .tab-btn:hover {
    background: rgba(0,0,0,0.05);
    color: #333;
}

.douban-poster-container .tab-btn.active {
    background: #333;
    color: #fff;
}

/* ========== 筛选器 ========== */
.douban-poster-container .tab-filters {
    padding: 16px 20px;
    background: #fafafa;
    margin: 0;
}

/* 没有可见筛选器时隐藏整个筛选区域 */
.douban-poster-container .tab-filters:has(.filter-group[style*="display: none"]):not(:has(.filter-group:not([style*="display: none"]))) {
    display: none;
}

.douban-poster-container .filter-group {
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.douban-poster-container .filter-group[style*="display: none"] {
    display: none;
}

.douban-poster-container .filter-group:not([style*="display: none"]) {
    display: flex;
}

.douban-poster-container .filter-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.douban-poster-container .filter-label {
    font-size: 13px;
    color: #999;
    min-width: 42px;
    margin: 0;
    padding: 0;
}

.douban-poster-container .filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
}

.douban-poster-container .filter-btn {
    padding: 6px 14px;
    background: none;
    color: #666;
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0;
    text-decoration: none;
    line-height: 1.4;
}

.douban-poster-container .filter-btn:hover {
    border-color: #333;
    color: #333;
    background: none;
}

.douban-poster-container .filter-btn.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* ========== 网格布局 ========== */
.douban-poster-container .douban-poster-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns, 4), 1fr);
    gap: 24px;
    padding: 24px;
    margin: 0;
    list-style: none;
}

/* ========== 响应式 ========== */
@media (max-width: 1200px) {
    .douban-poster-container .douban-poster-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .douban-poster-container .douban-poster-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 16px;
    }
    
    .douban-poster-container .tab-btn {
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    .douban-poster-container .douban-poster-grid {
        gap: 12px;
        padding: 12px;
    }
    
    .douban-poster-container .douban-poster-tabs {
        padding: 12px;
    }
    
    .douban-poster-container .tab-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .douban-poster-container .tab-filters {
        padding: 12px;
    }
    
    .douban-poster-container .filter-btn {
        padding: 5px 12px;
        font-size: 12px;
    }
}

/* ========== 海报卡片 ========== */
.douban-poster-container .douban-poster-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin: 0;
    padding: 0;
    border: none;
}

.douban-poster-container .douban-poster-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* ========== 海报图片 ========== */
.douban-poster-container .movie-poster {
    position: relative;
    padding-top: 150%;
    background: #f5f5f5;
    overflow: hidden;
    margin: 0;
}

.douban-poster-container .movie-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
}

.douban-poster-container .douban-poster-card:hover .movie-poster img {
    transform: scale(1.03);
}

/* 悬停遮罩 */
.douban-poster-container .movie-poster::after {
    content: '';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.douban-poster-container .movie-poster::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.douban-poster-container .douban-poster-card:hover .movie-poster::after,
.douban-poster-container .douban-poster-card:hover .movie-poster::before {
    opacity: 1;
}

/* ========== 评分 ========== */
.douban-poster-container .movie-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: #ffd54f;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
    margin: 0;
    border: none;
    line-height: 1.4;
}

/* ========== 荣誉标签 ========== */
.douban-poster-container .movie-poster .movie-honor {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
    padding: 20px 10px 8px;
    font-size: 11px;
    text-align: center;
    z-index: 1;
    margin: 0;
    border: none;
}

/* ========== 电影信息 ========== */
.douban-poster-container .movie-info {
    padding: 12px;
    margin: 0;
    background: #fff;
}

.douban-poster-container .movie-info h3.movie-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 0 0 4px 0;
    padding: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    border: none;
    background: none;
    text-transform: none;
    letter-spacing: normal;
}

.douban-poster-container .movie-year {
    font-size: 12px;
    color: #999;
    margin: 0;
    padding: 0;
    line-height: 1.4;
}

/* ========== 加载状态 ========== */
.douban-poster-container .douban-poster-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    margin: 0;
}

.douban-poster-container .loading-spinner {
    width: 32px;
    height: 32px;
    margin: 0 auto 12px;
    border: 2px solid #eee;
    border-top-color: #333;
    border-radius: 50%;
    animation: douban-spin 0.8s linear infinite;
    padding: 0;
    background: none;
}

@keyframes douban-spin {
    to { transform: rotate(360deg); }
}

.douban-poster-container .douban-poster-loading p {
    font-size: 14px;
    color: #999;
    margin: 0;
    padding: 0;
    line-height: 1.4;
}

/* ========== 错误/空状态 ========== */
.douban-poster-container .douban-poster-error,
.douban-poster-container .douban-poster-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
    margin: 0;
}

.douban-poster-container .douban-poster-error {
    color: #e53935;
}

.douban-poster-container .douban-poster-error p,
.douban-poster-container .douban-poster-empty p {
    margin: 0;
    font-size: 14px;
    padding: 0;
    line-height: 1.4;
}

/* ========== 加载更多 ========== */
.douban-poster-container .douban-poster-footer {
    text-align: center;
    padding: 24px;
    margin: 0;
    background: #fff;
}

.douban-poster-container .douban-load-more {
    background: #333;
    color: #fff;
    border: none;
    padding: 12px 32px;
    font-size: 14px;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    margin: 0;
    text-decoration: none;
    line-height: 1.4;
    display: inline-block;
}

.douban-poster-container .douban-load-more:hover {
    background: #555;
    color: #fff;
}

.douban-poster-container .douban-load-more:active {
    transform: scale(0.97);
}

.douban-poster-container .douban-load-more:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ========== 入场动画 ========== */
@keyframes douban-fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.douban-poster-container .douban-poster-card {
    animation: douban-fadeUp 0.4s ease both;
}

.douban-poster-container .douban-poster-card:nth-child(1) { animation-delay: 0.02s; }
.douban-poster-container .douban-poster-card:nth-child(2) { animation-delay: 0.04s; }
.douban-poster-container .douban-poster-card:nth-child(3) { animation-delay: 0.06s; }
.douban-poster-container .douban-poster-card:nth-child(4) { animation-delay: 0.08s; }
.douban-poster-container .douban-poster-card:nth-child(5) { animation-delay: 0.10s; }
.douban-poster-container .douban-poster-card:nth-child(6) { animation-delay: 0.12s; }
.douban-poster-container .douban-poster-card:nth-child(7) { animation-delay: 0.14s; }
.douban-poster-container .douban-poster-card:nth-child(8) { animation-delay: 0.16s; }
.douban-poster-container .douban-poster-card:nth-child(9) { animation-delay: 0.18s; }
.douban-poster-container .douban-poster-card:nth-child(10) { animation-delay: 0.20s; }
.douban-poster-container .douban-poster-card:nth-child(11) { animation-delay: 0.22s; }
.douban-poster-container .douban-poster-card:nth-child(12) { animation-delay: 0.24s; }