/* ========== 页面布局（合并自 ai-card-design.css） ========== */
.logo-page-layout {
    display: flex;
    gap: 28px;
}

/* ========== Design Panel (Left) ========== */
.design-panel {
    width: 340px;
    flex-shrink: 0;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 24px;
}

.design-panel-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-right: 4px;
}

    .design-panel-body::-webkit-scrollbar {
        width: 4px;
    }

    .design-panel-body::-webkit-scrollbar-thumb {
        background: #ddd;
        border-radius: 4px;
    }

/* Form Fields */
.form-group {
    margin-bottom: 42px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

    .form-label .required {
        color: #ef4444;
        font-size: 14px;
    }

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--color-text);
    outline: none;
    transition: border-color var(--transition-base);
    font-family: inherit;
}

    .form-input:focus {
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }

    .form-input::placeholder {
        color: var(--color-text-muted);
    }

/* Reference Image Upload */
.ref-section {
    margin-bottom: 22px;
}

.ref-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}

.upload-area {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.upload-area:hover {
    border-color: var(--color-primary);
    background: #faf9ff;
}

.upload-area svg {
    width: 32px;
    height: 32px;
    stroke: var(--color-text-muted);
    fill: none;
    stroke-width: 1.5;
    margin-bottom: 8px;
}

.upload-area p {
    font-size: 13px;
    color: var(--color-text-muted);
}

.upload-area span {
    color: var(--color-primary);
    font-weight: 500;
}

.upload-area.has-preview {
    padding: 0;
    border-style: solid;
    cursor: default;
    position: relative;
}

.upload-area.has-preview img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 160px;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.upload-area .clear-ref {
    display: none;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 24px;
    text-align: center;
    z-index: 2;
}

.upload-area.has-preview .clear-ref {
    display: block;
}

/* Start Design Button */
.start-design-btn {
    width: 100%;
    padding: 14px;
    margin-top: 20px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-base), transform var(--transition-base);
    font-family: inherit;
    flex-shrink: 0;
}

.start-design-btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

.start-design-btn:active {
    transform: translateY(0);
}

/* ========== Intro Area (Right) ========== */
.namecard-intro-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
}

.intro-header {
    text-align: center;
    margin-bottom: 48px;
}

.intro-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 12px 0;
    letter-spacing: 1px;
}

.intro-subtitle {
    font-size: 15px;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.6;
}

.intro-steps {
    display: flex;
    gap: 24px;
    width: auto;
    max-width: 1100px;
    align-items: center;
    position: relative;
}

.main-image-card {
    flex-shrink: 0;
    width: 450px;
    height: auto;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: relative;
}

.main-image-card img {
   width: 450px;
    height: 346px;
    object-fit: fill;
    background: #f8fafc;
}

.side-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 16px;
    flex: 1;
    width: 520px;
    height: 345px;
}

.side-image-card {
    width: 232px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgb(59 57 57 / 46%);
    position: relative;
}

.side-image-card img {
    width: 230px;
    height: 160px;
    object-fit: cover;
}

.arrow-icon {
    position: absolute;
    left: 290px;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    z-index: 10;
}

.arrow-icon svg {
    width: 20px;
    height: 20px;
    transform: translateX(2px);
}

/* ========== 移动端响应式 ========== */
@media (max-width: 639px) {
    .design-panel {
        width: 100%;
        padding: 28px 4px;
        max-height: none;
        position: static;
    }

    .design-panel-body {
        overflow-y: visible;
        min-height: auto;
        flex: none;
    }

    .namecard-intro-area {
        display: none;
        padding: 48px 2px;
    }
}

@media (min-width: 768px) {
    .upload-area {
        width: 280px;
    }
}

/* ========== AI商品促销主图 结果与对比区 ========== */
/* 下拉选择框 */
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--color-text);
    outline: none;
    transition: border-color var(--transition-base);
    font-family: inherit;
    background-color: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

    .form-select:focus {
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }

    .form-select:hover {
        border-color: var(--color-primary);
    }

/* 多行文本框 */
.fix-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--color-text);
    outline: none;
    transition: border-color var(--transition-base);
    font-family: inherit;
    resize: vertical;
    min-height: 140px;
    line-height: 1.5;
}

    .fix-textarea:focus {
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }

    .fix-textarea::placeholder {
        color: var(--color-text-muted);
    }

/* 示例按钮（浅灰色小按钮） */
.example-btn {
    margin-top: 8px;
    padding: 5px 14px;
    background: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: background var(--transition-base);
}

.example-btn:hover {
    background: #e4e4e4;
}

.banner-result-area {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    align-items: center;
    gap: 18px;
}

.banner-result-area.hidden {
    display: none;
}

/* hero图片容器与loading遮罩 */
.hero-img-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    line-height: 0;
    width: 100%;
    max-width: 820px;
    aspect-ratio: 16 / 9;
}

.hero-img-wrapper > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.hero-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

.hero-loading-overlay .loading-text {
    color: #fff;
    font-size: 15px;
    margin-bottom: 18px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.hero-loading-overlay .loading-bar {
    width: 65%;
    max-width: 320px;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    overflow: hidden;
}

.hero-loading-overlay .loading-bar-fill {
    height: 100%;
    background: #fff;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* 生成结果图容器（效果图尺寸 1983x793 ≈ 2.5:1） */
.banner-result-img-wrapper {
    position: relative;
    width: 100%;
    min-width: 300px;
    aspect-ratio: 1983 / 793;
    border-radius: 12px;
    overflow: hidden;
    background: #f0f0f0;
    margin: 0 auto;
    line-height: 0;
    cursor: pointer;
}

.banner-result-img-wrapper > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

/* 下载按钮 */
.banner-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 28px;
    background: var(--color-primary, #6366f1);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.banner-download-btn:hover {
    filter: brightness(0.92);
}

/* 结果图弹窗 */
.banner-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.65);
    justify-content: center;
    align-items: center;
}

.banner-popup-overlay.active {
    display: flex;
}

.banner-popup-box {
    position: relative;
    max-width: 90vw;
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.banner-popup-box img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    border-radius: 8px;
}

.banner-popup-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 34px;
    height: 34px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 16px;
    line-height: 1;
    z-index: 2;
    transition: all 0.15s;
}

.banner-popup-close:hover {
    background: #f0f0f0;
    color: #000;
}

.banner-popup-box .banner-download-btn {
    margin-top: 14px;
}

/* ========== intro-steps 展示图等比缩放（中小分辨率如1440*900下整体等比缩小，左右高度保持一致）
   基准宽度 994 = 450(主图) + 24(间距) + 520(侧图区)，选择器带前缀覆盖上方固定像素规则 */
.namecard-intro-area .intro-steps {
    width: 100%;
    max-width: 994px;
    gap: 2.4145%; /* 24 / 994 */
}

.namecard-intro-area .main-image-card {
    width: 45.2716%; /* 450 / 994 */
    height: auto;
    flex-shrink: 0;
    aspect-ratio: 450 / 346;
}

.namecard-intro-area .main-image-card img {
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.namecard-intro-area .side-images {
    flex: 1;
    min-width: 0;
    width: auto;
    height: auto;
    aspect-ratio: 520 / 345; /* 与主图高度保持一致 */
}

.namecard-intro-area .side-image-card {
    width: auto;
}

.namecard-intro-area .side-image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.namecard-intro-area .arrow-icon {
    left: 29.175%; /* 290 / 994，随容器等比定位 */
}
