/* ===================================
   大白影视 - 主样式文件
   =================================== */

/* 基础变量 */
:root {
    --primary: #e50914;
    --primary-dark: #b20710;
    --primary-light: #ff4d58;
    --bg-dark: #141414;
    --bg-card: #1a1a2e;
    --bg-surface: #16213e;
    --bg-hover: #1f2b47;
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #6b7280;
    --border-color: #2d3748;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.6);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===================================
   导航栏
   =================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    height: 64px;
}

.navbar .container {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 24px;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo:hover {
    color: var(--primary-light);
}

.logo i {
    font-size: 26px;
}

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

.search-form {
    display: flex;
    background: var(--bg-surface);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.search-form:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.2);
}

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

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

.search-form button {
    background: var(--primary);
    border: none;
    color: #fff;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.search-form button:hover {
    background: var(--primary-dark);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-links a {
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    white-space: nowrap;
    color: var(--text-secondary);
    transition: var(--transition);
}

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

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(10px);
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu.active {
    display: block;
}

.mobile-search {
    margin-bottom: 12px;
}

.mobile-link {
    display: block;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 15px;
}

.mobile-link:hover {
    background: var(--bg-hover);
}

/* ===================================
   英雄区域
   =================================== */
.hero-section {
    padding-top: 64px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(229, 9, 20, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    text-align: center;
    padding: 80px 20px 60px;
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.hero-search {
    max-width: 560px;
    margin: 0 auto 20px;
    display: flex;
    background: var(--bg-surface);
    border-radius: 30px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.hero-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 8px 32px rgba(229, 9, 20, 0.2);
}

.hero-search input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    padding: 16px 24px;
    font-size: 16px;
    outline: none;
}

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

.hero-search button {
    background: var(--primary);
    border: none;
    color: #fff;
    padding: 16px 28px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-search button:hover {
    background: var(--primary-dark);
}

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

.hot-search a {
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    margin: 0 4px;
    transition: var(--transition);
}

.hot-search a:hover {
    color: var(--primary);
    background: rgba(229, 9, 20, 0.1);
}

/* ===================================
   推荐区域
   =================================== */
.recommend-section {
    padding: 40px 0;
}

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

.section-header h2 {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: var(--primary);
}

.more-link {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.more-link:hover {
    color: var(--primary);
}

/* 电影网格 */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.movie-card {
    cursor: pointer;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    background: var(--bg-card);
}

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

.card-cover {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.movie-card:hover .card-cover img {
    transform: scale(1.08);
}

.card-rate {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.card-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 42px;
    color: rgba(255, 255, 255, 0.9);
    transition: var(--transition);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.movie-card:hover .card-play-btn {
    transform: translate(-50%, -50%) scale(1);
}

.card-info {
    padding: 10px 12px;
}

.card-title {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

/* ===================================
   搜索结果页
   =================================== */
.search-section {
    padding-top: 84px;
    min-height: calc(100vh - 64px);
}

.search-header {
    margin-bottom: 24px;
}

.search-header h2 {
    font-size: 20px;
}

.search-header .keyword {
    color: var(--primary);
}

.result-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    cursor: pointer;
    transition: var(--transition);
    align-items: center;
    border: 1px solid transparent;
}

.result-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-color);
    transform: translateX(4px);
}

.result-cover {
    width: 120px;
    min-width: 120px;
    aspect-ratio: 2/3;
    border-radius: var(--radius);
    overflow: hidden;
}

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

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

.result-title {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.meta-tag {
    font-size: 12px;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    color: var(--text-secondary);
}

.meta-tag.score {
    background: rgba(229, 9, 20, 0.15);
    color: var(--primary-light);
}

.meta-tag i {
    margin-right: 4px;
}

.result-director {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.result-director i {
    color: var(--primary);
    margin-right: 6px;
}

.result-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-action {
    font-size: 32px;
    color: var(--primary);
    opacity: 0;
    transition: var(--transition);
}

.result-card:hover .result-action {
    opacity: 1;
}

/* 搜索结果备注标签（如"正片"、"预告片"等） */
.result-remarks {
    display: inline-block;
    font-size: 12px;
    font-weight: 400;
    padding: 1px 8px;
    background: var(--primary);
    color: #fff;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

/* 无数据提示 */
.no-data {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
}

.no-result {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

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

.no-result p {
    font-size: 18px;
    margin-bottom: 8px;
}

.btn-back {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 24px;
    background: var(--primary);
    color: #fff;
    border-radius: 24px;
    transition: var(--transition);
}

.btn-back:hover {
    background: var(--primary-dark);
    color: #fff;
}

.search-tips {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-muted);
}

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

/* ===================================
   详情页
   =================================== */
.detail-section {
    padding-top: 64px;
}

.detail-card {
    position: relative;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
}

.detail-banner {
    height: 360px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.detail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(20, 20, 20, 0.3), rgba(20, 20, 20, 0.95));
}

.detail-content {
    display: flex;
    gap: 30px;
    padding: 0 30px 30px;
    margin-top: -140px;
    position: relative;
    z-index: 1;
}

.detail-poster {
    width: 200px;
    min-width: 200px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.detail-poster img {
    width: 100%;
    display: block;
}

.detail-info {
    flex: 1;
    padding-top: 20px;
}

.detail-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.detail-score {
    background: var(--primary);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
}

.detail-score i {
    margin-right: 4px;
}

.detail-tag {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.detail-tag i {
    margin-right: 4px;
}

.detail-director {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.detail-director i {
    color: var(--primary);
    margin-right: 6px;
}

.detail-desc {
    margin-top: 16px;
}

.detail-desc h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

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

/* ===================================
   播放区域
   =================================== */
.play-section {
    margin-top: 30px;
}

.section-title {
    font-size: 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: var(--primary);
}

.play-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.play-item {
    padding: 10px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.play-item:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.play-item.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.play-item i {
    font-size: 12px;
}

.player-section {
    margin-top: 24px;
}

.player-wrapper {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.player-header {
    padding: 14px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.player-header h3 {
    font-size: 15px;
}

.player-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
}

.player-container iframe,
.player-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.player-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.player-placeholder i {
    font-size: 56px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* ===================================
   底部
   =================================== */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
    padding: 40px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 40px;
    padding-bottom: 30px;
}

.footer-info h3 {
    font-size: 20px;
    color: var(--primary);
    margin-bottom: 10px;
}

.footer-info p {
    color: var(--text-muted);
    font-size: 14px;
}

.footer-links h4,
.footer-notice h4 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.footer-links a {
    display: block;
    padding: 4px 0;
    font-size: 14px;
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-notice p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding: 16px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===================================
   回到顶部
   =================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 900;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.4);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* ===================================
   响应式
   =================================== */
@media (max-width: 992px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-search {
        display: none;
    }
    
    .hero-title {
        font-size: 30px;
    }
    
    .hero-subtitle {
        font-size: 15px;
    }
    
    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
    }
    
    .detail-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 20px 20px;
    }
    
    .detail-poster {
        width: 160px;
        min-width: 160px;
    }
    
    .detail-meta {
        justify-content: center;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .result-card {
        flex-direction: column;
    }
    
    .result-cover {
        width: 100%;
        aspect-ratio: 16/9;
    }
    
    .result-action {
        display: none;
    }
}

@media (max-width: 576px) {
    .hero-content {
        padding: 60px 10px 40px;
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .hero-search {
        border-radius: 20px;
    }
    
    .hero-search input {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .hero-search button {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .movie-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .card-title {
        font-size: 12px;
    }
    
    .card-rate {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .detail-banner {
        height: 240px;
    }
    
    .detail-title {
        font-size: 22px;
    }
}

/* ===================================
   加载动画
   =================================== */
.loading {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===================================
   滚动条美化
   =================================== */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
