/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Roboto', 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0d0e12 0%, #1a1b23 50%, #0d0e12 100%);
    min-height: 100vh;
    color: #e0e0e0;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(118, 75, 162, 0.15) 0%, transparent 50%);
    z-index: 0;
    pointer-events: none;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    position: relative;
    z-index: 1;
}

/* Banner样式 */
.banner {
    width: 100%;
    height: 240px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.banner:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 25px 70px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

/* Banner视频容器 */
.banner-video-container {
    position: relative;
    overflow: hidden;
}

/* Banner视频 */
.banner-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* Banner标题层 */
.banner-title {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.3) 100%
    );
    backdrop-filter: blur(1px);
}

.banner-title h1 {
    color: white;
    font-size: 48px;
    font-weight: 700;
    text-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.8),
        0 2px 10px rgba(0, 0, 0, 0.6);
    margin: 0;
    letter-spacing: 2px;
    text-align: center;
}

/* 卡片样式 */
.card {
    background: rgba(30, 32, 40, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    margin: 20px auto;
    max-width: 500px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 25px 70px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.card-large {
    max-width: 900px;
    padding: 50px;
    background: rgba(30, 32, 40, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-large:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 25px 70px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

/* 标题 */
h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #e0e0e0;
    text-align: center;
}

h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #e0e0e0;
}

/* 表单样式 */
.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #d0d0d0;
    font-size: 14px;
}

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
    background: rgba(20, 22, 28, 0.6);
    color: #e0e0e0;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(25, 27, 35, 0.8);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
    color: #e0e0e0;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
textarea::placeholder {
    color: #888;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* 按钮样式 */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: linear-gradient(135deg, #a0a0a0 0%, #808080 100%);
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

/* 文件上传区域 */
.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 35px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(20, 22, 28, 0.6) 0%, rgba(25, 27, 35, 0.6) 100%);
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.upload-area:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(30, 35, 50, 0.8) 0%, rgba(35, 40, 55, 0.8) 100%);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(40, 45, 60, 0.9) 0%, rgba(45, 50, 65, 0.9) 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.upload-area input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    box-shadow: 
        0 8px 24px rgba(102, 126, 234, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
}

.upload-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    transition: all 0.5s;
}

.upload-area:hover .upload-icon {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.upload-area:hover .upload-icon::before {
    animation: shine 1.5s infinite;
}

@keyframes shine {
    0% {
        left: -50%;
    }
    100% {
        left: 150%;
    }
}

.upload-icon.reference {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.upload-icon.element {
    background: linear-gradient(135deg, #f093fb 0%, #764ba2 100%);
}

.upload-text {
    color: #b0b0b0;
    font-size: 14px;
}

.upload-text strong {
    color: #667eea;
}

.required {
    color: #e74c3c;
}

/* 图片预览 */
.image-preview {
    margin-top: 12px;
    display: none;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-preview.show {
    display: block;
}

/* 选项卡 */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 35px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 0;
}

.tab {
    padding: 14px 28px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #b0b0b0;
    transition: all 0.3s ease;
    font-family: inherit;
    position: relative;
    margin-bottom: -2px;
}

.tab:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.15);
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 8px 8px 0 0;
}

/* 加载状态 */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.show {
    display: block;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #b0b0b0;
    font-size: 14px;
}

/* 消息提示 */
.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.message.show {
    display: block;
}

.message.success {
    background: rgba(40, 167, 69, 0.2);
    color: #4ade80;
    border: 1px solid rgba(40, 167, 69, 0.4);
}

.message.error {
    background: rgba(220, 53, 69, 0.2);
    color: #f87171;
    border: 1px solid rgba(220, 53, 69, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .card {
        padding: 24px;
        margin: 10px;
    }
    
    .card-large {
        padding: 24px;
    }
    
    .banner {
        height: 180px;
        margin-bottom: 25px;
    }
    
    .card-large {
        padding: 30px 20px;
    }
    
    .banner-title h1 {
        font-size: 32px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .tabs {
        flex-direction: column;
        gap: 0;
    }
    
    .tab {
        text-align: left;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        border-left: 3px solid transparent;
    }
    
    .tab.active {
        border-left-color: #667eea;
        border-bottom-color: rgba(255, 255, 255, 0.15);
    }
}

/* 元素图容器 */
.element-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
}

/* 多文件预览容器 */
.element-images-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.element-image-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    background: rgba(20, 22, 28, 0.6);
}

.element-image-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.element-image-item .image-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.element-image-item .image-remove:hover {
    background: rgba(231, 76, 60, 1);
    transform: scale(1.1);
}

.element-image-item .image-name {
    padding: 6px 8px;
    font-size: 12px;
    color: #b0b0b0;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .element-images {
        grid-template-columns: 1fr;
    }
    
    .element-images-preview {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 右侧滑出面板 */
.result-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: rgba(30, 32, 40, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: right 0.3s ease-in-out;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.result-panel.open {
    right: 0;
}

.result-panel-header {
    padding: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.result-panel-header h2 {
    margin: 0;
    font-size: 20px;
    color: white;
}

.result-panel-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.result-panel-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.result-panel-content {
    padding: 20px;
    flex: 1;
}

.result-item {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(20, 22, 28, 0.6);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s;
}

.result-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    background: rgba(25, 27, 35, 0.8);
}

.result-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    color: #b0b0b0;
}

.result-item-time {
    color: #888;
}

.result-image {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.result-video {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 12px;
}

.result-actions {
    display: flex;
    gap: 8px;
}

.result-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.result-btn-download {
    background: #667eea;
    color: white;
}

.result-btn-download:hover {
    background: #5568d3;
}

.result-btn-delete {
    background: rgba(255, 255, 255, 0.15);
    color: #b0b0b0;
}

.result-btn-delete:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #e0e0e0;
}

.result-empty {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.result-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* 打开面板按钮 */
.open-panel-btn {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    z-index: 999;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.open-panel-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.open-panel-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 遮罩层 */
.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.panel-overlay.show {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .result-panel {
        width: 100%;
        right: -100%;
    }
    
    .open-panel-btn {
        right: 10px;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
}
