body {
    font-family: Arial, sans-serif;
    background-image: url('./image/back.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    color: #fff;
    margin: 0;
    padding: 0;
    display: flex;
    height: 100vh;
}

.avatar-div {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #2f3236;
    padding: 16px;
}

img.avatar {
    width: 40px;
    height: 40px;
}

.container {
    display: flex;
    flex-grow: 1;
}

.sidebar {
    max-width: 230px;
    background-color: #19191D 70%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid #2f3236;
    padding-left: 12px;
    padding-right: 12px;
    max-height: 100vh;
    overflow: hidden;
}

.sidebar h2 {
    color: #888;
    display: flex;
    align-items: center;
    font-size: 16px;
}

.sidebar h2 img {
    border-radius: 50%;
    margin-right: 10px;
}

.sidebar ul {
    list-style: none;
    width: 200px;
    padding-inline-start: 0px;
    align-items: center;
    margin: 0;
    padding: 10px 0;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(37, 40, 55, 0.8) rgba(32, 33, 35, 0.3);
}

.sidebar ul::-webkit-scrollbar {
    width: 6px;
}

.sidebar ul::-webkit-scrollbar-track {
    background: linear-gradient(180deg, 
        rgba(32, 33, 35, 0.3) 0%, 
        rgba(25, 25, 27, 0.3) 100%
    );
    border-radius: 3px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sidebar ul::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, 
        rgba(37, 40, 55, 0.8) 0%, 
        rgba(79, 83, 102, 0.8) 100%
    );
    border-radius: 3px;
    border: 1px solid rgba(52, 54, 64, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sidebar ul::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, 
        rgba(47, 50, 65, 0.9) 0%, 
        rgba(89, 93, 112, 0.9) 100%
    );
}

.sidebar ul li {
    margin: 8px 0;
}

.sidebar ul li a {
    color: #aaa;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 5px;
    transition: background 0.3s;
}

.sidebar ul li a:hover {
    background: linear-gradient(226deg, #252837 0%, rgba(79, 83, 102, 0) 100%);
    border: 1px solid #2f3236;
}

.sidebar ul li a img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

.sidebar ul li a.active {
    background: linear-gradient(226deg, #252837 0%, rgba(79, 83, 102, 0) 100%);
    border: 1px solid #2f3236;
}

.main-content {
    display: flex;
    flex-grow: 1;
    padding: 24px;
    box-sizing: border-box;
}

.card {
    flex: 1;
    box-sizing: border-box;
    max-width: 364px;
    height: calc(100vh - 48px);
    padding: 24px;
    background: linear-gradient(226deg, #252837 0%, rgba(79, 83, 102, 0) 100%);
    border-radius: 24px;
    border: 1px solid #343640;
    backdrop-filter: blur(8px);
    margin: 0px 24px 24px 0;
    overflow: auto;
    position: relative;
    box-shadow: 0 4px 16px #02040d80;
}

.card-content {
    max-height: 300px;
    padding: 24px;
    overflow-y: auto;
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    border: 5px solid #f3f3f3;
    border-radius: 50%;
    border-top: 5px solid #3498db;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
}

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

.card-view {
    flex: 1;
    box-sizing: border-box;
    
    height: calc(100vh - 48px);
    padding: 24px;
    padding-left: 3%;
    padding-right: 3%;
    background: linear-gradient(226deg, #252837 0%, rgba(79, 83, 102, 0) 100%);
    border-radius: 24px;
    border: 1px solid #343640;
    backdrop-filter: blur(8px);
    margin: 0px 0px 24px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px #02040d80;
    max-width: 100%; /* 或其他具体的宽度 */
    overflow: hidden; /* 防止子元素溢出 */
    overflow-y: auto; /* 允许垂直滚动 */
    max-height: calc(100vh - 48px); /* 设置最大高度 */
}

.card-view .main-image {
    max-width: 30%;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
}

.card-view .images {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 16px;
    width: 100%;
    max-height: 110px; /* 设置一个最大高度，可以根据需要调整 */
    overflow: hidden; /* 防止图溢出 */
}

.card-view .images img {
    width: 100%;
    max-height: 100%;
    border-radius: 4px;
    object-fit: cover;
    margin: 0 5px;
}

.card .form-group {
    margin-bottom: 20px;
}

.card label {
    display: block;
    color: #aaa;
    
}

.card textarea {
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
    border: 1px solid #343640;
    border-radius: 5px;
    background: linear-gradient(226deg, #252837 0%, rgba(79, 83, 102, 0) 100%);
    color: #fff;
}

.card select {
    max-height: 150px;
    overflow-y: auto;
    padding: 10px;
    width: 100%;
    height: 36px;
    background: linear-gradient(226deg, #252837 0%, rgba(106, 114, 157, 0) 100%);
    border-radius: 8px;
    border: 1px solid #343640;
    padding: 10px;
    font-weight: 400;
    font-size: 14px;
    color: #9394a5;
    margin-bottom: 16px;
}

.card .generate-button {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 20px auto 0;
    width: 100%;
    height: 48px;
    line-height: 48px;
    text-align: center;
    font-weight: 400;
    font-size: 16px;
    color: #fff;
    border-radius: 12px;
    background: radial-gradient(231.94% 231.94% at 50% 100%, #8a6cff 0, rgba(53, 41, 128, 0) 25.24%), linear-gradient(180deg, rgb(33, 33, 33), rgb(32, 32, 32)), rgba(147, 130, 255, .01);
    box-shadow: 0 0 #10003366, 0 2px 5px #10003363, 0 8px 8px #10003357, 0 19px 11px #10003333, 0 34px 14px #1000330f, 0 53px 15px #10003303, inset 0 0 12px #ffffff14, inset 0 -8px 32px #1e0d49;
    border: 1px solid rgba(255, 255, 255, .25);
    cursor: pointer;
}

.card .generate-button:hover {
    background-color: #fff;
}

.card .images {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.card .images img {
    border-radius: 5px;
    object-fit: cover;
}


.card .main-image {
    height: 100px;
    height: auto;
    border-radius: 10px;
    margin-top: 20px;
}

#history-container {
    width: 100%;
}

#history-thumbnails img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 4px;
}

#history-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    max-height: 200px; /* 设置最大高度 */
    overflow-y: auto; /* 允许垂直滚动 */
}

/* 模态（背景） */
.modal {
    display: none; /* 隐藏默认 */
    position: fixed; /* 固定位置 */
    z-index: 1000; /* 显示在顶层 */
    padding: 0;
    left: 0;
    top: 0;
    width: 100%; /* 全宽 */
    height: 100%; /* 全高 */
    overflow: auto; /* 如果内容超出视窗，则滚动 */
    background-color: rgba(0,0,0,0.9); /* 黑色背景 */
}

/* 模态内容（图像） */
.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* 关闭按钮 */
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close:hover,

.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}
#progress-container {
    width: 261px;
    height: 26px;
    background-color: #120d18;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 20px;
    display: flex;
    align-items: center;
    position: relative;
    padding: 6px;
    box-shadow: 0 4px 10px #0003;
    border: 1px solid rgba(45, 33, 53, .7);
}

#progress-bar {
    height: 100%;
    background: linear-gradient(270deg,#9752e0 0%,#3e319e 100%);
    text-align: center;
    line-height: 26px;
    color: white;
    width: 0%; /* 初始宽度为0 */
    border-radius: 4px 4px 4px 4px; /* 只在左边角 */
    transition: width 0.5s ease; /* 平滑过渡 */
}

#progress-text {
    position: absolute;
    color: white;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
#queue-container{
    margin-top: 16px;
}

.upload-area {
    border: 1px solid #3e3e3e;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    color: #aaa;
    background: linear-gradient(226deg, #252837 0%, rgba(79, 83, 102, 0) 100%);
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.upload-area:hover {
    border-color: #555;
    color: #fff;
}

.upload-area.dragover {
    border-color: #4CAF50;
    color: #4CAF50;
}

.uploaded-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.toast {
    position: fixed;
    top: 30%;
    left: 50%;
    padding: 10px 20px;
    border-radius: 4px;
    color: white;
    opacity: 0;
    transition: opacity 0.3s;
}

.toast.show {
    opacity: 1;
}

.toast.info {
    background: linear-gradient(226deg, #252837 5%, rgba(79, 83, 102, 0) 100%);
    backdrop-filter: blur(16px);
    border: 1px solid #343640;
}

.toast.success {
    background: linear-gradient(226deg, #252837 5%, rgba(79, 83, 102, 0) 100%);
    backdrop-filter: blur(16px);
    border: 1px solid #343640;
}

.toast.error {
    background-color: #F44336;
}

.slider-container {
    display: flex;
    flex-direction: column;
    margin: 10px 0;
}

.slider-container label {
    margin-bottom: 5px;
}

.slider-wrapper {
    display: flex;
    align-items: center;
}

#base-multiplier-slider {
    flex-grow: 1;
    margin-right: 10px;
}

#base-multiplier-value {
    min-width: 40px;
    text-align: right;
}

/* 修改现有的 .modal 样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

/* 添加新的样式 */
.modal-content {
    background-color: #252837;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #343640;
    width: 300px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(2, 4, 13, 0.5);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.qr-code {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 20px;
}

.avatar {
    cursor: pointer;
    transition: transform 0.3s ease;
}

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

.avatar-touxiang {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    cursor: pointer;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(226deg, #252837 0%, rgba(79, 83, 102, 0.8) 100%);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #343640;
    width: 300px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(2, 4, 13, 0.5);
    backdrop-filter: blur(8px);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.qr-code {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* 图片查看弹窗样式 */
#image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    overflow: auto;
}

#image-modal .modal-content {
    margin: auto;
    display: block;
    width: auto;
    height: auto;
}

#image-modal .close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

#image-modal .close:hover,
#image-modal .close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* 二维码弹窗样式 */
#qrModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
}

#qrModal .modal-content {
    background: linear-gradient(226deg, #252837 0%, rgba(79, 83, 102, 0.8) 100%);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #343640;
    width: 300px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(2, 4, 13, 0.5);
    backdrop-filter: blur(8px);
}

#qrModal .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

#qrModal .close:hover,
#qrModal .close:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

#qrModal .qr-code {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.model-selection {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.label-container {
    display: flex;
    align-items: center; 
    margin-bottom: 16px;
}

.model-selection label {
    margin-right: 5px;
    line-height: 1; /* 确保文本行高与容器高度一致 */
}

#rem-mode-select {
    width: 100%;
    padding: 5px;
    font-size: 16px;
}
.upload-container{
    margin-bottom: 16px;
}

.tooltip-icon {
    display: inline-flex; /* 改为 inline-flex */
    justify-content: center; /* 水平居中 */
    align-items: center; /* 垂直居中 */
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #888;
    color: white;
    font-size: 12px;
    margin-left: 5px;
    cursor: help;
    position: relative;
}

.tooltip-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 12px;
    z-index: 1;
}

/* 在文件末尾添加以下样式 */

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        left: -230px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s ease;
        background-color: rgba(27, 27, 41, 0.95);
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        padding: 0px;
    }

    .card{
        max-width: none;
        margin: 24px 24px 24px 24px;
        height: auto;
    }
    .card-view {
        max-width: none;
        margin: 0px 24px 24px 24px;
        height: auto;
    }

    .menu-toggle {
        display: block;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1001;
        background: none;
        border: none;
        color: #fff;
        font-size: 24px;
        cursor: pointer;
    }

    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .overlay.active {
        display: block;
    }

    .main-content {
        flex-direction: column;
    }

    .card {
        order: 1; /* 将操作区放在上面 */
    }

    .card-view {
        order: 2; /* 将图片查看区放在下面 */
    }

    /* 调整传区域的高度 */
    .upload-area {
        height: 120px;
    }

    /* 调整主图片的大小 */
    .card-view .main-image {
        max-width: 100%;
        height: auto;
    }

    /* 调整历史记录区域 */
    #history-container {
        margin-top: 10px;
    }

    #history-thumbnails {
        justify-content: center;
    }

    #history-thumbnails img {
        width: 60px;
        height: 60px;
    }
}

/* 确保在桌面版中隐藏菜单按钮和遮罩层 */
@media (min-width: 769px) {
    .menu-toggle, .overlay {
        display: none;
    }
}

.cola-icon {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(226deg, #252837 0%, rgba(79, 83, 102, 0) 100%);
    border: 1px solid #2f3236;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(2, 4, 13, 0.5);
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cola-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(2, 4, 13, 0.6);
}

.cola-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .cola-icon {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
    
    .cola-icon img {
        width: 32px;
        height: 32px;
    }
}

/* 如果还没有modal相关的样式,请确保添加以下内容 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(226deg, #252837 0%, rgba(79, 83, 102, 0.8) 100%);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #343640;
    width: 300px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(2, 4, 13, 0.5);
    backdrop-filter: blur(8px);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.qr-code {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 20px;
}

.form-group textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #343640;
    border-radius: 5px;
    background: linear-gradient(226deg, #252837 0%, rgba(79, 83, 102, 0) 100%);
    color: #fff;
    resize: vertical; /* 允许垂直调整大小 */
    min-height: 80px; /* 设置最小高度 */
}

.form-group label {
    display: block; /* 使标签独占一行 */
    margin-bottom: 8px; /* 在标签下方添加间距 */
}

.form-group textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #343640;
    border-radius: 5px;
    background: linear-gradient(226deg, #252837 0%, rgba(79, 83, 102, 0) 100%);
    color: #fff;
    resize: vertical; /* 允许垂直调整大小 */
    min-height: 80px; /* 设置最小高度 */
}

.generate-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}
