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

body {
    font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.5;
}

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

/* 导航栏样式 */
.navbar {
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    isolation: isolate; /* 创建新的层叠上下文 */
}

.navbar .container {
    display: flex;
    align-items: center;
    height: 60px;
}

.logo a {
    text-decoration: none;
    color: #ff6b81;
    font-size: 24px;
}

.logo h1 {
    font-weight: bold;
}

.nav-links {
    display: flex;
    list-style: none;
    margin-left: 30px;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    padding: 8px 12px;
    font-size: 15px;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #ff6b81;
}

.search-box {
    position: relative;
    margin-left: auto;
    margin-right: 20px;
}

.search-box form {
    display: flex;
    align-items: center;
}

#searchInput {
    width: 200px;
    height: 36px;
    padding: 0 15px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
}

.search-box button {
    height: 36px;
    padding: 0 15px;
    background: #ff6b81;
    border: none;
    border-radius: 0 4px 4px 0;
    color: #fff;
    cursor: pointer;
}

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

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 5px;
    z-index: 1000;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#captchaInput {
    width: 100px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#captchaImage {
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
}

.user-actions {
    margin-left: 20px;
}

.user-actions a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

/* Banner区域样式 */
.banner-section {
    margin-top: 60px;
    padding: 20px 0;
}

.banner-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 内容区域样式 */
.movie-section {
    margin: 30px 0;
}

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

.section-header h2 {
    font-size: 20px;
    font-weight: bold;
}

.section-actions {
    display: flex;
    gap: 15px;
}

.refresh-btn, .more-btn {
    padding: 6px 12px;
    border: none;
    background: none;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.refresh-btn:hover, .more-btn:hover {
    color: #ff6b81;
}

/* 筛选区域样式优化 */
.filter-section {
    background: #fff;
    border-radius: 8px;
    padding: 5px 0;
    margin-bottom: 15px;
}

.filter-row {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-bottom: 1px solid #f5f5f5;
    height: 32px;
}

.filter-row:last-child {
    border-bottom: none;
}

.filter-label {
    min-width: 36px;
    color: #999;
    font-size: 13px;
    flex-shrink: 0;
    margin-right: 8px;
}

.filter-options {
    position: relative;
    flex: 1;
    min-width: 0;
}

.filter-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-behavior: smooth;
    padding: 0 2px;
}

.filter-scroll::-webkit-scrollbar {
    display: none;
}

.filter-option {
    flex: 0 0 auto;
    height: 24px;
    padding: 0 10px;
    margin-right: 6px;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
    background: #f5f5f5;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.filter-option:last-child {
    margin-right: 0;
}

.filter-option:hover {
    background: #ff6b81;
    color: #fff;
}

.filter-option.active {
    background: #ff6b81;
    color: #fff;
}

/* 滚动提示遮罩 */
.filter-options::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 24px;
    background: linear-gradient(to right, transparent, #fff);
    pointer-events: none;
    opacity: 0.8;
}

/* 移动端优化 */
@media screen and (max-width: 768px) {
    .filter-section {
        margin: 8px;
        padding: 3px 0;
    }

    .filter-row {
        padding: 4px 8px;
        height: 28px;
    }

    .filter-label {
        min-width: 32px;
        font-size: 12px;
        margin-right: 6px;
    }

    .filter-scroll {
        padding: 0;
    }

    .filter-option {
        height: 22px;
        padding: 0 8px;
        margin-right: 5px;
        font-size: 12px;
        border-radius: 11px;
    }
}

/* 电影网格布局优化 */
.movies-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    padding: 15px;
    margin: 0 auto;
    max-width: 1200px;
}

.movie-card {
    position: relative;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.movie-poster {
    position: relative;
    width: 100%;
    padding-top: 140%; /* 保持 1.4:1 的宽高比 */
    background: #f5f5f5;
    overflow: hidden;
}

.movie-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.movie-info {
    padding: 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.movie-info h3 {
    font-size: 14px;
    margin: 8px 0;
    color: #333;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.movie-region {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* 响应式布局优化 */
@media screen and (max-width: 1200px) {
    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
        padding: 10px;
    }
}

@media screen and (max-width: 768px) {
    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
        padding: 8px;
    }

    .movie-info h3 {
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {
    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
        padding: 6px;
    }

    .movie-info {
        padding: 8px;
    }

    .movie-info h3 {
        font-size: 12px;
        -webkit-line-clamp: 2;
        line-clamp: 2; /* 标准属性 */
    }

    .movie-region {
        font-size: 11px;
    }
}

/* 加载动画优化 */
.skeleton {
    position: relative;
    background: #f5f5f5;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.3) 50%, 
        rgba(255,255,255,0) 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* 容器布局 */
.category-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

@media screen and (max-width: 768px) {
    .category-container {
        padding: 10px;
    }
}

/* 底部栏样式 */
.footer {
    background: #fff;
    padding: 30px 0;
    margin-top: 40px;
    border-top: 1px solid #eee;
}

.footer-content {
    text-align: center;
}

.footer-info {
    color: #999;
    font-size: 14px;
    margin-bottom: 15px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.footer-links a:hover {
    color: #ff6b81;
}

/* 搜索框样式 */
.search-box {
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-right: 8px;
}

.search-box button {
    background-color: #ff4d4d;
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
}

/* Banner轮播样式 */
.banner-slider {
    position: relative;
    display: flex;
    transition: transform 0.5s ease;
    width: 100%;
    overflow: hidden;
}

.banner-item {
    flex: 0 0 100%;
    position: relative;
    height: 400px;
}

.banner-image {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

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

.banner-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #ffffff;
}

.banner-info h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #ffffff;
}

.banner-meta {
    margin-bottom: 15px;
}

.banner-meta span {
    margin-right: 15px;
    font-size: 14px;
}

.banner-btn {
    display: inline-block;
    padding: 8px 20px;
    background-color: #ff4d4d;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.banner-btn:hover {
    background-color: #ff3333;
}

.banner-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
}

.banner-controls button {
    background-color: rgba(255,255,255,0.5);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.banner-controls button:hover {
    background-color: rgba(255,255,255,0.8);
}

.banner-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.5);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.indicator.active {
    background-color: #ff4d4d;
}

.error-message, .no-banner {
    text-align: center;
    padding: 40px;
    background-color: #ffffff;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 电影卡片样式 */
.movie-card:hover {
    transform: translateY(-5px);
}

.movie-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.movie-card:hover .movie-hover {
    opacity: 1;
}

.watch-btn {
    padding: 8px 20px;
    background: #ff4d4d;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.watch-btn:hover {
    background: #ff3333;
}

.movie-info h4 {
    margin: 0 0 8px;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #666666;
}

.no-content, .error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.error-message {
    color: #ff4d4d;
}

/* 移除原有的悬停效果样式 */
.item-poster .item-hover,
.movie-poster .movie-hover {
    display: none;
}

.item-card,
.movie-card {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.item-card:hover,
.movie-card:hover {
    transform: translateY(-2px);
}

.item-poster,
.movie-poster {
    position: relative;
    width: 100%;
    padding-top: 140%;
    background: #f5f5f5;
    overflow: hidden;
    border-radius: 8px;
}

.item-poster img,
.movie-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 移动端优化 */
@media screen and (max-width: 768px) {
    .item-card:hover,
    .movie-card:hover {
        transform: none;
    }
}

.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* 提高z-index确保在导航栏之上 */
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 320px;
    position: relative;
}

.captcha-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#captchaInput {
    flex: 1;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#captchaImage {
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-buttons button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.submit-btn {
    background: #ff6b81;
    color: #fff;
}

.cancel-btn {
    background: #f5f5f5;
    color: #666;
}

@media (max-width: 768px) {
    .modal-content {
        width: 85%;
        margin: 15px;
        background: #fff;
        position: relative;
        z-index: 2001; /* 确保内容在遮罩之上 */
    }
    
    .captcha-container {
        flex-direction: column;
        align-items: center;
    }
    
    #captchaImage {
        width: 100%;
        height: auto;
        max-height: 50px;
        object-fit: contain;
    }

    .search-modal {
        padding: 15px;
    }
}

.movie-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.movie-card:hover .movie-info h3 {
    color: #ff6b81;  /* 鼠标悬停时的文字颜色 */
} 