
/* ========== Logo Page Layout ========== */
.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;
    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-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);
    }

/* Reference Image Upload */
.ref-section {
  margin-bottom: 22px;
}

.ref-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

.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: 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);
}

/* ========== 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;
}

.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);
}

/* ========== AI名片预览网格 ========== */
.namecard-result-area {
    flex: 1;
    min-width: 0;
}

.namecard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
}

.namecard-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    transition: box-shadow 0.2s;
}

.namecard-item:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.namecard-title {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid #f5f5f5;
}

.namecard-card-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 60%; /* 638/1063 ≈ 0.6 */
    background: #f8f8f8;
    overflow: hidden;
}

.namecard-card-wrap.loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.namecard-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.namecard-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* 加载占位 */
.namecard-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    gap: 12px;
}

.namecard-placeholder .spin-icon {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--color-primary, #4f46e5);
    border-radius: 50%;
    animation: namecard-spin 0.8s linear infinite;
}

@keyframes namecard-spin {
    to { transform: rotate(360deg); }
}

/* 加载更多 */
.namecard-load-more-wrap {
    text-align: center;
    padding: 32px 0 16px;
}

.namecard-load-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 40px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: var(--color-primary, #4f46e5);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.namecard-load-more:hover {
    background: var(--color-primary-dark, #4338ca);
}

.namecard-load-more:active {
    transform: scale(0.97);
}

.namecard-load-more:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.namecard-error {
    color: #ef4444;
    font-size: 13px;
    text-align: center;
    padding: 8px 14px;
}

/* ========== 名片遮罩层与编辑按钮 ========== */
.namecard-card-wrap {
    position: relative;
}

.namecard-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 10;
    cursor: pointer;
}

.namecard-item:hover .namecard-overlay {
    opacity: 1;
}

.namecard-overlay-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.namecard-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: #fff;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.namecard-edit-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.namecard-edit-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ========== 主图预览网格（一行4个） ========== */
.mainimage-grid {
  grid-template-columns: repeat(4, 1fr) !important;
}

.namecard-overlay-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.namecard-edit-btn.download-btn {
  background: #10b981;
}

.namecard-edit-btn.download-btn:hover {
  background: #059669;
}

/* ========== 移动端下载图片按钮（PC默认隐藏） ========== */
.namecard-download-btn {
    display: none;
    width: calc(100% - 28px);
    margin: 12px 14px 14px;
    padding: 10px 0;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.namecard-download-btn:active {
    background: #e4e4e4;
}

/* ========== 移动端响应式 (≤639px) ========== */
@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;
    }

    /* 预览网格一行显示一个 */
    .namecard-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    /* 移动端隐藏编辑名片遮罩层 */
    .namecard-overlay {
        display: none !important;
    }

    /* 移动端在图片下方显示下载图片按钮 */
    .namecard-download-btn {
        display: block;
    }
}