body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    text-align: center;
    padding: 20px;
    margin: 0;
    color: #333;
}

h1 {
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 25px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

h3 {
    color: #2c3e50;
    margin: 0 15px;
    display: flex;
    align-items: center;
}

#customFileButton, button, select {
    background-color: #3498db;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin: 10px;
}

#customFileButton:hover, button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 30px;
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position-x: 95%;
    background-position-y: 50%;
}

#imageCount {
    margin: 0 15px;
    display: flex;
    align-items: center;
    color: #7f8c8d;
    font-weight: 600;
}

#previewContainer {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 15px;
    margin: 30px 0;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.previewImage {
    max-height: 220px;
    border: 3px solid #ecf0f1;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.previewImage:hover {
    transform: scale(1.05);
}

#mergedImageContainer, #negativeImageContainer {
    margin: 30px 0;
    text-align: center;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

#mergedImageContainer h2, #negativeImageContainer h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

#mergedImageContainer img, #negativeImageContainer img {
    max-width: 100%;
    height: auto;
    border: 3px solid #ecf0f1;
    border-radius: 8px;
}

#modeSwitch {
    margin-bottom: 20px;
    background-color: #ecf0f1;
    border-radius: 10px; 
    display: inline-flex;
    padding: 3px; 
    position: relative;
}

.modeButton {
    background-color: transparent;
    color: #3498db; /* 未选中状态文字颜色 */
    padding: 8px 32px; /* 增加左右 padding 以拉长按钮，从 16px 增加到 32px */
    border: none;
    border-radius: 8px; 
    cursor: pointer;
    font-size: 14px; 
    transition: all 0.3s ease;
    margin: 0;
    z-index: 1;
    transform: none; /* 取消放大效果 */
    box-shadow: none; /* 取消阴影效果 */
}

.modeButton:hover {
    background-color: transparent; /* 取消 hover 背景色变化 */
    transform: none; /* 取消 hover 放大效果 */
    box-shadow: none; /* 取消 hover 阴影效果 */
}

.modeButton.active {
    color: white;
    background-color: transparent; 
    transform: none; /* 取消选中时放大效果 */
    box-shadow: none; /* 取消选中时阴影效果 */
}

#modeSwitch::before {
    content: '';
    position: absolute;
    border-radius: 8px; 
    width: calc(50% - 3px); 
    height: calc(100% - 6px); 
    left: 3px;
    top: 3px;
    transition: transform 0.3s ease;
}

.modeButton:nth-child(1).active ~ #modeSwitch::before {
    transform: translateX(0);
}

.modeButton:nth-child(2).active ~ #modeSwitch::before {
    transform: translateX(100%);
}

.modeButton.active {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.customButton {
    background-color: #3498db;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin: 10px;
}

.customButton:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

#splitPreviewContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 30px 0;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

#splitPreviewContainer div {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#splitPreviewContainer div button {
    margin-top: 10px;
    width: fit-content;
}

#copyright {
    margin-top: 40px;
    padding: 20px;
    background-color: #34495e;
    color: white;
    font-size: 14px;
    border-radius: 8px;
    box-shadow: 0 -4px 6px rgba(50, 50, 93, 0.11), 0 -1px 3px rgba(0, 0, 0, 0.08);
}

#copyright a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

#copyright a:hover {
    color: #2980b9;
    text-decoration: underline;
}

@media (max-width: 768px) {
    #copyright {
        font-size: 12px;
        padding: 15px;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 24px;
    }

    #customFileButton, button, select {
        padding: 10px 20px;
        font-size: 14px;
    }

    .previewImage {
        max-height: 180px;
    }
}

/* 分片数量输入框样式 */
#splitCount {
    padding: 12px 24px;
    border: 2px solid #3498db;
    border-radius: 8px;
    font-size: 16px;
    margin: 10px;
    transition: border-color 0.3s ease;
    outline: none;
}

#splitCount:focus {
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

/* 分片数量警告信息样式 */
#splitCountWarning {
    font-size: 14px;
    margin: 5px 0;
}


#splitImagePreview {
    margin-top: 20px; /* 添加顶部边距，使预览容器与上传按钮保持一定距离 */
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    max-width: 100%; /* 确保预览容器不会超出页面宽度 */
    overflow-x: auto; /* 当图片过多时，允许水平滚动 */
    justify-content: center; /* 水平居中 */
    align-items: center; /* 垂直居中 */
}

#ad {
    margin: 20px 0;
    text-align: center;
}

.ad-link {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(45deg, #2d004d, #4a007d); /* 黑紫色渐变色 */
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    box-shadow: 0 0 10px #6a00b0, 0 0 20px #6a00b0, 0 0 30px #6a00b0; /* 霓虹灯发光效果 */
    transition: all 0.3s ease;
}

.ad-link:hover {
    background: linear-gradient(45deg, #4a007d, #2d004d); /* 悬停时渐变色反转 */
    transform: translateY(-2px);
    box-shadow: 0 0 15px #8a00e0, 0 0 30px #8a00e0, 0 0 45px #8a00e0; /* 悬停时增强发光效果 */
}