/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 隐藏滚动条但保持滚动功能 */
::-webkit-scrollbar {
    width: 0;
    height: 0;
}

html, body {
    -ms-overflow-style: none; /* IE/Edge */
    scrollbar-width: none; /* Firefox */
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0;
    height: 0;
}

:root {
    --primary-gradient: linear-gradient(135deg, #ff3366 0%, #ff6b9d 50%, #ff8fab 100%);
    --header-bg: linear-gradient(180deg, #ff3366 0%, #ff6b9d 100%);
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --rank-1: linear-gradient(135deg, #ff6b35, #ff4400);
    --rank-2: linear-gradient(135deg, #ff9500, #ff7700);
    --rank-3: linear-gradient(135deg, #ffb800, #ff9500);
    --rank-4: linear-gradient(135deg, #888888, #666666);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* 应用容器 */
.app-container {
    max-width: 100%;
    min-height: 100vh;
    background-color: var(--bg-color);
}

/* 头部区域 */
.header {
    background: var(--header-bg);
    padding: 16px 20px 24px;
    border-radius: 0 0 24px 24px;
    position: relative;
    overflow: hidden;
}

/* 头部装饰 */
.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.header-title {
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 1px;
}

.vip-badge {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333333;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(255, 165, 0, 0.4);
}

/* 搜索框 */
.search-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 50px;
    padding: 12px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.search-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

.search-box:active {
    transform: scale(0.98);
}

.search-icon {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.search-placeholder {
    flex: 1;
    font-size: 15px;
    color: var(--text-muted);
}

/* 轮播图区域 */
.banner-section {
    margin: 0 16px 20px;
    position: relative;
    z-index: 10;
}

.banner-slider {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.banner-slide {
    position: relative;
    width: 100%;
    height: 180px;
    display: none;
}

.banner-slide.active {
    display: block;
}

.banner-image {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* 胶片条纹效果 */
.film-strip {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 20px,
            rgba(255, 255, 255, 0.1) 20px,
            rgba(255, 255, 255, 0.1) 25px
        );
    opacity: 0.5;
}

.banner-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 20px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 50%, transparent 100%);
    color: #ffffff;
}

.banner-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.banner-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* 轮播指示器 */
.banner-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 20;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: #ffffff;
    width: 24px;
    border-radius: 4px;
}

/* 热播榜单区域 */
.hot-section {
    padding: 0 16px 30px;
}

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

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: rgba(255, 51, 102, 0.05);
    border-color: #ff3366;
    color: #ff3366;
}

.refresh-btn:hover svg {
    stroke: #ff3366;
}

.refresh-btn:active {
    transform: scale(0.95);
}

.refresh-btn.spinning svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.section-title {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
}

.title-icon {
    margin-right: 8px;
}

.more-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    transition: color 0.3s;
}

.more-link:hover {
    color: var(--text-primary);
}

.more-link span {
    margin-right: 4px;
}

/* 短剧网格 */
.drama-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.drama-card {
    display: block;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    text-decoration: none;
    position: relative;
    color: inherit;
}

.drama-card:visited {
    color: inherit;
}

.drama-card:active {
    color: inherit;
}

.drama-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.1), rgba(255, 107, 157, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.drama-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 0 20px 50px rgba(255, 51, 102, 0.25);
}

.drama-card:hover::before {
    opacity: 1;
}

.drama-cover {
    position: relative;
    width: 100%;
    padding-top: 125%;
    overflow: hidden;
}

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

.drama-card:hover .drama-cover img {
    transform: scale(1.05);
}

/* 排名徽章 */
.rank-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    color: #ffffff;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.rank-1 { background: var(--rank-1); }
.rank-2 { background: var(--rank-2); }
.rank-3 { background: var(--rank-3); }
.rank-4 { background: var(--rank-4); }

/* 集数标签 */
.episode-tag {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    font-size: 12px;
    color: #ffffff;
    z-index: 10;
}

.episode-tag svg {
    opacity: 0.9;
}

/* 短剧标题 */
.drama-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    padding: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 56px;
}

/* 精选推荐区域 */
.recommend-section {
    padding: 0 16px 100px;
    background-color: var(--bg-color);
}

/* 话费充值广告 */
.telco-ad-banner {
    display: block;
    position: relative;
    margin-bottom: 20px;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.25);
}

.telco-ad-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #ff6b35 0%, #ff9500 50%, #ffb800 100%);
    z-index: 0;
}

.telco-ad-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.telco-ad-bg::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.telco-ad-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    padding: 18px 20px;
    gap: 16px;
}

.telco-ad-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}

.telco-ad-icon.telco-operators {
    width: auto;
    min-width: 100px;
    background: transparent;
    backdrop-filter: none;
}

.operator-logos {
    display: flex;
    align-items: center;
    gap: 4px;
}

.operator-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.operator-logo:hover {
    transform: scale(1.1);
}

.operator-logo svg {
    width: 100%;
    height: 100%;
}

.telco-ad-text {
    flex: 1;
}

.telco-ad-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.telco-ad-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.telco-ad-btn {
    background: #ffffff;
    color: #ff6b35;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 20px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.recommend-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.recommend-item {
    display: flex;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    text-decoration: none;
    position: relative;
    color: inherit;
}

.recommend-item:visited {
    color: inherit;
}

.recommend-item:active {
    color: inherit;
}

.recommend-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.08), rgba(255, 107, 157, 0.08));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.recommend-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(255, 51, 102, 0.22);
}

.recommend-item:hover::before {
    opacity: 1;
}

.recommend-item:active {
    transform: scale(0.98);
}

.recommend-cover {
    width: 100px;
    height: 140px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 8px;
    margin: 12px;
}

.recommend-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.recommend-item:hover .recommend-cover img {
    transform: scale(1.05);
}

.recommend-info {
    flex: 1;
    padding: 12px 12px 12px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.recommend-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.recommend-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommend-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.tag {
    padding: 3px 8px;
    background: rgba(255, 51, 102, 0.08);
    color: #ff3366;
    font-size: 11px;
    border-radius: 3px;
    font-weight: 500;
    white-space: nowrap;
}

.recommend-episodes {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
    padding-left: 8px;
}

/* 底部导航栏 */
.bottom-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 1000;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    transition: all 0.3s ease;
    padding: 4px 24px;
}

.tab-item.active {
    color: #ff3366;
}

.tab-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.tab-text {
    font-size: 12px;
    font-weight: 500;
}

/* ========== PC端适配 ========== */
@media screen and (min-width: 1024px) {
    .app-container {
        max-width: 1200px;
        margin: 0 auto;
    }

    .header {
        padding: 24px 40px 32px;
        border-radius: 0 0 32px 32px;
    }

    .header-title {
        font-size: 32px;
    }

    .search-box {
        max-width: 500px;
        padding: 14px 24px;
    }

    .search-input {
        font-size: 16px;
    }

    .banner-section {
        margin: 0 40px 32px;
    }

    .banner-slide {
        height: 320px;
    }

    .banner-content {
        padding: 80px 40px 40px;
    }

    .banner-title {
        font-size: 36px;
    }

    .banner-subtitle {
        font-size: 18px;
    }

    .hot-section {
        padding: 0 40px 40px;
    }

    .section-title {
        font-size: 24px;
    }

    .drama-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .drama-title {
        font-size: 16px;
        padding: 16px;
        min-height: 72px;
    }

    .rank-badge {
        font-size: 14px;
        padding: 6px 14px;
    }

    .episode-tag {
        font-size: 14px;
        padding: 6px 12px;
    }

    /* PC端精选推荐 */
    .recommend-section {
        padding: 0 40px 40px;
    }

    .recommend-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .recommend-item {
        flex-direction: column;
    }

    .recommend-cover {
        width: 100%;
        height: 200px;
    }

    .recommend-info {
        padding: 20px;
    }

    .recommend-title {
        font-size: 18px;
    }

    .recommend-desc {
        font-size: 14px;
    }

    .recommend-episodes {
        right: 20px;
        bottom: 20px;
        font-size: 14px;
    }

    /* PC端隐藏底部导航 */
    .bottom-tabbar {
        display: none;
    }
}

/* 平板适配 */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    .drama-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .banner-slide {
        height: 240px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.drama-card {
    animation: fadeInUp 0.5s ease forwards;
}

.drama-card:nth-child(1) { animation-delay: 0.1s; }
.drama-card:nth-child(2) { animation-delay: 0.2s; }
.drama-card:nth-child(3) { animation-delay: 0.3s; }
.drama-card:nth-child(4) { animation-delay: 0.4s; }

/* 点击效果 */
.drama-card:active {
    transform: scale(0.98);
}
