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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f0f0f;
    color: #ffffff;
    overflow-x: hidden;
}

/* 导航栏样式 */
.navbar {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.nav-left {
    display: flex;
    align-items: center;
    gap: 3rem;
    flex-shrink: 0;
}

.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 500px;
}

.nav-right {
    flex-shrink: 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #00d4ff;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-menu a {
    color: #ffffff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #00d4ff;
}

.user-menu button {
    background: #00d4ff;
    color: #000;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-menu button:hover {
    background: #00b8e6;
}

/* 导航栏搜索框样式 */
.nav-search {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.nav-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    outline: none;
}

.nav-search input::placeholder {
    color: #888;
}

.nav-search input:focus {
    border-color: #00d4ff;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

.nav-search button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #888;
    padding: 0.3rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-search button:hover {
    color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1001;
    backdrop-filter: blur(10px);
}

.search-suggestion-item {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.search-suggestion-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

.search-suggestion-item .suggestion-poster {
    width: 40px;
    height: 56px;
    object-fit: cover;
    border-radius: 0.3rem;
    background: rgba(255, 255, 255, 0.1);
}

.search-suggestion-item .suggestion-info {
    flex: 1;
}

.search-suggestion-item .suggestion-title {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.search-suggestion-item .suggestion-meta {
    color: #888;
    font-size: 0.8rem;
}

/* 主内容区域 */
.main-content {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
    padding: 2rem;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* 首页样式 */
.hero-section {
    margin-bottom: 3rem;
}

.hero-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.categories-section {
    margin-bottom: 3rem;
}

.category-section {
    margin-bottom: 4rem;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(0, 212, 255, 0.3);
    padding-bottom: 0.5rem;
}

.category-title {
    font-size: 1.5rem;
    color: #ffffff;
    font-weight: 600;
}

.category-more {
    background: transparent;
    color: #00d4ff;
    border: 1px solid #00d4ff;
    padding: 0.5rem 1rem;
    border-radius: 0.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.category-more:hover {
    background: #00d4ff;
    color: #000;
}

.category-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

/* 内容卡片样式 */
.content-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
    border-color: rgba(0, 212, 255, 0.5);
}

.content-card .image-container {
    position: relative;
    width: 100%;
    height: 280px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.content-card img.loading {
    opacity: 0.5;
}

.content-card img.error {
    display: none;
}

.image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #333 25%, transparent 25%, transparent 75%, #333 75%, #333),
                linear-gradient(45deg, #333 25%, transparent 25%, transparent 75%, #333 75%, #333);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.9rem;
    text-align: center;
    z-index: 1;
}

.image-placeholder.hidden {
    display: none;
}

.image-placeholder .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.image-placeholder .text {
    font-size: 0.8rem;
    opacity: 0.8;
}

.card-info {
    padding: 1rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-subtitle {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    padding: 0.2rem 0.5rem;
    border-radius: 0.3rem;
    font-size: 0.75rem;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 2rem;
    color: #ffffff;
}

.page-controls select {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 1rem;
}

/* 内容网格 */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.pagination button {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background: #00d4ff;
    color: #000;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 搜索样式 */
.search-section {
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.search-box input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.search-box input::placeholder {
    color: #888;
}

.search-box button {
    background: #00d4ff;
    color: #000;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-box button:hover {
    background: #00b8e6;
}

/* 详情页面样式 */
.detail-container {
    max-width: 1200px;
    margin: 0 auto;
}

.detail-info {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
}

.detail-poster {
    width: 300px;
    height: 420px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.detail-meta {
    flex: 1;
}

.detail-meta h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.subtitle {
    font-size: 1.2rem;
    color: #888;
    margin-bottom: 1rem;
}

.detail-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.actors {
    font-size: 1rem;
    color: #00d4ff;
    margin-bottom: 1rem;
}

.description {
    line-height: 1.6;
    color: #ccc;
    font-size: 1rem;
}

.episodes-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.play-sources {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.source-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.source-btn.active,
.source-btn:hover {
    background: #00d4ff;
    color: #000;
}

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

.episode-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: none;
    padding: 0.8rem;
    border-radius: 0.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.episode-btn:hover {
    background: rgba(0, 212, 255, 0.3);
}

.episode-btn.current {
    background: #00d4ff;
    color: #000;
}

/* 播放器样式 */
.player-container {
    max-width: 1200px;
    margin: 0 auto;
}

.player {
    width: 100%;
    height: 60vh;
    background: #000;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.player-controls {
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
}

.player-info {
    margin-bottom: 1.5rem;
}

.player-info h2 {
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.player-info p {
    color: #888;
}


.related-episodes h3 {
    color: #ffffff;
    margin-bottom: 1rem;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background: #1a1a1a;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 0.5rem;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.close {
    color: #888;
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.close:hover {
    color: #ffffff;
}

.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
    flex: 1;
    background: none;
    color: #888;
    border: none;
    padding: 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #00d4ff;
    border-bottom-color: #00d4ff;
}

.auth-form h2 {
    color: #ffffff;
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-form input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 0.8rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.auth-form input::placeholder {
    color: #888;
}

.auth-form button {
    width: 100%;
    background: #00d4ff;
    color: #000;
    border: none;
    padding: 0.8rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.auth-form button:hover {
    background: #00b8e6;
}

/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 无限滚动相关样式 */
#loading-more {
    animation: fadeIn 0.3s ease;
}

#no-more-content {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.loading p {
    color: #ffffff;
    font-size: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-left {
        gap: 1rem;
        width: 100%;
        justify-content: space-between;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .nav-center {
        width: 100%;
        max-width: none;
    }
    
    .nav-search {
        max-width: none;
    }
    
    .main-content {
        padding: 1rem;
        margin-top: 140px; /* 调整移动端导航栏高度 */
    }
    
    .hero-section h2 {
        font-size: 1.5rem;
    }
    
    .featured-grid,
    .content-grid,
    .category-content {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }
    
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .category-title {
        font-size: 1.2rem;
    }
    
    .category-more {
        align-self: flex-end;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .detail-info {
        flex-direction: column;
        text-align: center;
    }
    
    .detail-poster {
        width: 200px;
        height: 280px;
        margin: 0 auto;
    }
    
    .detail-meta h1 {
        font-size: 2rem;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .player {
        height: 250px;
    }
}