
/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 搜索和筛选栏 */
.search-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
    margin: 0 auto;
}

#searchInput {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
}

#searchBtn {
    padding: 0.8rem 1.2rem;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: transform 0.3s ease;
}

#searchBtn:hover {
    transform: scale(1.05);
}

.filter-bar {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 25px;
    background-color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.filter-btn.active,
.filter-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
}

/* 影视网格布局 */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.movie-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

/* 卡片分享按钮 */
.card-share-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    z-index: 10;
}

.movie-card:hover .card-share-btn {
    opacity: 1;
}

.card-share-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.1);
}

.movie-poster {
    width: 100%;
    height: 400px;
    object-fit: cover;
    background-color: #ddd;
}

.movie-info {
    padding: 1.5rem;
}

.movie-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #333;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #f39c12;
    font-weight: bold;
}

.star {
    font-size: 1.1rem;
}

.movie-type {
    background-color: #e0e0e0;
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.movie-desc {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: #666;
}

/* 加载更多按钮 */
.load-more-container {
    text-align: center;
    margin-top: 2rem;
}

.load-more-btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.load-more-btn:hover {
    transform: translateY(-2px);
}

/* 尾部样式 */
.footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 900px;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {opacity: 0; transform: translateY(-50px);}
    to {opacity: 1; transform: translateY(0);}
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    padding: 1rem;
    cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.movie-details {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    padding: 1rem 2rem 2rem 2rem;
}

.modal-poster img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.modal-info h2 {
    margin-bottom: 1rem;
    color: #333;
}

.modal-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.modal-rating {
    color: #f39c12;
    font-weight: bold;
}

.modal-type, .modal-year {
    background-color: #e0e0e0;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
}

.modal-details p {
    margin-bottom: 0.5rem;
    color: #555;
}

.modal-description {
    margin-top: 1.5rem;
    color: #666;
    line-height: 1.6;
}

/* 弹窗分享区域 */
.modal-share {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.modal-share h3 {
    margin-bottom: 1rem;
    color: #333;
}

.share-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-wechat {
    background-color: #7bb32e;
    color: white;
}

.share-wechat:hover {
    background-color: #6a9a25;
}

.share-weibo {
    background-color: #e6162d;
    color: white;
}

.share-weibo:hover {
    background-color: #c51426;
}

.share-qq {
    background-color: #12b7f5;
    color: white;
}

.share-qq:hover {
    background-color: #0fa3d8;
}

.share-link {
    background-color: #667eea;
    color: white;
}

.share-link:hover {
    background-color: #5568d3;
}

/* 提示框样式 */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast i {
    color: #4CAF50;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .logo {
        font-size: 2rem;
    }
    
    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .movie-details {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .modal-meta {
        justify-content: center;
    }
    
    .modal-poster {
        max-width: 300px;
        margin: 0 auto;
    }
    
    .share-buttons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .search-filter-bar {
        gap: 1rem;
    }
    
    .search-box {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .filter-bar {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .share-btn {
        justify-content: center;
    }
}