﻿/* ========== Logo Page Layout ========== */
.logo-page-layout {
    display: flex;
    gap: 28px;
}
/* ========== Design Panel (Left) ========== */
.design-panel {
    width: 480px;
    flex-shrink: 0;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 48px);
    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: 22px;
}

.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);
    }

.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);
    }

.form-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: 120px;
    line-height: 1.5;
}

    .form-textarea:focus {
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }

    .form-textarea::placeholder {
        color: var(--color-text-muted);
    }

.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: 120px;
    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);
    }

/* AI代写按钮行 */
.ai-write-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-write-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width:62px;
    padding: 4px 12px;
    border: 1.5px solid #6366f1;
    border-radius: 16px;
    background: #fff;
    color: #6366f1;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.ai-write-btn:hover {
    background: #dcdcdc;
    color: #333;
}

.ai-write-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Reference Image Upload */
.ref-section {
    margin-bottom: 22px;
}

.ref-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.ref-upload-row {
    display: flex;
    gap: 10px;
}

.ref-upload-item {
    flex: 1;
    min-width: 0;
}

.ref-upload-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 6px;
}

.ref-desc {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 10px;
    line-height: 1.5;
}

.upload-area {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px 10px;
    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: 120px;
            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);
    }

/* ========== NameCard 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;
    position: relative;
}

.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: 100%;
    max-width: 960px;
    align-items: center;
    position: relative;
}

.intro-step-card {
    flex: 1;
    background: #fff;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

    .intro-step-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    }

.step-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: #6366f1;
}

    .step-icon svg {
        width: 100%;
        height: 100%;
    }

.step-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    padding: 4px 12px;
    margin-bottom: 12px;
}

.step-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 12px 0;
}

.step-desc {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin: 0;
}

.main-image-card {
    flex-shrink: 0;
    width: 320px;
    height: 320px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: relative;
}

    .main-image-card .step-badge {
        position: absolute;
        top: 12px;
        left: 12px;
        z-index: 2;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(4px);
        font-size: 12px;
        font-weight: 600;
        color: #6366f1;
        border-radius: 12px;
        padding: 4px 12px;
        margin: 0;
    }

    .main-image-card img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        background: #f8fafc;
    }

.side-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 16px;
    flex: 1;
    height: 320px;
}

.side-image-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgb(59 57 57 / 46%);
    position: relative;
}

    .side-image-card .step-badge {
        position: absolute;
        top: 8px;
        left: 8px;
        z-index: 2;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(4px);
        font-size: 11px;
        font-weight: 600;
        color: #6366f1;
        border-radius: 10px;
        padding: 3px 10px;
        margin: 0;
    }

    .side-image-card img {
        width: 100%;
        height: 100%;
        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);
    }

/* ========== Storefront Result Area ========== */
.storefront-result-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.result-preview-wrapper {
    width: 100%;
    height: auto;
    background: #fff;
    padding:20px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .result-preview-wrapper img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
        cursor: pointer;
        border-radius: 12px;
    }

/* Intro Loading Overlay */
.intro-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.intro-loading-content {
    text-align: center;
    color: #fff;
    width: 80%;
    max-width: 500px;
}

.intro-loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: storefront-spin 0.8s linear infinite;
}

@keyframes storefront-spin {
    to { transform: rotate(360deg); }
}

.intro-loading-text {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.intro-loading-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    overflow: hidden;
}

.intro-loading-bar-fill {
    width: 0%;
    height: 100%;
    background: #fff;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Result Actions */
.result-actions {
    margin-top: 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

/* 结果操作按钮统一高度、水平对齐（消除局部编辑/拆解按钮自带的外边距偏移） */
.result-actions .result-btn,
.result-actions .img-redraw-open-btn,
.result-actions .psd-export-btn,
.result-actions .poster-split-btn {
    margin: 0;
    height: 42px;
    padding: 0 24px;
    box-sizing: border-box;
}

.result-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
}

.result-btn-download {
    background: var(--color-primary);
    color: #fff;
}

    .result-btn-download:hover {
        background: var(--color-primary-hover);
        transform: translateY(-1px);
    }

    .result-btn-download:active {
        transform: translateY(0);
    }

/* ========== View Tabs ========== */
.storefront-right-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.storefront-view-tabs {
    display: flex;
    gap: 0;
    padding: 3px;
    margin: 32px 32px 0 32px;
    background: #f3f4f6;
    border-radius: 8px;
    flex-shrink: 0;
}

.view-tab {
    flex: 1;
    padding: 8px 20px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    border-radius: 6px;
    transition: all 0.2s ease;
    user-select: none;
}

    .view-tab.active {
        background: #fff;
        color: var(--color-primary);
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        font-weight: 600;
    }

    .view-tab:hover:not(.active) {
        color: #374151;
    }

/* ========== Scene Tags (应用场景标签列表) ========== */
.scene-tags {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.scene-tag {
    padding: 8px 12px;
    background: #f3f4f6;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

    .scene-tag:hover {
        background: #e5e7eb;
        color: #374151;
    }

    .scene-tag.active {
        background: var(--color-primary);
        color: #fff;
        border-color: var(--color-primary);
        font-weight: 600;
    }

/* ========== 移动端响应式 (≤639px) ========== */
@media (max-width: 639px) {
    /* 移动端H5：默认隐藏设计面板，仅展示右侧门头列表 */
    .design-panel {
        width: 100%;
        padding: 28px 4px;
        max-height: none;
        position: static;
        display: none;
    }

    /* 选中具体门头后：显示设计面板，隐藏右侧门头列表 */
    .logo-page-layout.mobile-panel-active .design-panel {
        display: flex;
    }

    .logo-page-layout.mobile-panel-active .storefront-right-column {
        display: none;
    }

    .design-panel-body {
        flex: none;
        overflow-y: visible;
        min-height: auto;
    }

    /* 底部预留空间，避免开始设计按钮被H5底部菜单栏遮挡 */
    .start-design-btn {
        margin-bottom: calc(56px + env(safe-area-inset-bottom));
    }
}

/* ========== 拆解图片功能（各AI设计页共用） ========== */
/* 拆解图片按钮（绿色，与下载按钮区分） */
.poster-split-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #10b981;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 16px;
    margin-left: 12px;
    transition: background 0.2s;
}

.poster-split-btn:hover {
    background: #059669;
}

/* 拆解图片全屏Loading遮罩 */
.poster-split-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.poster-split-overlay .split-spin-icon {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: posterSplitSpin 0.8s linear infinite;
    margin-bottom: 20px;
}

@keyframes posterSplitSpin {
    to {
        transform: rotate(360deg);
    }
}

.poster-split-text {
    color: #fff;
    font-size: 18px;
}
