﻿/* ========== ai-logo-design.html - Logo设计 ========== */

/* ========== 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;
    }

/* 返回Logo灵感按钮（默认隐藏，仅移动端设计面板内展示） */
.mobile-panel-back {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 0 14px;
    margin-bottom: 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

    .mobile-panel-back svg {
        stroke: var(--color-text);
    }

/* 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);
    }

/* Industry Selection */
.industry-section {
    margin-bottom: 22px;
}

.industry-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 10px;
}

.industry-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.industry-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 13px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 1px solid transparent;
    user-select: none;
}

    .industry-tag:hover {
        background: #f0edff;
        color: var(--color-primary);
        border-color: var(--color-primary);
    }

    .industry-tag.active {
        background: var(--color-primary);
        color: white;
        border-color: var(--color-primary);
    }

.industry-more-btn {
    padding: 7px 14px;
    background: transparent;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
}

    .industry-more-btn:hover {
        border-color: var(--color-primary);
        color: var(--color-primary);
    }

/* Industry Popover */
.industry-popover {
    display: none;
    position: fixed;
    margin-top: 0;
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--color-border);
    z-index: 99999;
    width: 290px;
    max-height: 600px;
    overflow-y: auto;
}

    .industry-popover.active {
        display: block;
        animation: popoverIn 0.2s ease-out;
    }

@keyframes popoverIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.industry-popover-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 12px;
}

.industry-popover-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.industry-popover-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 12px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 1px solid transparent;
}

    .industry-popover-tag:hover {
        background: #f0edff;
        color: var(--color-primary);
    }

    .industry-popover-tag.active {
        background: var(--color-primary);
        color: white;
    }

/* 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;
}

/* Description Section */
.desc-section {
    margin-bottom: 22px;
}

.desc-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-write-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 3px 10px;
    font-size: 12px;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    white-space: nowrap;
}

    .ai-write-btn:hover {
        opacity: 0.85;
        transform: scale(1.03);
    }

    .ai-write-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

.ai-write-loading {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ai-write-spin 0.6s linear infinite;
}

@keyframes ai-write-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Style Selection */
.style-section {
    margin-bottom: 24px;
}

.style-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}

.style-hint {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.style-item {
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid transparent;
    transition: all var(--transition-base);
    user-select: none;
}

    .style-item:hover {
        border-color: #c7c8ff;
    }

    .style-item.active {
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    }

.style-item-img {
    width: 100%;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    overflow: hidden;
}

    .style-item-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.style-item-name {
    text-align: center;
    font-size: 12px;
    padding: 6px 4px;
    color: var(--color-text-secondary);
    background: #fafafa;
}

.style-item.active .style-item-name {
    color: var(--color-primary);
    font-weight: 600;
    background: #f5f3ff;
}

/* 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);
    }

/* ========== Logo Grid Area ========== */
.logo-grid-area {
    flex: 1;
    min-width: 0;
}

.logo-page-header {
    margin-bottom: 24px;
}

.logo-page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
}

.logo-page-desc {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-top: 8px;
}

/* Categories */
.logo-categories {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

    .logo-categories::-webkit-scrollbar {
        display: none;
    }

.logo-cat-tag {
    flex-shrink: 0;
    padding: 8px 18px;
    background: var(--color-white);
    border-radius: var(--radius-full);
    font-size: 14px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    user-select: none;
    border: 1px solid var(--color-border);
    -webkit-tap-highlight-color: transparent;
}

    .logo-cat-tag:hover {
        color: var(--color-primary);
        border-color: var(--color-primary);
        background: #f5f3ff;
    }

    .logo-cat-tag.active {
        background: var(--color-primary);
        color: white;
        border-color: var(--color-primary);
    }

/* Logo Cards Grid */
.logo-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.logo-card {
    background: var(--color-card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    -webkit-tap-highlight-color: transparent;
}

    .logo-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    }

    .logo-card:active {
        transform: scale(0.98);
    }

.logo-card-image {
    width: 100%;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.logo-card-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;
    border-radius: inherit;
}

.logo-card-image:hover .logo-card-overlay {
    opacity: 1;
}

.btn-use-ref {
    padding: 8px 20px;
    background: #fff;
    color: #333;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: background 0.2s, transform 0.15s;
}

    .btn-use-ref:hover {
        background: #f0edff;
        color: var(--color-primary);
        transform: scale(1.05);
    }

    .btn-use-ref:active {
        transform: scale(0.97);
    }

.logo-card-info {
    padding: 14px 16px;
    border-top: 1px solid #f0f0f0;
}

.logo-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
}

.logo-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.logo-tag {
    font-size: 12px;
    padding: 3px 8px;
    background: #f5f5f5;
    border-radius: 4px;
    color: var(--color-text-muted);
}

/* ========== 爆款模板卡片网格（上图下文，一行5个） ========== */
.clone-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.clone-card {
    background: var(--color-card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    -webkit-tap-highlight-color: transparent;
}

    .clone-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    }

    .clone-card:active {
        transform: scale(0.98);
    }

.clone-card-image {
    width: 100%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

    .clone-card-image img {
        width: 100%;
        height: auto;
        object-fit: cover;
        display: block;
    }

/* 悬停半透明遮罩层 + 复刻同款按钮 */
.clone-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 2;
}

.clone-card-image:hover .clone-card-overlay {
    opacity: 1;
}

.clone-card-btn {
    padding: 9px 26px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background 0.2s, transform 0.15s;
}

    .clone-card-btn:hover {
        background: var(--color-primary-hover);
        transform: scale(1.05);
    }

    .clone-card-btn:active {
        transform: scale(0.97);
    }

.clone-card-empty {
    font-size: 13px;
    color: #ccc;
    user-select: none;
}

.clone-card-title {
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== Mobile: Design Panel as top section ========== */

/* Logo Design Loading */
.logo-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 24px;
}

.logo-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e8e8ff;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: logoSpin 0.8s linear infinite;
}

@keyframes logoSpin {
    to {
        transform: rotate(360deg);
    }
}

.logo-loading-text {
    font-size: 16px;
    color: var(--color-text-secondary);
    animation: logoPulse 1.5s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* Logo Preview Area */
.logo-preview-area {
    padding: 20px 0;
}

.logo-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.logo-preview-box {
    aspect-ratio: 500 / 374;
    background: #f0f0f0;
    border: 2px solid #d0d0d0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.logo-preview-placeholder {
    font-size: 15px;
    color: #999;
    user-select: none;
}

.logo-preview-box canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Logo Preview Hover Overlay */
.logo-preview-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;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 10;
}

.logo-preview-box:hover .logo-preview-overlay {
    opacity: 1;
}

.preview-action-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, background 0.2s;
    white-space: nowrap;
}

    .preview-action-btn:hover {
        transform: scale(1.05);
    }

    .preview-action-btn:active {
        transform: scale(0.97);
    }

    .preview-action-btn.btn-edit {
        background: #fff;
        color: #333;
    }

        .preview-action-btn.btn-edit:hover {
            background: #f0edff;
            color: var(--color-primary);
        }

    .preview-action-btn.btn-download {
        background: var(--color-primary);
        color: #fff;
    }

        .preview-action-btn.btn-download:hover {
            background: var(--color-primary-hover);
        }

/* Logo Preview Refresh Button (top-right) */
.preview-refresh-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.25s, background 0.2s;
}

.logo-preview-box:hover .preview-refresh-btn {
    opacity: 1;
}

.preview-refresh-btn:hover {
    background: rgba(99, 102, 241, 0.85);
}

.preview-refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 移动端H5：logo下方的下载按钮（浅灰色，默认隐藏） */
.mobile-download-btn {
    display: none;
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    background: #f0f0f0;
    color: #666;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

    .mobile-download-btn:active {
        background: #e6e6e6;
    }

/* Refresh Batch Button */
.refresh-batch-wrap {
    text-align: center;
    padding: 28px 0 10px;
}

.refresh-batch-btn {
    padding: 14px 48px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    font-family: inherit;
}

    .refresh-batch-btn:hover {
        background: var(--color-primary-hover);
        transform: translateY(-1px);
    }

    .refresh-batch-btn:active {
        transform: translateY(0);
    }

    .refresh-batch-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

@media (max-width: 639px) {
    .logo-preview-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    /* 移动端H5：爆款模板卡片一行显示2个 */
    .clone-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 移动端H5：隐藏复刻弹层底部适用说明 */
    .clone-modal-usage {
        display: none;
    }

    /* 移动端H5：默认隐藏设计面板，仅展示Logo设计灵感 */
    .design-panel {
        display: none;
    }

    /* 选中具体灵感后：显示设计面板，隐藏Logo设计灵感 */
    .logo-page-layout.mobile-panel-active .design-panel {
        display: flex;
    }

    .logo-page-layout.mobile-panel-active .logo-grid-area {
        display: none;
    }

    /* 移动端设计面板内展示返回按钮 */
    .mobile-panel-back {
        display: flex;
    }

    /* 移动端：logo生成后隐藏悬浮层（含高级编辑），下载按钮移至logo下方 */
    .logo-preview-overlay {
        display: none;
    }

    .mobile-download-btn {
        display: block;
    }
}

@media (max-width: 767px) {
    .logo-preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1023px) {
    .logo-page-layout {
        flex-direction: column;
    }

    .design-panel {
        width: 100%;
        position: static;
        max-height: none;
        border-radius: var(--radius-lg);
    }

    .style-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========== Responsive: Tablet ========== */
@media (min-width: 768px) {
    .logo-page-title {
        font-size: 28px;
    }

    .logo-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    .logo-categories {
        flex-wrap: wrap;
        overflow-x: visible;
    }
}

/* ========== Responsive: Desktop ========== */
@media (min-width: 1024px) {
    .logo-page-title {
        font-size: 28px;
    }

    .logo-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .logo-card {
        border-radius: var(--radius-lg);
    }
}

/* ========== Responsive: Large Desktop ========== */
@media (min-width: 1400px) {
    .logo-cards-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 22px;
    }

    .design-panel {
        width: 360px;
    }
}

/* ========== Responsive: Extra Large ========== */
@media (min-width: 1700px) {
    .logo-cards-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 24px;
    }
}

/* Touch-friendly */
@media (pointer: coarse) {
    .logo-cat-tag {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .logo-card:active {
        transform: scale(0.97);
    }
}

/* Small phones */
@media (max-width: 374px) {
    .logo-page-title {
        font-size: 20px;
    }

    .logo-cards-grid {
        gap: 10px;
    }

    .logo-cat-tag {
        padding: 6px 12px;
        font-size: 13px;
    }

    .style-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== 复刻同款弹层 ========== */
.clone-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cloneModalFade 0.25s ease;
    padding: 20px;
}

@keyframes cloneModalFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.clone-modal {
    background: #fff;
    border-radius: 16px;
    width: 860px;
    max-width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
    animation: cloneModalUp 0.3s ease;
}

@keyframes cloneModalUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.clone-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.clone-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
}

.clone-modal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.clone-modal-ratio {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #f0edff;
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.clone-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    color: #666;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

    .clone-modal-close:hover {
        background: #e5e5e5;
        color: #333;
    }

.clone-modal-body {
    display: flex;
    gap: 24px;
    padding: 22px;
    overflow-y: auto;
}

.clone-modal-preview {
    flex-shrink: 0;
    width: 300px;
    background: #f5f5f5;
    border-radius: 12px;
    overflow: hidden;
    align-self: flex-start;
}

    .clone-modal-preview img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.clone-modal-form {
    flex: 1;
    min-width: 0;
}

.clone-modal-tip {
    border: 1px solid #ffd9d3;
    background: #fff6f4;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 20px;
}

.clone-modal-tip-main {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.6;
}

.clone-modal-tip-sub {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-top: 6px;
}

.clone-edit-item {
    margin-bottom: 18px;
}

.clone-edit-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 6px;
}

.clone-edit-original {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.clone-edit-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;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color var(--transition-base);
}

    .clone-edit-input:focus {
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }

.clone-modal-footer {
    padding: 16px 22px;
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
}

.clone-modal-usage {
    font-size: 13px;
    color: var(--color-text-muted);
}

.clone-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 34px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, transform 0.15s;
}

.clone-copy-arrow {
    font-size: 16px;
    line-height: 1;
}

    .clone-copy-btn:hover {
        background: var(--color-primary-hover);
        transform: translateY(-1px);
    }

    .clone-copy-btn:active {
        transform: translateY(0);
    }

@media (max-width: 639px) {
    .clone-modal-body {
        flex-direction: column;
    }

    .clone-modal-preview {
        width: 100%;
        max-width: 240px;
        margin: 0 auto;
    }
}

/* ========== textarea 「」文字高亮（backdrop 图层） ========== */
#cloneInputSection .highlight-wrap {
    position: relative;
    width: 100%;
}

#cloneInputSection .highlight-backdrop {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

#cloneInputSection .highlight-content {
    font-size: 15px;
    line-height: 1.6;
    font-family: inherit;
    color: var(--color-text);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    margin: 0;
    padding: 0;
    border: 0;
}

    #cloneInputSection .highlight-content mark {
        background: transparent;
        color: #5b3cfc;
        font-weight: 700;
    }

#cloneInputSection .text-input-area textarea {
    position: relative;
    z-index: 1;
    background: transparent;
    color: transparent;
    caret-color: var(--color-text);
}

    #cloneInputSection .text-input-area textarea::placeholder {
        color: var(--color-text-muted);
    }
