/**
 * 微草数据集工具 - 前台样式
 */

.dt-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px;
}

.dt-header {
    text-align: center;
    margin-bottom: 28px;
}

.dt-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dt-title-icon {
    font-size: 24px;
}

.dt-subtitle {
    font-size: 13px;
    color: var(--muted-2-color, #999);
    margin: 0;
}

/* ====== 预览 ====== */

.dt-preview {
    text-align: center;
    margin-bottom: 20px;
}

.dt-preview-box {
    display: inline-block;
    max-width: 100%;
    max-height: 360px;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid var(--muted-border-color, rgba(0,0,0,0.06));
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.dt-preview-img {
    display: block;
    max-width: 100%;
    max-height: 360px;
    object-fit: contain;
}

/* ====== 上传区 ====== */

.dt-upload-area {
    margin-bottom: 20px;
}

.dt-dropzone {
    border: 2px dashed #18a058;
    border-radius: 4px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.dt-dropzone:hover,
.dt-dropzone.dt-dragover {
    border-color: var(--focus-color, #18a058);
    background: rgba(24, 160, 88, 0.04);
}

.dt-upload-icon {
    color: var(--muted-color, #777);
    margin-bottom: 12px;
}

.dt-drop-text {
    font-size: 15px;
    color: var(--text-color, #333);
    margin: 0 0 8px 0;
}

.dt-drop-text em {
    color: var(--focus-color, #18a058);
    font-style: normal;
    cursor: pointer;
}

.dt-drop-hint {
    font-size: 12px;
    color: var(--muted-2-color, #999);
    margin: 0;
}

/* ====== 加载 ====== */

.dt-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    color: var(--muted-2-color, #999);
    font-size: 14px;
}

.dt-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--muted-border-color, rgba(0,0,0,0.1));
    border-top-color: var(--focus-color, #18a058);
    border-radius: 50%;
    animation: dt-spin 0.8s linear infinite;
}

@keyframes dt-spin {
    to { transform: rotate(360deg); }
}

/* ====== 结果 ====== */

.dt-result-card {
    background: var(--main-bg-color, #fff);
    border-radius: 4px;
    border: 2px solid #eaeaec;
    overflow: hidden;
}

.dt-section {
    padding: 16px 20px;
    border-bottom: 1px solid var(--muted-border-color, rgba(0,0,0,0.04));
}

.dt-section:last-child {
    border-bottom: none;
}

.dt-section-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-color, #333);
}

.dt-param-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.dt-param-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--muted-border-color, rgba(0,0,0,0.03));
    vertical-align: top;
    word-break: break-word;
}

.dt-param-key {
    width: 120px;
    font-weight: 500;
    color: var(--muted-color, #555);
    white-space: nowrap;
}

.dt-prompt-cell {
    font-family: 'Maple Mono CN', 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.dt-tool-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background: var(--focus-color, #18a058);
}

.dt-text-pre,
.dt-json-pre {
    font-family: 'Maple Mono CN', 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 400px;
    overflow: auto;
    margin: 0;
    padding: 12px;
    background: rgba(0,0,0,0.02);
    border-radius: 6px;
    border: 1px solid var(--muted-border-color, rgba(0,0,0,0.04));
}

.dt-comfy-info {
    font-size: 13px;
    color: var(--muted-color, #555);
    margin-bottom: 8px;
}

.dt-details {
    margin-top: 8px;
}

.dt-details summary {
    cursor: pointer;
    font-size: 13px;
    color: var(--focus-color, #18a058);
    padding: 4px 0;
}

.dt-no-meta {
    text-align: center;
    color: var(--muted-2-color, #999);
    font-size: 14px;
    margin: 12px 0 4px 0;
}

.dt-no-meta-hint {
    text-align: center;
    color: var(--muted-3-color, #b1b1b1);
    font-size: 12px;
    margin: 0;
}

.dt-error {
    color: #f53f3f;
    font-size: 14px;
    text-align: center;
}

.dt-copy-row {
    padding: 12px 20px;
    text-align: right;
}

.dt-copy-btn {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid var(--muted-border-color, rgba(0,0,0,0.12));
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: var(--muted-color, #555);
    transition: all 0.2s;
}

.dt-copy-btn:hover {
    border-color: var(--focus-color, #18a058);
    color: var(--focus-color, #18a058);
}

/* ====== 底部 ====== */

.dt-footer {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid var(--muted-border-color, rgba(0,0,0,0.03));
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 16px;
}

.dt-footer-version {
    font-size: 12px;
    color: var(--muted-3-color, #b1b1b1);
    margin: 0;
    font-weight: 500;
}

.dt-footer-note {
    font-size: 12px;
    color: var(--muted-2-color, #999);
    margin: 0;
}

.dt-footer-credit {
    font-size: 12px;
    color: var(--muted-3-color, #b1b1b1);
    margin: 0;
}

.dt-footer-credit a {
    color: var(--muted-color, #777);
    text-decoration: none;
    transition: color 0.2s;
}

.dt-footer-credit a:hover {
    color: var(--focus-color, #f04494);
}

/* ====== 重新选择按钮 ====== */
.dt-reset-btn {
    display: block !important;
    margin: 20px auto 0 !important;
    padding: 12px 36px !important;
    border: 2px solid #18a058 !important;
    border-radius: 4px !important;
    background: transparent !important;
    cursor: pointer !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #18a058 !important;
    transition: all 0.2s;
}
.dt-reset-btn:hover {
    background: #18a058 !important;
    color: #fff !important;
    border-color: #18a058 !important;
}

/* ====== 响应式 ====== */

@media (max-width: 640px) {
    .dt-container {
        padding: 20px 12px;
    }
    .dt-title {
        font-size: 18px;
    }
    .dt-param-key {
        width: 80px;
        font-size: 12px;
    }
    .dt-dropzone {
        padding: 28px 16px;
    }
}