* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* 支持长按图片保存 */
    user-select: auto;
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    padding: 10px;
    font-size: 16px; /* 基础字体大小 */
}

.container {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.8rem;
}

h2 {
    color: #3498db;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.section {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Banner上传区域样式 */
.banner-upload {
    text-align: center;
}

.banner-preview {
    width: 100%;
    height: 180px;
    border: 2px dashed #3498db;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f9f9f9;
    overflow: hidden;
}

.banner-preview img {
    max-width: 100%;
    max-height: 100%;
    /* 支持长按图片保存 */
    pointer-events: auto;
    user-select: auto;
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    touch-action: auto;
    -webkit-touch-callout: default;
}

/* 富文本编辑器样式 */
#editor-container {
    height: 200px;
    margin-bottom: 15px;
}

.ql-editor {
    min-height: 150px;
}

/* 多图片上传区域样式 */
.multi-upload {
    text-align: center;
}

.layout-options {
    margin-bottom: 15px;
    text-align: left;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
}

.layout-options label {
    margin-right: 15px;
    font-weight: bold;
    cursor: pointer;
	display:block;
}

.layout-options input[type="radio"] {
    margin-right: 5px;
}

.images-preview {
    width: 100%;
    min-height: 200px;
    max-height: 400px;
    border: 2px dashed #3498db;
    margin-bottom: 15px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    background-color: #f9f9f9;
    overflow-y: auto;
    gap: 8px; /* 图片行间距为8px */
}

/* 双图一行布局 */
.images-preview.two-columns .image-item {
    width: calc(50% - 5px);
}

/* 三图一行布局 */
.images-preview.three-columns .image-item {
    width: calc(33.333% - 6px);
}

/* 单图一行布局 */
.images-preview.one-column .image-item {
    width: calc(100% - 10px);
}

.image-item {
    height: 120px;
    margin: 0;
    position: relative;
    overflow: hidden;
    border: 1px solid #ddd;
}

.image-item {
    width: 120px;
    height: 120px;
    margin: 5px;
    position: relative;
    overflow: hidden;
    border: 1px solid #ddd;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 支持长按图片保存 */
    pointer-events: auto;
    user-select: auto;
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    touch-action: auto;
    -webkit-touch-callout: default;
}

.image-item .remove-btn {
    position: absolute;
    top: 0px;
    right: 5px;
    background: #2d282c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    line-height: 0px;
    text-align: center;
    cursor: pointer;
    padding-left: 10px;
    padding-right: 20px;
}

/* 按钮样式 */
button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    margin: 8px auto;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 1rem;
    display: block;
    width: 100%;
    max-width: 300px;
}

button:hover {
    background-color: #2980b9;
}

input[type="file"] {
    display: none;
}

#banner-upload-btn, #images-upload-btn {
    background-color: #2ecc71;
    display: block;
    margin: 10px auto;
}

/* 生成按钮区域 */
.generate-section {
    text-align: center;
    margin: 20px 0;
}

#generate-btn {
    background-color: #e74c3c;
    font-size: 1.1rem;
    padding: 15px 30px;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
}

/* 结果区域 */
.result-section {
    text-align: center;
    margin-top: 30px;
    display: none;
}

.result-image {
    max-width: 100%;
    margin: 20px auto;
    border: 1px solid #ddd;
    padding: 10px;
    background-color: white;
}

.result-image img {
    max-width: 100%;
    /* 支持长按图片保存 */
    pointer-events: auto;
    user-select: auto;
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    touch-action: auto;
    -webkit-touch-callout: default;
}

.download-btn {
    display: block;
    background-color: #9b59b6;
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 4px;
    margin: 15px auto;
    width: 100%;
    max-width: 250px;
    text-align: center;
}

.download-btn:hover {
    background-color: #8e44ad;
}

/* 媒体查询 - 移动端适配 */
@media screen and (max-width: 768px) {
    body {
        padding: 8px;
    }
    
    .container {
        padding: 12px;
    }
    
    h1 {
        font-size: 1.6rem;
        margin-bottom: 15px;
    }
    
    h2 {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }
    
    .section {
        margin-bottom: 15px;
        padding: 12px;
    }
    
    .banner-preview {
        height: 150px;
        margin-bottom: 10px;
    }
    
    #editor-container {
        height: 180px;
    }
    
    .ql-editor {
        min-height: 130px;
    }
    
    /* 双图一行布局 - 移动端 */
    .images-preview.two-columns .image-item {
        width: calc(50% - 5px);
        height: 150px;
    }
    
    /* 三图一行布局 - 移动端 */
    .images-preview.three-columns .image-item {
        width: calc(33.333% - 6px);
        height: 150px;
    }
    
    button {
        padding: 14px 20px;
        font-size: 1.1rem;
    }
    
    #generate-btn {
        font-size: 1.2rem;
        padding: 16px 20px;
    }
}

@media screen and (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.4rem;
    }
    
    h2 {
        font-size: 1.1rem;
    }
    
    .banner-preview {
        height: 120px;
    }
    
    .images-preview {
        min-height: 150px;
        max-height: 300px;
    }
    
    /* 双图一行布局 - 小屏幕 */
    .images-preview.two-columns .image-item {
        width: calc(50% - 5px);
        height: 120px;
    }
    
    /* 三图一行布局 - 小屏幕 */
    .images-preview.three-columns .image-item {
        width: calc(33.333% - 6px);
        height: 120px;
    }
    
    button {
        font-size: 1rem;
        padding: 12px 15px;
    }
}