* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0a0a15 0%, #1a1a2e 50%, #0f2027 100%);
    min-height: 100vh;
    color: #fff;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.8rem;
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(30deg); }
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.main-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 30px;
}

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2rem;
    }
}

/* 输入区域 */
.input-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    color: #e0e0e0;
    font-size: 14px;
}

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 15px;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.2);
    background: rgba(0, 0, 0, 0.6);
}

textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

/* 图片上传区域 */
.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
}

.upload-area:hover {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.upload-area.dragover {
    border-color: #48dbfb;
    background: rgba(72, 219, 251, 0.1);
    transform: scale(1.02);
}

.upload-area.has-image {
    border-color: #2ed573;
    border-style: solid;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.7;
}

.upload-text {
    color: #888;
    font-size: 14px;
    margin-bottom: 10px;
}

.upload-hint {
    color: #555;
    font-size: 12px;
}

.upload-input {
    display: none;
}

/* 预览图片 */
.preview-container {
    position: relative;
    display: none;
    margin-top: 15px;
}

.preview-container.show {
    display: block;
}

.preview-image {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
}

.preview-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 71, 87, 0.9);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.preview-remove:hover {
    background: #ff4757;
    transform: scale(1.1);
}

.preview-info {
    margin-top: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-size: 12px;
    color: #888;
}

/* 按钮 */
.btn {
    width: 100%;
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
    color: #fff;
    border: none;
    padding: 18px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 107, 107, 0.4);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 20px;
    font-size: 14px;
    text-transform: none;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

/* 输出区域 */
.output-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 600px;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: 15px;
}

.output-title {
    font-size: 1.5rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.status-badge.ready {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
}

.status-badge.processing {
    background: rgba(254, 202, 87, 0.2);
    color: #feca57;
}

/* 状态消息 */
#status {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 15px;
    display: none;
    align-items: center;
    gap: 12px;
}

#status.loading {
    display: flex;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(254, 202, 87, 0.15));
    border: 1px solid rgba(255, 107, 107, 0.3);
}

#status.error {
    display: flex;
    background: rgba(255, 71, 87, 0.15);
    border: 1px solid rgba(255, 71, 87, 0.3);
}

#status.success {
    display: flex;
    background: rgba(46, 213, 115, 0.15);
    border: 1px solid rgba(46, 213, 115, 0.3);
}

/* 视频容器 */
.video-container {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-wrapper {
    position: relative;
    background: #000;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-wrapper video {
    width: 100%;
    max-height: 70vh;
    display: block;
}

.video-actions {
    padding: 20px;
    display: flex;
    gap: 12px;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    flex-wrap: wrap;
}

.video-actions button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-actions button:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: rgba(255, 107, 107, 0.5);
    transform: translateY(-2px);
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #444;
    text-align: center;
}

.empty-state-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 18px;
    margin-bottom: 10px;
}

.empty-state-hint {
    font-size: 14px;
    color: #333;
}

/* 加载动画 */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: #ff6b6b;
    animation: spin 1s ease-in-out infinite;
}

.large-spinner {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 进度条 */
.progress-container {
    width: 100%;
    max-width: 300px;
    margin-top: 20px;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #feca57);
    border-radius: 3px;
    width: 0%;
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
    color: #888;
}

/* 设置面板 */
.settings-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #888;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
}

.settings-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.advanced-settings {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.advanced-settings.show {
    display: block;
}

.advanced-settings .form-group {
    margin-bottom: 16px;
}

.advanced-settings .form-group:last-child {
    margin-bottom: 0;
}

.advanced-settings label {
    font-size: 13px;
    color: #888;
}

.advanced-settings input {
    padding: 12px;
    font-size: 13px;
}

/* 信息标签 */
.info-tag {
    display: inline-block;
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    margin-left: 8px;
}

.required-tag {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
}

/* 调试区域 */
.debug-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.debug-toggle {
    background: none;
    border: none;
    color: #444;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
}

.debug-toggle:hover {
    color: #666;
}

.debug-content {
    display: none;
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 12px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: #888;
}

.debug-content.show {
    display: block;
}

/* Toast 通知 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 107, 107, 0.95);
    color: #fff;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 10000;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 1.7s forwards;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

/* 历史记录 */
.history-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.history-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-videos {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.3);
}

.history-item-text {
    font-size: 13px;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-time {
    font-size: 11px;
    color: #555;
    margin-top: 4px;
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 提示框 */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}
