/* ============================================
   首页样式 - 爱奇艺暗色主题 1:1 还原
   ============================================ */

:root {
    --bg-page: #111319;
    --bg-card: #1a1c24;
    --bg-card-hover: #22242e;
    --bg-input: rgba(255,255,255,0.08);
    --text-primary: #f0f0f0;
    --text-secondary: rgba(255,255,255,0.6);
    --text-muted: rgba(255,255,255,0.35);
    --accent: #00CC36;
    --accent2: #00e641;
    --gradient-accent: linear-gradient(135deg, #00CC36, #00e641);
    --border: rgba(255,255,255,0.06);
    --radius: 12px;
    --radius-sm: 8px;
    --nav-height: 56px;
    --header-height: 50px;
    --category-height: 44px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-page);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    flex-direction: column;
}

a { text-decoration: none; color: inherit; }

/* ====== 顶部导航栏 ====== */
.top-header {
    flex-shrink: 0;
    height: var(--header-height);
    background: var(--bg-page);
    display: flex;
    align-items: center;
    padding: 0 12px;
    z-index: 100;
    gap: 10px;
}

.header-logo {
    flex-shrink: 0;
    height: 28px;
    display: flex;
    align-items: center;
}

.header-logo img {
    height: 28px;
    width: auto;
    display: block;
}

.header-logo-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.5px;
    line-height: 1;
}

.header-search {
    flex: 1;
    height: 32px;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border-radius: 16px;
    padding: 0 12px;
    gap: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.header-search:focus-within {
    background: rgba(255,255,255,0.12);
}

.header-search svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

.header-search input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    font-family: inherit;
}

.header-search input::placeholder {
    color: var(--text-muted);
}

.header-search-btn {
    display: none;
    flex-shrink: 0;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}

.header-search.has-value .header-search-btn {
    display: block;
}

/* ====== 分类标签栏 ====== */
.category-bar {
    flex-shrink: 0;
    height: var(--category-height);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-page);
}

.category-bar::-webkit-scrollbar { display: none; }

.category-item {
    flex-shrink: 0;
    font-size: 15px;
    font-weight: 400;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    padding: 4px 0;
    transition: color 0.25s;
    border: none;
    background: none;
    font-family: inherit;
    white-space: nowrap;
}

.category-item.active {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

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

/* ====== 主体内容 ====== */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    min-height: 0;
}

.main-content::-webkit-scrollbar { width: 0; display: none; }

/* ====== 轮播图 Banner ====== */
.carousel-section {
    padding: 0;
}

.carousel {
    position: relative;
    border-radius: 0;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    max-height: 50vh;
    background: var(--bg-card);
}

.carousel-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.carousel-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.4);
    transition: all 0.3s;
}

.dot.active {
    width: 16px;
    background: #fff;
}

/* ====== 热门推荐横向滚动 ====== */
.hot-section {
    margin-top: 16px;
    padding: 0 0 0 12px;
}

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

.section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

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

.section-more svg {
    width: 14px;
    height: 14px;
}

.hot-scroll {
    overflow: hidden;
    padding-bottom: 4px;
}

.hot-scroll-track {
    display: flex;
    gap: 10px;
    width: max-content;
    animation: hot-marquee 18s linear infinite;
}

.hot-scroll:hover .hot-scroll-track,
.hot-scroll:active .hot-scroll-track {
    animation-play-state: paused;
}

@keyframes hot-marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.hot-card {
    flex-shrink: 0;
    width: 110px;
    scroll-snap-align: start;
    cursor: pointer;
    position: relative;
}

.hot-card:active {
    transform: scale(0.97);
    transition: transform 0.15s;
}

.hot-card-cover {
    position: relative;
    width: 110px;
    height: 150px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-card);
}

.hot-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hot-card-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

/* TOP 角标 */
.top-badge {
    position: absolute;
    top: 0;
    left: 0;
    min-width: 36px;
    height: 22px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    border-radius: 8px 0 8px 0;
    z-index: 2;
}

.top-badge.top-1 { background: linear-gradient(135deg, #FF6B35, #FF3D00); }
.top-badge.top-2 { background: linear-gradient(135deg, #FF9800, #FF6D00); }
.top-badge.top-3 { background: linear-gradient(135deg, #FFC107, #FF9800); }
.top-badge.top-n { background: rgba(0,0,0,0.6); }

.hot-card-ep {
    position: absolute;
    bottom: 4px;
    right: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0,0,0,0.65);
    font-size: 10px;
    color: #fff;
    backdrop-filter: blur(4px);
}

.hot-card-title {
    font-size: 12px;
    font-weight: 500;
    margin-top: 6px;
    line-height: 1.3;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hot-card-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ====== 为你推荐 - 隐藏（只保留热门推荐一行） ====== */
.recommend-section {
    display: none;
}

.drama-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.drama-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
    min-width: 0;
    overflow: hidden;
    cursor: pointer;
}

.drama-card:active { transform: scale(0.96); }

.drama-cover {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-card);
}

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

.drama-cover-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
}

.drama-ep-badge {
    position: absolute; bottom: 4px; right: 4px;
    padding: 2px 6px; border-radius: 4px;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
    font-size: 10px; color: #fff; font-weight: 500;
}

.drama-card-title {
    font-size: 12px; font-weight: 500;
    margin-top: 6px; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 1;
    -webkit-box-orient: vertical; overflow: hidden;
    color: var(--text-primary);
}

.drama-card-views {
    font-size: 11px; color: var(--text-muted); margin-top: 2px;
}

/* ====== 公告栏 ====== */
.announcement-bar {
    display: none;
    align-items: center;
    margin: 10px 12px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    gap: 8px;
    overflow: hidden;
}

.announce-icon {
    color: var(--accent);
    flex-shrink: 0;
    opacity: 0.8;
}

.announce-text-wrap {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.announce-marquee {
    display: inline-block;
    font-size: 12px;
    color: var(--text-secondary);
    animation: marquee 18s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* ====== 搜索结果状态 ====== */
.search-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 12px 8px;
}

.search-result-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.search-result-text em {
    color: var(--accent);
    font-style: normal;
    font-weight: 600;
}

.search-clear-btn {
    font-size: 13px;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 4px 8px;
}

/* ====== 空状态 ====== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 12px;
    opacity: 0.3;
}

.empty-state span {
    font-size: 14px;
}

/* ====== 底部间距 ====== */
.bottom-spacer {
    height: 0;
}

/* ====== Toast ====== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ====== 加载动画 ====== */
.skeleton-card {
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.skeleton-cover {
    aspect-ratio: 3 / 4;
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-title {
    height: 12px;
    margin-top: 8px;
    width: 80%;
    background: var(--bg-card);
    border-radius: 4px;
    animation: skeleton-loading 1.5s infinite;
}

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

/* ====== 响应式 - 电脑端居中 ====== */
@media (min-width: 480px) {
    body {
        max-width: 420px;
        margin: 0 auto;
        position: relative;
        box-shadow: 0 0 60px rgba(0,0,0,0.6);
    }
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        max-width: 420px;
        width: 100%;
    }
}
