* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
}

.container {
    margin: 0 auto;
    padding: 5px;
}

.header {
    background: #fff;
    padding: 1px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav {
    margin-left: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 模块与表单 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow-y: auto; /* 启用模态覆盖层的滚动 */
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 500px;
    margin: 20px auto; /* 从50px减少到20px */
    border-radius: 8px;
    max-height: 95vh; /* 高度限制为视口高度的90% */
    overflow-y: auto; /* 启用模态内容内的滚动 */
    -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
    position: relative; /* 确保适当的堆叠上下文 */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 10px;
    background: #fff;
    border-radius: 8px;
}

.close-modal {
    margin-top: -5px;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

.form-group {
    margin: 0px 8px 5px 8px;
}

.form-group label {
    display: block;
    margin-bottom: 3px;
    font-weight: 500;
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#klingImagePreview img,
#klingTailImagePreview img {
    max-width: 100%;
    max-height: 200px;
    margin-top: 10px;
}

.form-group button {
    margin-right: 10px;
}

input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    background: #1890ff;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 6px; /* 按钮之间的间距 */
}

button:hover {
    background: #40a9ff;
}

.profile-list {
    margin: 5px 0px 5px 0px;
    background: #fff;
    border-radius: 8px;
}

.profile-task {
    padding: 0px 0px 5px 8px;
    display: flex;
    align-items: center; /* 垂直居中对齐 */
}

.profile-task label {
    white-space: nowrap; /* 防止文字换行 */
}

.profile-task input[type="checkbox"] {
    margin-left: 0px;
}

h2 {
    margin-right: 6px; /* 标题与按钮之间的间距 */
}

.profile-item {
    margin-left: 6px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
}

.pagination {
    display: flex;
    justify-content: center;
}

/* 视频卡片 */
.video-section {
    margin-top: 6px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 6px;
}

.video-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

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

.video-card img, .video-card video {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.video-info {
    padding: 0px;
}

.video-info h3 {
    margin: -5px 3px 0px 3px;
    font-size: 16px;
    color: #333;
    /* 添加以下属性来限制为一行 */
    white-space: nowrap;         /* 禁止文本换行 */
    overflow: hidden;            /* 隐藏超出部分 */
    text-overflow: ellipsis;     /* 显示省略号 */
}

.video-links {
    display: flex;
    gap: 0px;
    align-items: center; /* 垂直居中对齐 */
}

.watch-btn, .download-btn {
    margin: 2px 3px 0px 3px;
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
}

.watch-btn {
    background: #1890ff;
    color: white;
}

.download-btn {
    background: #52c41a;
    color: white;
}

.creation-time {
    font-size: 12px;
    color: #999;
    margin: 0px 3px 3px 3px;
}

/* 响应式布局优化 */
@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* 播放视频 */
.video-player-modal {
    width: 90% !important;
    max-width: 1000px !important;
    padding: 0 !important;
    background: #000 !important;
}

.video-container {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

#videoPlayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

/* 图生视频相关 */
#imagePreview {
    max-width: 300px;
    margin: 10px 0;
}

#imagePreview img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.profile-stats {
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.stat-item {
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
}

.load-bar {
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    margin-top: 5px;
}

.load-fill {
    height: 100%;
    background: #1890ff;
    border-radius: 2px;
    transition: width 0.3s ease;
}

textarea {
    width: 100%;
    min-height: 25px;
    padding-left: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

.prompt-options {
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.option-group {
    margin: 5px 9px;
    display: flex;
}

.option-group label {
    width: 139px;
    display: block;
    font-weight: bold;
    color: #333;
    white-space: nowrap; /* 防止文字换行 */
}

.prompt-select {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
}

.prompt-select:focus {
    border-color: #007bff;
    outline: none;
}