.container {
    max-width: 600px;
    margin: 6px auto 0;
}

h1,
h2 {
    color: var(--blue);
    margin: 10px 0;
}

.section {
    background-color: var(--white);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-group {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.form-group-label {
    width: 70px;
    font-size: 14px;
}

input,
textarea {
    width: 80%;
    padding: 8px;
    /*margin-bottom: 8px;*/
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    white-space: pre-wrap;
}

/* 隐藏原生 input 样式 */
.upload-input-hidden {
    display: none;
}

.custom-upload {
    display: flex;
    flex: 1;
    align-items: center;
}

.image-url-input {
    width: 72.2%;
    padding: 8px;
    margin-right: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 0;
}

.custom-upload button {
    padding: 8px 12px;
    background-color: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #A9A9A9;
    cursor: pointer;
    font-size: 14px;
    text-wrap: nowrap;
}

.custom-upload button:hover {
    background-color: rgba(169, 169, 169, 0.1);
}

button {
    background-color: var(--orange);
    color: var(--white);
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #e68a00;
}

.qa-pair {
    background-color: var(--white);
    border: 1px solid #ddd;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    position: relative;
}

.delete-btn {
    position: absolute;
    top: 5px;
    right: 2px;
    background-color: var(--red);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s;
    padding: 0;
}

.delete-btn:hover {
    background-color: #e60000;
}

#generatedImages {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

#generatedImages canvas {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.image-wrapper {
    width: 90%;
}

.image-wrapper img {
    width: 100%;
}

.image-wrapper span {
    color: var(--orange);
    align-content: center;
    text-align: center;
    display: block;
}

.btn-group {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.btn-group button {
    flex: 1;
    margin: 0 4px;
}

.tab-container {
    display: flex;
    margin-bottom: 20px;
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tab {
    flex: 1;
    padding: 15px 20px;
    background-color: var(--white);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-weight: bold;
}

.tab:not(:last-child) {
    border-right: 1px solid var(--light-gray);
}

.tab.active {
    background-color: var(--orange);
    color: var(--white);
}

.tab:hover:not(.active) {
    background-color: var(--light-gray);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 进度条 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--white);
    border-top: 5px solid var(--orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 进度条end */

/*  选择模板 */
.template-selector {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    background-color: var(--white);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.custom-select {
    position: relative;
    flex-grow: 1;
    margin-right: 10px;
}

.select-selected {
    background-color: var(--white);
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.select-selected img {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    border-radius: 4px;
}

.select-items {
    position: absolute;
    background-color: var(--white);
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.select-item {
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.select-item:hover {
    background-color: var(--light-gray);
}

.select-item img {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    border-radius: 4px;
}

.night-mode .template-selector,
.night-mode .select-selected,
.night-mode .select-items {
    background-color: #2a2a2a;
    color: #f0f0f0;
    border-color: #444;
}

.night-mode .select-item:hover {
    background-color: #3a3a3a;
}

.night-mode .custom-upload button {
    border-color: #444;
}

/* 侧边栏基础样式 */
.sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100%;
    background-color: #f9f9f9;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.3);
    transition: right 0.3s ease;
    padding: 20px;
    z-index: 1001;
    overflow-y: auto;
}

.sidebar h3 {
    color: white;
}

.sidebar-open {
    top: 0;
    right: 0;
    background-color: wheat;
}

.sidebar-close-btn {
    font-size: 24px;
    cursor: pointer;
    float: right;
    color: white;
}

.sidebar-example-name {
    color: white;
    margin-top: 32px;
}

.sidebar-example-image {
    width: 100%;
    margin-top: 20px;
}

.sidebar-info-icon {
    font-size: 14px;
    cursor: pointer;
    margin-left: 1px;
}

.sidebar-example-name-select {
    color: var(--orange);
}

.sidebar-example-image-select-border {
    border: 2px solid var(--orange);
}

@media (max-width: 768px) {

    body {
        padding: 6px;
    }

    .tab {
        padding: 6px 6px;
    }

    .sidebar {
        width: 100%;
    }

    .sidebar-info-icon {
        font-size: 12px;
    }
}