/* 前端整体布局 */
.dmx-gpt-studio-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dmx-gpt-studio-left {
    flex: 0 0 320px;
    max-width: 360px;
    min-width: 260px;
}

.dmx-gpt-studio-right {
    flex: 1 1 0;
    min-width: 320px;
}

/* 卡片面板 */
.dmx-panel {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    margin-bottom: 16px;
}

.dmx-panel h3 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

/* 上传区域 */
.dmx-upload-area {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 24px 12px;
    text-align: center;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dmx-upload-area:hover,
.dmx-upload-area.dmx-dragover {
    border-color: #6366f1;
    background: #eef2ff;
}

.dmx-upload-icon {
    font-size: 30px;
    margin: 0 0 8px;
}

.dmx-upload-text {
    font-size: 13px;
    color: #4b5563;
    margin: 0;
}

.dmx-upload-text span {
    color: #9ca3af;
    font-size: 12px;
}

.dmx-upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* 上传预览 */
.dmx-upload-preview {
    margin-top: 12px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

#dmx-gpt-preview-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* 文本区域 */
#dmx-gpt-prompt {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    padding: 10px 12px;
    font-size: 13px;
    resize: vertical;
    min-height: 90px;
    box-sizing: border-box;
}

#dmx-gpt-prompt:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 1px #6366f1;
}

/* 快速提示 */
.dmx-quick-prompts {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.dmx-quick-prompts span {
    font-size: 12px;
    color: #6b7280;
    margin-right: 4px;
}

.dmx-quick-prompt-btn {
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 11px;
    padding: 4px 10px;
    cursor: pointer;
    color: #374151;
    transition: all 0.15s ease;
}

.dmx-quick-prompt-btn:hover {
    background: #eef2ff;
    border-color: #6366f1;
    color: #111827;
}

/* 控件区域 */
.dmx-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    margin-top: 12px;
    font-size: 12px;
    color: #4b5563;
}

.dmx-controls label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dmx-controls select {
    border-radius: 999px;
    border: 1px solid #d1d5db;
    padding: 4px 24px 4px 10px;
    font-size: 12px;
    background: #ffffff;
}

/* 按钮 */
.dmx-btn-generate {
    margin-top: 14px;
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.25);
    transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease;
}

.dmx-btn-generate:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.dmx-btn-generate:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    box-shadow: none;
}

/* 小提示 */
.dmx-gpt-studio-tip {
    margin-top: 8px;
    font-size: 11px;
    color: #6b7280;
}

/* 结果区域 */
.dmx-panel-results {
    min-height: 320px;
}

.dmx-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.dmx-results-header h3 {
    margin: 0;
}

.dmx-results-model {
    font-size: 11px;
    color: #6b7280;
}

.dmx-results-body {
    position: relative;
    min-height: 260px;
    border-radius: 10px;
    border: 1px dashed #e5e7eb;
    background: #f9fafb;
    padding: 14px;
    box-sizing: border-box;
}

.dmx-results-empty {
    text-align: center;
    color: #6b7280;
    padding-top: 60px;
}

.dmx-results-icon {
    font-size: 30px;
    margin-bottom: 6px;
}

.dmx-results-sub {
    font-size: 12px;
    color: #9ca3af;
}

/* 结果图片网格 */
.dmx-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.dmx-result-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #111827;
}

.dmx-result-item img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 260px;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.dmx-result-item:hover img {
    transform: scale(1.02);
}

.dmx-result-download {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.8);
    color: #e5e7eb;
    text-decoration: none;
    opacity: 0;
    transform: translateY(4px);
    transition: all 0.2s ease;
}

.dmx-result-item:hover .dmx-result-download {
    opacity: 1;
    transform: translateY(0);
}

/* 加载状态 */
.dmx-loading {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #4b5563;
}

.dmx-loading-spinner {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid #e5e7eb;
    border-top-color: #6366f1;
    animation: dmx-spin 0.6s linear infinite;
}

@keyframes dmx-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 通知 */
.dmx-gpt-studio-notice {
    padding: 10px 12px;
    background: #fef3c7;
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
    color: #92400e;
    font-size: 13px;
    margin-bottom: 12px;
}

/* 错误提示 */
.dmx-results-error {
    font-size: 13px;
    color: #b91c1c;
    background: #fef2f2;
    border-radius: 8px;
    padding: 8px 10px;
}

/* 自适应 */
@media (max-width: 960px) {
    .dmx-gpt-studio-wrapper {
        flex-direction: column;
    }

    .dmx-gpt-studio-left,
    .dmx-gpt-studio-right {
        max-width: 100%;
    }
}
