 /* 基础样式重置与统一 */
 :root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --danger-color: #dc2626;
    --border-radius: 8px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --transition: all 0.2s ease;
}


/* 自定义手机预览样式 */
.phone-preview {
    width: 375px;
    height: 667px;
    border: 16px solid #333;
    border-radius: 36px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-md);
}

    .phone-preview::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 100px;
        height: 20px;
        border-bottom-left-radius: 10px;
        border-bottom-right-radius: 10px;
        background: #333;
    }

    .phone-preview iframe {
        width: 100%;
        height: 100%;
        border: none;
    }
/* 流式输出占位样式 */
.stream-output {
    padding: 10px;
    line-height: 1.5;
    color: #666;
    white-space: pre-wrap; /* 保留换行，完整展示HTML内容 */
    overflow-y: auto; /* 内容超出时滚动 */
    height: 100%; /* 占满手机预览容器 */
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
}
/* 文件引用标签样式 - 优化视觉 */
.file-tag {
    display: inline-flex;
    align-items: center;
    background: var(--light-color);
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    padding: 6px 10px;
    margin: 0 6px 6px 0;
    font-family: monospace; /* 代码字体更易读 */
    font-size: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

    .file-tag:hover {
        box-shadow: var(--shadow-md);
    }

    .file-tag .close-btn {
        margin-left: 8px;
        cursor: pointer;
        color: var(--danger-color);
        width: 16px;
        height: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: #fef2f2;
        transition: var(--transition);
    }

        .file-tag .close-btn:hover {
            background: #fee2e2;
            transform: scale(1.1);
        }
/* 布局适配 - 聊天区高度自动 */
.chat-area {
    height: auto; /* 高度自动适应内容 */
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

    .chat-area .card-header {
        background: var(--primary-color);
        color: #fff;
        border: none;
        padding: 10px 16px;
    }

        .chat-area .card-header h5 {
            font-size: 16px;
        }

    .chat-area .card-body {
        padding: 16px;
        flex-grow: 1;
    }
/* Tab容器样式 */
.tab-container {
    margin-bottom: 4px;
    border: 0;
    box-shadow: var(--shadow-sm);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.tab-nav {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tab-nav-item {
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 500;
    color: #64748b;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}

    .tab-nav-item:hover {
        background: #f1f5f9;
        color: #334155;
    }

    .tab-nav-item.active {
        color: var(--primary-color);
        border-bottom-color: var(--primary-color);
        background: #fff;
    }

    .tab-nav-item i {
        margin-right: 6px;
    }

.tab-content {
    padding: 0;
}

.tab-pane {
    display: none;
    padding: 0;
}

    .tab-pane.active {
        display: block;
    }
/* 列表容器样式 */
.record-list, .image-library-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 16px;
}

/* 图片上传按钮保持原有尺寸 */
.image-upload-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    flex: none;
    height: 38px;
    width: 140px;
}
/* 图片上传按钮样式保持不变 */
.image-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0 12px;
    background: var(--secondary-color);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.file-input-wrapper input[type="file"], .image-upload-wrapper input[type="file"] {
    position: relative;
    top: 0;
    left: -120px;
    opacity: 0;
    cursor: pointer;
    width: 120px;
}
/* 我的小程序&图片项样式优化 */
.record-info, .image-item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.record-name-time, .image-name-url {
    display: flex;
    align-items: center;
    gap: 10px;
}

.record-link, .image-url {
    font-size: 12px;
    word-break: break-all;
    color: var(--primary-color);
    transition: var(--transition);
}

    .record-link:hover, .image-url:hover {
        color: #1d4ed8;
        text-decoration: underline;
    }
/* 发布状态样式 */
.publish-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

    .publish-status.unpublished {
        background: #f3f4f6;
        color: #6b7280;
        border: 1px solid #e5e7eb;
    }

    .publish-status.published {
        background: #dcfce7;
        color: #16a34a;
        border: 1px solid #bbf7d0;
    }

.toggle-publish-btn {
    font-size: 11px;
    padding: 2px 8px;
    margin-left: 8px;
}
/* 按钮行：生成按钮靠右（核心修改2） */
.btn-action-row {
    display: flex;
    justify-content: flex-end; /* 原flex-start → 改为flex-end靠右 */
    gap: 8px;
    width: 100%;
}
/* 表单元素样式精简优化 */
.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 4px;
    font-size: 13px;
    /* 核心修改3：label布局改为flex-start，按钮不靠右 */
    display: flex;
    justify-content: flex-start; /* 原space-between → 改为flex-start */
    align-items: center;
}

.form-control {
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    padding: 8px 10px;
    font-size: 13px;
    transition: var(--transition);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

    .form-control:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        outline: none;
    }
/* 调高功能描述输入框高度 */
textarea#prompt-input.form-control {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
    width: 100%;
}
/* 记录卡片、图片项样式优化 */
.record-list .card, .image-library-list .card {
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    margin-bottom: 8px;
}

    .record-list .card:hover, .image-library-list .card:hover {
        box-shadow: var(--shadow-md);
        border-color: #cbd5e1;
    }

.record-list .card-body, .image-library-list .card-body {
    padding: 16px;
}
/* 操作按钮样式优化 */
.btn-sm {
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
}

    .btn-sm:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-sm);
    }
/* 响应式适配 */
@media (max-width: 768px) {
    .btn-action-row {
        flex-direction: row;
        gap: 8px;
    }
    /* 移动端选择HTML文件按钮同步改小 */
    .file-input-wrapper {
        width: 100px;
        height: 28px;
        font-size: 10px;
    }
    /* 预览区适配移动端 */
    .phone-preview {
        width: 280px;
        height: 560px;
    }
    /* Tab导航适配移动端 */
    .tab-nav-item {
        padding: 10px 12px;
        font-size: 13px;
    }
    /* 图片库移动端适配 */
    .image-item {
        width: calc(50% - 8px) !important;
        margin: 0 !important;
    }

    .image-search-row {
        flex-direction: row !important;
        gap: 8px !important;
    }

        .image-search-row .form-control {
            flex: 1 !important;
            width: auto !important;
        }

        .image-search-row #image-search-btn {
            width: 70px !important;
            flex: none !important;
        }

    .image-upload-area {
        flex-direction: row !important;
        gap: 8px !important;
    }

        .image-upload-area #image-name-input {
            flex: 1 !important;
            width: auto !important;
            height: 38px !important;
        }

        .image-upload-area .image-upload-wrapper {
            width: 100px !important;
            flex: none !important;
        }
}
/* 图片库样式重构 */
.image-library-header {
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
/* 搜索行样式 */
.image-search-row {
    display: flex;
    gap: 8px;
    align-self: end;
    width: 100%;
}

    .image-search-row .form-control {
        flex: 1;
    }

#image-search-btn {
    width: 80px;
    height: 38px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

    #image-search-btn:hover {
        background: #1d4ed8;
        box-shadow: var(--shadow-sm);
    }
/* 图片列表重构 */
.image-library-list {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px;
    justify-content: flex-start;
    max-height: 300px;
}
/* 单张图片项样式 */
.image-item {
    width: 180px;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

    .image-item:hover {
        box-shadow: var(--shadow-md);
        border-color: #cbd5e1;
    }
/* 图片预览大图 */
.image-preview-large {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-bottom: 1px solid #e2e8f0;
}
/* 图片信息区域 */
.image-item-info-wrapper {
    padding: 10px;
}

.image-item-name {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 8px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 复制链接按钮 */
.copy-image-url-btn {
    width: 100%;
    background: var(--light-color);
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 4px 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

    .copy-image-url-btn:hover {
        background: #f1f5f9;
        color: #1d4ed8;
    }
/* 底部上传图片区域 */
.image-upload-bottom {
    padding: 10px 16px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    justify-content: right;
}

.image-upload-area {
    display: flex;
    gap: 8px;
    width: 100%;
}

#image-name-input {
    flex: 1;
    height: 38px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    width: 100%;
}

    .empty-state i {
        font-size: 48px;
        margin-bottom: 16px;
        color: #cbd5e1;
    }

.prompt-tips {
    padding: 0;
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: rgba(38, 36, 76, 0.45);
    padding: 8px 12px;
    text-align: center;
}

/* 流式输出容器样式 */
.stream-output {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    padding: 16px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 按钮行样式 */
.btn-action-row {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}