/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 封面页样式 */
.cover-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
    background-color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.cover-image {
    margin-bottom: 20px;
    width: 100%;
    max-width: 300px;
}

.cover-image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.cover-content h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.cover-content p {
    font-size: 1rem;
    margin-bottom: 30px;
    color: #666;
    max-width: 500px;
}

.watch-btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #e74c3c;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.watch-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* 播放器页面样式 */
.player-container {
    max-width: 100%;
    margin: 0 auto;
    background-color: #fff;
    min-height: 100vh;
}

/* 视频播放区域 */
.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 宽高比 */
    background-color: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* 控制行 */
.control-row {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    /* 强制不换行，确保4个控件在同一行 */
    flex-wrap: nowrap;
    gap: 8px;
    /* 允许控件缩小 */
    flex-shrink: 1;
    /* 添加溢出处理 */
    overflow-x: auto;
    /* 隐藏滚动条但保持滚动功能 */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* 隐藏滚动条 */
.control-row::-webkit-scrollbar {
    display: none;
}

/* 控制按钮样式调整 */
.control-btn {
    /* 允许按钮缩小 */
    flex-shrink: 1;
    /* 设置最小宽度 */
    min-width: 60px;
    /* 调整内边距 */
    padding: 6px 10px;
    /* 调整字体大小 */
    font-size: 0.8rem;
}

/* 作者头像样式调整 */
.author-avatar {
    /* 确保头像不缩小太多 */
    flex-shrink: 0;
    /* 调整大小 */
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e74c3c;
    transition: all 0.3s ease;
}

.author-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.control-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background-color: #e74c3c;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 80px;
}

.control-btn:hover:not(.disabled) {
    background-color: #c0392b;
    transform: translateY(-2px);
}

.control-btn.disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 剧集信息 */
.episode-info {
    padding: 20px;
}

.episode-info h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.episode-description {
    font-size: 1rem;
    margin-bottom: 20px;
    color: #666;
    line-height: 1.8;
    text-align: justify;
}

.episode-image {
    margin-top: 20px;
    width: 100%;
    max-width: 500px;
    margin: 20px auto;
    text-align: center;
}

.episode-image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 模态弹窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

/* 分享内容样式 */
.share-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
}

/* 海报容器样式 */
.poster-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
    max-width: 100%;
    overflow: hidden;
}

.poster-container img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
    /* 确保海报不会超出弹窗 */
    max-height: 60vh;
    object-fit: contain;
}

/* 海报操作按钮样式 */
.poster-actions {
    display: flex;
    gap: 10px;
}

.poster-actions button {
    padding: 10px 20px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-weight: bold;
}

.poster-actions button:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 二维码容器样式（保留用于向后兼容） */
.qrcode-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.qrcode-container img {
    width: 200px;
    height: 200px;
    border: 1px solid #eee;
    border-radius: 5px;
}

/* 分享信息样式 */
.share-info {
    text-align: center;
    width: 100%;
}

.share-info p {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 15px;
}

/* 分享链接样式 */
.share-url {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.share-url label {
    font-weight: bold;
    color: #555;
    text-align: left;
}

.share-url input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    width: 100%;
    background-color: #f8f9fa;
}

.share-url button {
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.share-url button:hover {
    background-color: #2980b9;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .qrcode-container img {
        width: 150px;
        height: 150px;
    }
    
    .share-info p {
        font-size: 1rem;
    }
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* 封面信息样式 */
.cover-info {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.cover-info h3 {
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 1.3rem;
}

.cover-info .cover-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* 剧集列表 */
.episode-list {
    margin-top: 15px;
}

.episode-item {
    display: block;
    padding: 15px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border-left: 4px solid #e9ecef;
}

.episode-item:hover {
    background-color: #e9ecef;
    transform: translateX(5px);
    border-left-color: #e74c3c;
}

.episode-item.active {
    background-color: #e74c3c;
    color: white;
    border-left-color: #c0392b;
}

/* 管理员登录表单 */
#adminLoginForm {
    margin-top: 20px;
}

#adminLoginForm input[type="password"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

#adminLoginForm button {
    width: 100%;
    padding: 12px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#adminLoginForm button:hover {
    background-color: #c0392b;
}

/* 管理员界面样式 */
.admin-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
    min-height: 100vh;
}

.admin-container h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2rem;
}

.admin-section {
    background-color: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.admin-section h2 {
    color: #34495e;
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 10px;
}

/* 表单样式 */
.admin-form,
.episode-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: bold;
    color: #555;
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: Arial, sans-serif;
    resize: vertical;
    min-height: 50px;
}

.form-group textarea {
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* 上传容器样式 */
.upload-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-height: 120px;
    position: relative;
}

.upload-container img {
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-height: 80px;
    min-width: 80px;
    object-fit: cover;
}

/* 修复滚动条跳动 */
body {
    overflow-y: scroll;
}

/* 确保模态框内容不会导致页面滚动 */
.modal {
    overflow-y: auto;
}

.upload-container img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.upload-container input[type="file"] {
    display: none;
}

/* 上传按钮样式 */
.upload-btn {
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 100px;
}

.upload-btn:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 按钮样式 */
.save-btn {
    padding: 10px 20px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.save-btn:hover {
    background-color: #229954;
}

.delete-btn {
    padding: 10px 20px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background-color: #c0392b;
}

.cancel-btn {
    padding: 10px 20px;
    background-color: #95a5a6;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background-color: #7f8c8d;
}

.back-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.back-btn:hover {
    background-color: #2980b9;
}

/* 剧集卡片网格 */
.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.episode-card {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.episode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.episode-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 10px;
}

/* 新增卡片 */
.add-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border: 2px dashed #ddd;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-card:hover {
    background-color: #e9ecef;
    border-color: #e74c3c;
    transform: translateY(-5px);
}

.add-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #e74c3c;
    color: white;
    border: none;
    font-size: 3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.add-btn:hover {
    background-color: #c0392b;
    transform: scale(1.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .cover-content h1 {
        font-size: 1.5rem;
    }
    
    .cover-content p {
        font-size: 0.9rem;
    }
    
    .watch-btn {
        font-size: 1rem;
        padding: 10px 20px;
    }
    
    .control-row {
        gap: 8px;
        padding: 10px;
    }
    
    .control-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        min-width: 70px;
    }
    
    .author-avatar {
        width: 40px;
        height: 40px;
    }
    
    .episode-info {
        padding: 15px;
    }
    
    .episode-info h2 {
        font-size: 1.2rem;
    }
    
    .episode-description {
        font-size: 0.9rem;
    }
    
    .admin-container {
        padding: 10px;
    }
    
    .admin-container h1 {
        font-size: 1.5rem;
    }
    
    .episodes-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .control-row {
        flex-direction: row;
        gap: 6px;
        overflow-x: auto;
    }
    
    .control-btn {
        width: auto;
        max-width: none;
        min-width: 55px;
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    
    .modal-content {
        margin: 5% auto;
        padding: 15px;
        width: 95%;
    }
}