html {
    scroll-behavior: smooth;
}

/* 确保 Bootstrap 网格生效 */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -12px;
    margin-right: -12px;
}

.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: 12px;
    padding-left: 12px;
}

.col-6 { flex: 0 0 auto; width: 50%; }
.col-sm-4 { flex: 0 0 auto; width: 33.33333%; }
.col-md-3 { flex: 0 0 auto; width: 25%; }
.col-lg-2 { flex: 0 0 auto; width: 16.66667%; }

body.custom-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: #0a0a0a;
    color: #f3f4f6;
    padding-top: 64px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main.custom-main {
    flex: 1;
    padding-bottom: 40px;
}

footer.custom-footer {
    background-color: #111827;
    border-top: 1px solid #1f2937;
    padding: 24px 0;
    color: #6b7280;
    font-size: 14px;
}

/* 头部 */
.custom-header {
    background-color: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid #1f2937;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: #ef4444;
}

.search-box {
    position: relative;
}

.search-input {
    width: 200px;
    padding: 8px 16px 8px 36px;
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: #ef4444;
}

.search-input::placeholder {
    color: #6b7280;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 14px;
    pointer-events: none;
}

@media (min-width: 768px) {
    .search-input {
        width: 260px;
    }
}

/* 导航按钮 */
.nav-btn {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.2s;
    background: transparent;
    border: none;
    cursor: pointer;
}

.nav-btn:hover {
    color: #fff;
    background-color: #374151;
}

.nav-btn.active {
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* 下拉菜单 */
.custom-dropdown-menu {
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    padding: 4px 0;
    min-width: 140px;
}

.custom-dropdown-item {
    color: #d1d5db;
    padding: 6px 14px;
    font-size: 14px;
}

.custom-dropdown-item:hover,
.custom-dropdown-item:focus {
    background-color: #374151;
    color: #fff;
}

/* 视频卡片 */
.video-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #1f2937;
    border: 1px solid #374151;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    border-color: #ef4444;
}

.card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--card-from, #1f2937), var(--card-to, #111827));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    overflow: hidden;
}

.card-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.08), transparent 60%);
    pointer-events: none;
}

.card-cover-title {
    position: relative;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.95);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    z-index: 1;
    padding: 0 8px;
}

.card-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 2;
}

.card-type {
    padding: 2px 7px;
    background: rgba(239, 68, 68, 0.85);
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50%;
}

.card-duration {
    padding: 2px 7px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* 播放线路切换 */
.source-tab {
    padding: 6px 14px;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 6px;
    color: #9ca3af;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.source-tab:hover {
    background: #374151;
    color: #fff;
}

.source-tab.active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #ef4444;
    color: #fff;
}

.source-label {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 8px;
}

/* 更多按钮 */
.more-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 20px;
    color: #d1d5db;
    font-size: 13px;
    transition: all 0.2s;
    text-decoration: none;
}

.more-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

/* 分页 */
.custom-pagination {
    margin-top: 32px;
}

.custom-pagination .page-link {
    background: #1f2937;
    border-color: #374151;
    color: #9ca3af;
}

.custom-pagination .page-link:hover {
    background: #374151;
    border-color: #374151;
    color: #fff;
}

.custom-pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #ef4444;
}

.custom-pagination .page-item.disabled .page-link {
    opacity: 0.5;
}

/* 视频详情页 */
.video-detail {
    animation: fadeIn 0.3s ease;
}

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

.video-player-container {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.video-player-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

.no-play-url {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    color: #9ca3af;
}

.no-play-icon {
    font-size: 36px;
    margin-bottom: 8px;
    color: #eab308;
}

.detail-title {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 16px;
}

.info-card {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 10px;
    padding: 20px;
    position: sticky;
    top: 80px;
}

.info-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.info-label {
    color: #6b7280;
}

.info-value {
    color: #d1d5db;
    text-align: right;
    max-width: 60%;
    word-break: break-all;
}

/* 标签 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    padding: 4px 12px;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 20px;
    font-size: 13px;
    color: #9ca3af;
    transition: all 0.2s;
    cursor: pointer;
}

.tag-item:hover {
    border-color: #ef4444;
    color: #fca5a5;
}

/* 加载骨架 */
.loading-skeleton {
    background: linear-gradient(90deg, #1f2937 25%, #374151 50%, #1f2937 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
    border-radius: 10px;
    aspect-ratio: 16 / 9;
}

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

.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
}

/* 返回按钮 */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    color: #9ca3af;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.back-btn:hover {
    background: #374151;
    color: #fff;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 16px;
}

/* 标题 */
.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: #6b7280;
}

@media (max-width: 640px) {
    .card-cover-title {
        font-size: 13px;
    }
    .search-input {
        width: 140px;
    }
}