/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b9d;
    --primary-gradient: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    --secondary-color: #6c5ce7;
    --bg-color: #0f0f23;
    --bg-light: #1a1a2e;
    --bg-card: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0c0;
    --text-muted: #6c6c8a;
    --accent-gold: #ffd93d;
    --success-color: #00b894;
    --danger-color: #e17055;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 16px 48px rgba(255, 107, 157, 0.25);
    --radius: 12px;
    --radius-lg: 20px;
}

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.6;
    min-height: 100vh;
}

/* 导航栏 */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

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

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

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-links a {
    padding: 8px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-links a.active {
    color: var(--text-primary);
    background: var(--primary-gradient);
}

.nav-search {
    flex: 1;
    max-width: 360px;
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border-radius: 100px;
    padding: 4px 4px 4px 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.nav-search:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.15);
}

.nav-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    padding: 8px 0;
}

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

.nav-search button {
    background: var(--primary-gradient);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: transform 0.2s ease;
}

.nav-search button:hover {
    transform: scale(1.05);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    border: 2px solid rgba(255, 107, 157, 0.3);
    transition: all 0.3s ease;
}

.user-avatar:hover {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* 页面容器 */
.page {
    display: none;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.page.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 轮播横幅 */
.hero-banner {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 40px;
    height: 420px;
    cursor: pointer;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-slide.active {
    opacity: 1;
}

.hero-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(15, 15, 35, 0.95) 0%, rgba(15, 15, 35, 0.5) 50%, rgba(15, 15, 35, 0.2) 100%);
    z-index: 1;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.05);
}

.hero-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 60px;
    max-width: 60%;
}

.hero-badge {
    display: inline-block;
    background: var(--primary-gradient);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    width: fit-content;
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.hero-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 14px;
}

.hero-meta .rating {
    color: var(--accent-gold);
    font-weight: 700;
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 28px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-buttons {
    display: flex;
    gap: 12px;
}

.btn-primary, .btn-secondary {
    padding: 12px 28px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 20px rgba(255, 107, 157, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 107, 157, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.hero-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 3;
}

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

.hero-dot.active {
    background: var(--primary-color);
    width: 32px;
    border-radius: 5px;
}

/* Section */
.section {
    margin-bottom: 48px;
}

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

.section-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.see-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s;
}

.see-more:hover {
    color: #ff8fb3;
}

/* 剧集卡片网格 */
.show-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.show-grid.large {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.show-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.show-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.show-card-poster {
    position: relative;
    padding-top: 140%;
    overflow: hidden;
}

.show-card-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.show-card:hover .show-card-poster img {
    transform: scale(1.08);
}

.show-card-poster::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(22, 33, 62, 1) 0%, transparent 100%);
    z-index: 1;
}

.show-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.badge-hot {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
}

.badge-new {
    background: linear-gradient(135deg, #00b894 0%, #00a381 100%);
}

.badge-vip {
    background: linear-gradient(135deg, #ffd93d 0%, #f0c419 100%);
    color: #1a1a2e;
}

.show-card-rating {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-gold);
}

.show-card-status {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 2;
    color: white;
    font-size: 12px;
    font-weight: 500;
}

.show-card-fav {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.show-card:hover .show-card-fav {
    opacity: 1;
}

.show-card-fav.active {
    background: var(--primary-gradient);
    opacity: 1;
}

.show-card-info {
    padding: 14px 16px 16px;
}

.show-card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.show-card-sub {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

.show-card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.show-card-tag {
    background: rgba(108, 92, 231, 0.2);
    color: #a29bfe;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

/* 页面标题 */
.page-title {
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.page-title h2 {
    font-size: 28px;
    font-weight: 800;
}

.page-title .subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.page-title .btn-secondary {
    position: absolute;
    right: 0;
    top: 0;
    padding: 10px 20px;
    font-size: 14px;
}

.page-title-actions {
    position: absolute;
    right: 0;
    top: 0;
    display: flex;
    gap: 10px;
}

.page-title-actions button {
    padding: 10px 18px;
    font-size: 13px;
}

.empty-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 筛选栏 */
.filter-bar {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.filter-label {
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 50px;
    font-size: 14px;
}

.filter-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.tag:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.tag.active {
    background: var(--primary-gradient);
    color: white;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 24px;
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 22px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    margin-bottom: 24px;
}

/* 历史列表 */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-item {
    display: flex;
    gap: 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.history-poster {
    width: 100px;
    height: 140px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.history-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px 0;
}

.history-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.history-ep {
    color: var(--primary-color);
    font-size: 14px;
    margin-bottom: 8px;
}

.history-time {
    color: var(--text-muted);
    font-size: 13px;
}

.history-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 12px;
}

.history-progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.history-del {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 20px;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    align-self: flex-start;
}

.history-del:hover {
    background: rgba(225, 112, 85, 0.2);
    color: var(--danger-color);
}

/* 弹窗 */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
    z-index: 1;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--danger-color);
    transform: rotate(90deg);
}

.detail-modal {
    width: 100%;
    max-width: 900px;
}

.player-modal {
    width: 100%;
    max-width: 960px;
}

/* 详情页内容 */
.detail-hero {
    position: relative;
    height: 300px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
}

.detail-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(8px) brightness(0.5);
    transform: scale(1.1);
}

.detail-hero-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    gap: 24px;
    padding: 32px;
    align-items: flex-end;
}

.detail-poster {
    width: 160px;
    height: 224px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
    margin-bottom: -80px;
    position: relative;
    z-index: 2;
}

.detail-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-meta {
    flex: 1;
    padding-bottom: 80px;
}

.detail-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.2;
}

.detail-meta-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 14px;
}

.detail-meta-row span {
    color: var(--text-secondary);
}

.detail-meta-row .rating {
    color: var(--accent-gold);
    font-weight: 700;
    font-size: 16px;
}

.detail-tag-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-tag-list .detail-tag {
    background: rgba(108, 92, 231, 0.3);
    color: #a29bfe;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
}

.detail-body {
    padding: 32px;
}

.detail-section {
    margin-bottom: 28px;
}

.detail-section h3 {
    font-size: 18px;
    margin-bottom: 14px;
    font-weight: 700;
    padding-left: 10px;
    border-left: 3px solid var(--primary-color);
}

.detail-desc {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 14px;
}

.detail-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
}

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

.ep-btn {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.ep-btn:hover {
    background: var(--primary-gradient);
    border-color: transparent;
    transform: translateY(-2px);
}

.ep-btn.watched {
    background: rgba(0, 184, 148, 0.15);
    border-color: var(--success-color);
}

.ep-btn.current {
    background: var(--primary-gradient);
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(255, 107, 157, 0.4);
}

.ep-btn.vip::after {
    content: 'VIP';
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent-gold);
    color: var(--bg-color);
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 800;
}

/* 播放器 */
.player-container {
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
    overflow: hidden;
}

.player-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: var(--text-secondary);
    text-align: center;
    padding: 40px;
}

.player-placeholder .big-play {
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 157, 0.5);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(255, 107, 157, 0);
    }
}

.player-placeholder .big-play:hover {
    transform: scale(1.1);
}

.player-placeholder h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.player-info {
    padding: 24px 32px;
}

.player-info-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 20px;
}

.player-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.player-ep-info {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
}

.player-nav {
    display: flex;
    gap: 8px;
}

.player-nav button {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.player-nav button:hover:not(:disabled) {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.player-nav button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.player-sources {
    margin-top: 16px;
}

.player-sources h4 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.sources-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.source-btn {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.source-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(30, 30, 50, 0.95);
    backdrop-filter: blur(20px);
    padding: 14px 28px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-color: var(--success-color);
    box-shadow: 0 8px 32px rgba(0, 184, 148, 0.2);
}

.toast.error {
    border-color: var(--danger-color);
}

/* 响应式 */
@media (max-width: 968px) {
    .nav-container {
        flex-wrap: wrap;
        gap: 12px;
    }

    .nav-links {
        order: 3;
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
    }

    .nav-search {
        max-width: none;
        flex: 1 1 200px;
    }

    .hero-banner {
        height: 320px;
    }

    .hero-content {
        padding: 24px;
        max-width: 80%;
    }

    .hero-title {
        font-size: 28px;
    }

    .show-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 14px;
    }

    .show-grid.large {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .detail-hero {
        height: auto;
    }

    .detail-hero-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px;
    }

    .detail-poster {
        margin-bottom: 0;
    }

    .detail-meta {
        padding-bottom: 0;
    }

    .detail-tag-list {
        justify-content: center;
    }

    .page-title .btn-secondary {
        position: static;
        align-self: flex-start;
    }
}

@media (max-width: 568px) {
    .nav-container {
        padding: 12px 16px;
    }

    .logo-text {
        font-size: 18px;
    }

    .page {
        padding: 16px;
    }

    .hero-banner {
        height: 280px;
    }

    .hero-title {
        font-size: 22px;
    }

    .hero-meta {
        font-size: 12px;
        gap: 10px;
    }

    .hero-desc {
        font-size: 13px;
    }

    .hero-buttons {
        flex-wrap: wrap;
    }

    .btn-primary, .btn-secondary {
        padding: 10px 20px;
        font-size: 14px;
    }

    .show-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .show-grid.large {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-header h2 {
        font-size: 18px;
    }

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

    .history-poster {
        width: 100%;
        height: 180px;
    }

    .detail-body {
        padding: 20px;
    }

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

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

/* ==================== 片源搜索页 ==================== */
.source-search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.source-search-box input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    padding: 12px 22px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.source-search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.15);
}

.source-endpoint-row {
    margin-bottom: 20px;
    align-items: center;
}

.source-select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    min-width: 180px;
}

.source-refresh-btn {
    padding: 8px 14px !important;
    font-size: 13px !important;
}

.source-results {
    margin-top: 8px;
}

.source-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 107, 157, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

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

.source-summary {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 16px;
    padding-left: 4px;
}

.source-group {
    margin-bottom: 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.source-group-failed {
    opacity: 0.6;
}

.source-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.source-name {
    font-weight: 600;
    font-size: 15px;
}

.source-status {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 100px;
}

.source-status.ok {
    background: rgba(0, 184, 148, 0.2);
    color: var(--success-color);
}

.source-status.failed {
    background: rgba(225, 112, 85, 0.2);
    color: var(--danger-color);
}

.source-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.source-item {
    display: flex;
    gap: 14px;
    padding: 12px;
    border-radius: 10px;
    background: var(--bg-light);
    transition: all 0.2s;
}

.source-item:hover {
    background: rgba(255, 107, 157, 0.08);
}

.source-item-poster {
    width: 80px;
    height: 110px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-color);
}

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

.source-item-info {
    flex: 1;
    min-width: 0;
}

.source-item-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}

.source-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 6px;
}

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

.source-item-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.source-item-actions button {
    padding: 8px 16px;
    font-size: 12px;
}

/* ==================== 自定义添加表单 ==================== */
.custom-add-modal {
    width: 100%;
    max-width: 560px;
}

.custom-add-body {
    padding: 28px 32px 32px;
}

.custom-add-body h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.custom-add-tip {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 24px;
    line-height: 1.6;
}

.form-row {
    margin-bottom: 18px;
}

.form-row label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-row .required {
    color: var(--danger-color);
}

.form-row input,
.form-row textarea {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
    resize: vertical;
}

.form-row input:focus,
.form-row textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.15);
}

.episode-url-list {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
}

.ep-url-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.ep-num {
    min-width: 70px;
    font-size: 13px;
    color: var(--text-secondary);
}

.ep-url-input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
    font-family: inherit;
}

.ep-url-input:focus {
    border-color: var(--primary-color);
}

.custom-add-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==================== 真实播放器加载/错误态 ==================== */
.player-loading,
.player-error {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    z-index: 2;
}

.player-loading .spinner {
    border-color: rgba(255, 255, 255, 0.15);
    border-top-color: white;
}

.player-error h3 {
    font-size: 20px;
    margin: 12px 0 6px;
}

.player-error p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

/* 响应式补丁 */
@media (max-width: 568px) {
    .page-title-actions {
        position: static;
        margin-top: 8px;
    }
    .source-search-box {
        flex-direction: column;
    }
    .source-search-box button {
        width: 100%;
    }
    .source-endpoint-row {
        flex-wrap: wrap;
    }
    .source-select {
        flex: 1;
        min-width: 0;
    }
    .source-item {
        flex-direction: column;
    }
    .source-item-poster {
        width: 100%;
        height: 200px;
    }
    .custom-add-body {
        padding: 24px 20px;
    }
}
