/* ============== v2 亚马逊主图·附图·A+ 可视化样式 ============== */

.amzia-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #1f2937;
    line-height: 1.6;
}

/* ============ 顶部品牌头 ============ */
.amzia-header {
    background: linear-gradient(135deg, #1e40af 0%, #7c3aed 100%);
    color: #fff;
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.25);
}
.amzia-logo { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.amzia-logo-icon { font-size: 42px; line-height: 1; }
.amzia-header h1 { margin: 0 0 4px; font-size: 22px; font-weight: 700; color: #fff; }
.amzia-header p { margin: 0; font-size: 13px; color: rgba(255, 255, 255, 0.85); }
.amzia-header-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.amzia-badge {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* ============ 阶段容器 ============ */
.amzia-phase {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
}

/* ============ 步骤标题 ============ */
.amzia-label-large {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    color: #1e40af;
    margin: 22px 0 12px;
    gap: 8px;
}
.amzia-label-large:first-child { margin-top: 0; }
.amzia-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e40af, #7c3aed);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}
.amzia-label-hint {
    font-size: 12px;
    color: #6b7280;
    font-weight: 400;
    margin-left: 6px;
}

/* ============ 必选区域高亮 ============ */
.amzia-section-required {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e2 100%);
    border: 2px solid #fbbf24;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 22px;
}

/* ============ 表单控件 ============ */
.amzia-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.amzia-form-col { display: flex; flex-direction: column; }
.amzia-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.amzia-required { color: #ef4444; }

.amzia-input,
.amzia-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    background: #fafbfc;
    transition: border-color 0.2s, background 0.2s;
}
.amzia-input:focus,
.amzia-textarea:focus {
    outline: none;
    border-color: #7c3aed;
    background: #fff;
}
.amzia-textarea { resize: vertical; min-height: 130px; margin-bottom: 16px; }

/* ============ 上传区 ============ */
.amzia-upload-box {
    border: 2px dashed #fbbf24;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.amzia-upload-box:hover { border-color: #d97706; background: rgba(255, 255, 255, 0.95); }
.amzia-upload-prompt { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #6b7280; }
.amzia-upload-icon { font-size: 36px; }
.amzia-upload-title { font-size: 15px; font-weight: 600; color: #374151; }
.amzia-upload-sub { font-size: 12px; color: #9ca3af; }

.amzia-file-list {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}
.amzia-file-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
    border: 2px solid #86efac;
}
.amzia-file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.amzia-file-thumb-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.9);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}
.amzia-file-thumb-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: #fff;
    font-size: 11px;
    padding: 12px 6px 4px;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.amzia-file-thumb-uploading {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e40af;
    font-size: 12px;
    font-weight: 600;
}

/* ============ 选项 ============ */
.amzia-options {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 16px 0 20px;
    padding: 14px 16px;
    background: #f9fafb;
    border-radius: 10px;
    font-size: 13px;
}
.amzia-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #374151;
}

/* ============ 主按钮 ============ */
.amzia-btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 15px 24px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.amzia-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4); }
.amzia-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.amzia-btn-primary-sm {
    background: linear-gradient(135deg, #1e40af, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.amzia-tip { text-align: center; color: #6b7280; font-size: 12px; margin-top: 10px; }

/* ============ 进度条 ============ */
.amzia-progress-wrap { padding: 20px 0; }
.amzia-progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
}
.amzia-progress-label { color: #1e40af; font-weight: 600; }
.amzia-progress-pct { color: #7c3aed; font-weight: 700; font-size: 16px; }
.amzia-progress-bar {
    height: 14px;
    background: #f1f5f9;
    border-radius: 7px;
    overflow: hidden;
    margin-bottom: 18px;
}
.amzia-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 7px;
    transition: width 1.2s ease;
    width: 0%;
}
.amzia-progress-steps {
    background: #f9fafb;
    border-radius: 10px;
    padding: 14px;
    max-height: 280px;
    overflow-y: auto;
    font-size: 13px;
}
.amzia-progress-step {
    padding: 6px 0;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
}
.amzia-progress-step.done { color: #059669; }
.amzia-progress-step.active { color: #1e40af; font-weight: 600; }
.amzia-progress-step-icon { font-size: 14px; min-width: 16px; }

/* ============ 结果区 ============ */
.amzia-results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
    gap: 16px;
}
.amzia-results-header h2 { margin: 0 0 4px; font-size: 18px; color: #1f2937; }
.amzia-results-summary { margin: 0; font-size: 13px; color: #6b7280; max-width: 700px; }
.amzia-results-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.amzia-btn-outline {
    background: #fff;
    color: #1e40af;
    border: 1.5px solid #c7d2fe;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.amzia-btn-outline:hover {
    background: #eef2ff;
    border-color: #7c3aed;
    color: #7c3aed;
}

/* ============ Tab 切换 ============ */
.amzia-tabs {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
}
.amzia-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 16px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}
.amzia-tab:hover { color: #1e40af; }
.amzia-tab-active {
    background: #fff;
    color: #1e40af;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.amzia-tab-content { display: none; }
.amzia-tab-content-active { display: block; }

/* ============ 卡片网格 ============ */
.amzia-grid { display: grid; gap: 18px; }
.amzia-grid-1 { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
.amzia-grid-3 { grid-template-columns: repeat(3, 1fr); }
.amzia-grid-aplus { grid-template-columns: repeat(2, 1fr); }

/* ============ 通用卡片 ============ */
.amzia-card {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}
.amzia-card:hover {
    transform: translateY(-2px);
    border-color: #c7d2fe;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.12);
}

.amzia-card-header {
    padding: 12px 14px;
    background: linear-gradient(135deg, #f5f3ff, #eef2ff);
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.amzia-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e40af;
    display: flex;
    align-items: center;
    gap: 6px;
}
.amzia-card-num {
    background: linear-gradient(135deg, #1e40af, #7c3aed);
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.amzia-card-actions { display: flex; gap: 4px; }
.amzia-card-action-btn {
    background: transparent;
    border: 1px solid #c7d2fe;
    color: #1e40af;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
}
.amzia-card-action-btn:hover { background: #eef2ff; border-color: #7c3aed; color: #7c3aed; }
.amzia-card-action-btn:disabled { opacity: 0.5; cursor: wait; }

/* ============ 卡片图片预览（含文案叠加层） ============ */
.amzia-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #f8fafc;
    overflow: hidden;
}
.amzia-grid-aplus .amzia-preview { aspect-ratio: 970 / 600; }
.amzia-grid-1 .amzia-preview { aspect-ratio: 1; }

.amzia-preview-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #fff;
}

/* 文案叠加点位 */
.amzia-overlay {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    max-width: 50%;
}
.amzia-overlay-primary {
    color: #fff;
    background: rgba(30, 64, 175, 0.92);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.amzia-overlay-secondary {
    color: #fff;
    background: rgba(124, 58, 237, 0.88);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
}
.amzia-overlay-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

/* 位置类 */
.amzia-pos-top-left     { top: 8px; left: 8px; }
.amzia-pos-top-right    { top: 8px; right: 8px; }
.amzia-pos-bottom-left  { bottom: 8px; left: 8px; }
.amzia-pos-bottom-right { bottom: 8px; right: 8px; }
.amzia-pos-center-top   { top: 8px; left: 50%; transform: translateX(-50%); }
.amzia-pos-center-bottom{ bottom: 8px; left: 50%; transform: translateX(-50%); }

/* ============ 卡片正文 ============ */
.amzia-card-body {
    padding: 12px 14px;
    font-size: 12px;
    color: #374151;
    line-height: 1.55;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.amzia-card-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.amzia-card-field-label {
    font-size: 10px;
    font-weight: 700;
    color: #7c3aed;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.amzia-card-field-value {
    color: #374151;
    font-size: 12px;
    word-break: break-word;
}
.amzia-card-field-value.amzia-mono {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    background: #f8fafc;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 11px;
    border: 1px solid #e5e7eb;
}

.amzia-card-headline {
    font-size: 14px;
    font-weight: 700;
    color: #1e40af;
}
.amzia-card-subheadline {
    font-size: 12px;
    color: #7c3aed;
    font-weight: 500;
}
.amzia-card-body-text {
    font-size: 12px;
    color: #4b5563;
    line-height: 1.6;
}

/* ============ 卡片占位图（无生图时） ============ */
.amzia-no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
    font-size: 12px;
    background: repeating-linear-gradient(
        45deg,
        #f8fafc,
        #f8fafc 10px,
        #f1f5f9 10px,
        #f1f5f9 20px
    );
}
.amzia-no-image-icon { font-size: 32px; margin-bottom: 6px; }

/* ============ 编辑弹窗 ============ */
.amzia-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.amzia-modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
}
.amzia-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 720px;
    width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.amzia-modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.amzia-modal-header h3 { margin: 0; font-size: 16px; color: #1e40af; }
.amzia-modal-close {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: all 0.15s;
}
.amzia-modal-close:hover { background: #f1f5f9; color: #1f2937; }

.amzia-modal-body {
    padding: 22px;
    overflow-y: auto;
    flex: 1;
}
.amzia-modal-body label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    margin: 14px 0 6px;
}
.amzia-modal-body label:first-child { margin-top: 0; }
.amzia-modal-body input[type="text"],
.amzia-modal-body textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
}
.amzia-modal-body textarea {
    resize: vertical;
    min-height: 70px;
}
.amzia-modal-body input:focus,
.amzia-modal-body textarea:focus {
    outline: none;
    border-color: #7c3aed;
}

.amzia-modal-overlay-list {
    border: 1px dashed #c7d2fe;
    border-radius: 8px;
    padding: 10px;
    background: #fafbfc;
}
.amzia-overlay-row {
    display: grid;
    grid-template-columns: 130px 80px 1fr auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.amzia-overlay-row:last-child { margin-bottom: 0; }
.amzia-overlay-row select,
.amzia-overlay-row input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
}
.amzia-overlay-del {
    background: transparent;
    border: 1px solid #fca5a5;
    color: #dc2626;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
}
.amzia-overlay-add {
    background: #eef2ff;
    border: 1px dashed #7c3aed;
    color: #7c3aed;
    border-radius: 6px;
    padding: 7px 12px;
    width: 100%;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}

.amzia-modal-footer {
    padding: 14px 22px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ============ 卡片 loading 蒙版 ============ */
.amzia-card-loading {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    color: #1e40af;
    font-size: 13px;
    font-weight: 600;
    gap: 10px;
}
.amzia-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e7ff;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: amzia-spin 0.8s linear infinite;
}
@keyframes amzia-spin { to { transform: rotate(360deg); } }

/* ============ 错误提示 ============ */
.amzia-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 16px;
    font-size: 14px;
}

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
    .amzia-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .amzia-container { padding: 12px; }
    .amzia-header { padding: 20px; }
    .amzia-header h1 { font-size: 18px; }
    .amzia-form-grid { grid-template-columns: 1fr; }
    .amzia-results-header { flex-direction: column; align-items: flex-start; }
    .amzia-results-actions { width: 100%; flex-wrap: wrap; }
    .amzia-btn-outline { flex: 1; text-align: center; }
    .amzia-options { flex-direction: column; gap: 8px; }
    .amzia-grid-3,
    .amzia-grid-aplus { grid-template-columns: 1fr; }
    .amzia-overlay-row { grid-template-columns: 1fr 1fr; }
    .amzia-modal-content { max-height: 95vh; }
    .amzia-modal-body { padding: 16px; }
    .amzia-tab { font-size: 12px; padding: 8px 6px; }
}
