* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #0f0f0f;
    color: #e0e0e0;
    min-height: 100vh;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.header-video .header-inner {
    flex-wrap: nowrap;
}

.logo {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.logo img {
    height: 38px;
    width: auto;
}

.back-btn {
    color: #aaa;
    text-decoration: none;
    font-size: 14px;
    padding: 4px 12px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.back-btn:hover {
    background: #2a2a2a;
    color: #fff;
}

/* Search */
.search-box {
    display: flex;
    gap: 8px;
    max-width: 300px;
    margin-left: auto;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .search-box {
        max-width: 100%;
        width: 100%;
        margin-left: 0;
        order: 3;
    }
}

.search-input {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid #333;
    border-radius: 20px;
    background: #222;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: #e50914;
}

.search-input::placeholder {
    color: #666;
}

.search-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 20px;
    background: #e50914;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.search-btn:hover {
    background: #ff2d55;
}

/* Categories */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cat-btn {
    padding: 6px 16px;
    border: 1px solid #333;
    border-radius: 20px;
    background: transparent;
    color: #bbb;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.cat-btn:hover {
    border-color: #666;
    color: #fff;
}

.cat-btn.active {
    background: #e50914;
    border-color: #e50914;
    color: #fff;
}

/* Main */
.main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

@media (max-width: 560px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

.video-card {
    display: block;
    text-decoration: none;
    border-radius: 10px;
    overflow: hidden;
    background: #1a1a1a;
    transition: transform 0.2s, box-shadow 0.2s;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.video-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #222;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.video-card:hover .video-thumb img {
    transform: scale(1.05);
}

.duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 4px;
    font-size: 12px;
    color: #fff;
}

.video-info {
    padding: 10px 12px 12px;
}

.video-title {
    font-size: 14px;
    font-weight: 500;
    color: #ddd;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
    margin-bottom: 6px;
}

.video-types {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.type-tag {
    padding: 1px 8px;
    background: #2a2a2a;
    border-radius: 10px;
    font-size: 11px;
    color: #999;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 32px;
    padding-bottom: 40px;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #333;
    border-radius: 8px;
    background: transparent;
    color: #bbb;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover {
    border-color: #e50914;
    color: #e50914;
    background: rgba(229, 9, 20, 0.08);
}

.page-btn.active {
    background: #e50914;
    border-color: #e50914;
    color: #fff;
}

.page-btn.prev-next {
    padding: 0 14px;
    font-size: 13px;
}

.page-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.page-ellipsis {
    color: #555;
    font-size: 13px;
    padding: 0 4px;
    user-select: none;
}

.goto-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    color: #888;
    font-size: 13px;
}

.goto-input {
    width: 48px;
    height: 30px;
    padding: 0 6px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #222;
    color: #e0e0e0;
    font-size: 13px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.goto-input:focus {
    border-color: #e50914;
}

.goto-input::-webkit-inner-spin-button,
.goto-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.goto-input[type=number] {
    -moz-appearance: textfield;
}

/* Video Player Page */
.main-video {
    padding-top: 20px;
}

.video-player-container {
    width: 100%;
    max-width: 960px;
    height: 540px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    position: relative;
}

.video-iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

.video-detail {
    max-width: 960px;
    margin: 20px auto 0;
}

.detail-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
    margin-bottom: 12px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.meta-tag {
    padding: 4px 14px;
    background: #222;
    border-radius: 16px;
    font-size: 13px;
    color: #aaa;
}

/* Topic Tags */
.topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.topic-tag {
    padding: 3px 12px;
    background: #1a2a1a;
    border: 1px solid #2a4a2a;
    border-radius: 14px;
    font-size: 12px;
    color: #8bc34a;
}

/* Empty */
.empty {
    text-align: center;
    padding: 80px 20px;
    color: #666;
    font-size: 16px;
}