/* Main CSS - 短剧乐园样式 */

:root {
    --primary: #FF6B6B;
    --primary-dark: #FF5252;
    --secondary: #4ECDC4;
    --accent: #FFE66D;
    --dark: #2C3E50;
    --gray: #95A5A6;
    --light-gray: #ECF0F1;
    --white: #FFFFFF;
    --gradient: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;
}

/* ===== 头部导航 ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-btn, .user-avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--light-gray);
    transition: all 0.3s;
}

.search-btn svg, .user-avatar svg {
    width: 20px;
    height: 20px;
    color: var(--dark);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* ===== 分类导航 ===== */
.category-nav {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    height: 44px;
    background: var(--white);
    z-index: 999;
    border-bottom: 1px solid #eee;
}

.category-nav .nav-list {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 32px;
    padding: 0 16px;
}

.category-nav .nav-item {
    font-size: 15px;
    color: var(--gray);
    font-weight: 500;
    position: relative;
    transition: color 0.3s;
}

.category-nav .nav-item.active,
.category-nav .nav-item:hover {
    color: var(--primary);
}

.category-nav .nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--gradient);
    border-radius: 2px;
}

/* ===== 主内容区 ===== */
.main-content {
    padding: 108px 16px 80px;
    min-height: 100vh;
}

/* ===== Banner ===== */
.banner-section {
    margin-bottom: 24px;
    position: relative;
}

.banner-slider {
    position: relative;
    height: 180px;
    border-radius: var(--radius);
    overflow: hidden;
}

.banner-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.banner-item.active {
    opacity: 1;
}

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 16px 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: var(--white);
}

.banner-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.banner-info p {
    font-size: 13px;
    opacity: 0.9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.banner-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.banner-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.banner-dots .dot.active {
    width: 16px;
    border-radius: 3px;
    background: var(--white);
}

/* ===== 区块样式 ===== */
.section {
    margin-bottom: 28px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

.title-icon {
    font-size: 20px;
}

.more-link {
    font-size: 13px;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ===== 短剧卡片 ===== */
.drama-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.drama-card {
    background: var(--white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.drama-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.drama-cover {
    position: relative;
    padding-top: 140%;
    background: var(--light-gray);
}

.drama-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.drama-episodes {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.7);
    color: var(--white);
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}

.drama-score {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: var(--gradient);
    color: var(--white);
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.drama-info {
    padding: 10px;
}

.drama-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}

.drama-meta {
    font-size: 12px;
    color: var(--gray);
}

.play-count::before {
    content: '▶ ';
    color: var(--primary);
}

/* ===== 底部导航 ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--gray);
    transition: color 0.3s;
}

.bottom-nav .nav-item svg {
    width: 24px;
    height: 24px;
}

.bottom-nav .nav-item span {
    font-size: 11px;
}

.bottom-nav .nav-item.active,
.bottom-nav .nav-item:hover {
    color: var(--primary);
}

/* ===== 骨架屏 ===== */
.drama-skeleton {
    background: var(--white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    animation: pulse 1.5s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.1s);
}

.drama-skeleton::before {
    content: '';
    display: block;
    padding-top: 180%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
}

.banner-skeleton {
    height: 180px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: var(--radius);
    animation: shimmer 1.5s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.empty-tip {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--gray);
}

/* ===== 响应式 ===== */
@media (min-width: 768px) {
    .drama-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
    
    .banner-slider {
        height: 240px;
    }
}

@media (min-width: 1024px) {
    .drama-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .main-content {
        max-width: 1200px;
        margin: 0 auto;
    }
}
