body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    padding: 20px;
}
.container-fluid {
    max-width: 1400px;
    padding: 0 20px;
}
.main-content {
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}
.title {
    color: #333;
    margin-bottom: 30px;
    font-weight: 700;
    display: inline-block;
}
.image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 500px;
    background-color: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    position: relative;
}
.result-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
    object-fit: contain;
}
.spinner-border {
    width: 3rem;
    height: 3rem;
}
.prompt-textarea {
    min-height: 120px;
    font-size: 16px;
    resize: vertical;
    box-shadow: none !important;
    border: 1px solid #ced4da;
}
.prompt-textarea:focus {
    border-color: #86b7fe;
}
.generate-btn {
    font-weight: 600;
    padding: 10px 25px;
    font-size: 16px;
    background: linear-gradient(45deg, #6a11cb, #2575fc);
    border: none;
    transition: all 0.3s;
}
.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background: linear-gradient(45deg, #5a00c2, #1565eb);
}
.generate-btn:disabled {
    background: linear-gradient(45deg, #a594b8, #94a8c5);
    transform: none;
    box-shadow: none;
}
.api-key-input {
    font-family: monospace;
}
.status-message {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}
.footer {
    text-align: center;
    font-size: 14px;
    color: #999;
    margin-top: 30px;
}
#errorAlert {
    display: none;
    margin-top: 15px;
}
.form-label {
    font-weight: 500;
    margin-top: 10px;
}
.download-btn {
}
.request-id {
    font-family: monospace;
    color: #666;
    font-size: 12px;
}
.settings-btn {
    position: relative;
    top: 0;
    right: 0;
    float: right;
    cursor: pointer;
    font-size: 24px;
    color: #555;
    transition: color 0.3s;
}
.settings-btn:hover {
    color: #0d6efd;
}
.settings-container {
    margin-bottom: 20px;
}
.options-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.07);
    margin-bottom: 20px;
    overflow: hidden;
}
.options-card .card-header {
    background-color: #f4f8ff;
    font-weight: 600;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 15px 20px;
    font-size: 16px;
}
.options-card .card-body {
    padding: 20px;
    background-color: #fcfcfc;
}
.no-api-key-warning {
    position: absolute;
    top: 10px;
    right: 50px;
    z-index: 1000;
    display: none;
}
.image-gallery {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
    width: 100%;
}
.image-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    height: 300px;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.image-item:hover img {
    transform: scale(1.03);
}
.image-item img.square {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.image-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    padding: 12px;
    display: flex;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    transform: translateY(10px);
    backdrop-filter: blur(5px);
}
.image-item:hover .image-actions {
    opacity: 1;
    transform: translateY(0);
}
.image-actions .btn {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    border: none;
}
.model-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 50px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0.8;
    transition: opacity 0.3s, transform 0.3s;
}
.image-item:hover .model-badge {
    opacity: 1;
    transform: translateY(-3px);
}
.model-option {
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 18px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
}
.model-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #bbd6fe;
}
.model-option.selected {
    border-color: #0d6efd;
    background: linear-gradient(145deg, #f0f7ff, #e6f0fd);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.15);
}
.model-option::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 14px;
    background: linear-gradient(to right, #0d6efd, #6610f2);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}
.model-option.selected::before {
    opacity: 0.2;
}
.model-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.model-title {
    font-weight: 600;
    font-size: 17px;
    margin: 0;
    color: #333;
}
.model-option.selected .model-title {
    color: #0d6efd;
}
.model-desc {
    color: #666;
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}
.model-edit-btn {
    position: absolute;
    right: 15px;
    bottom: 15px;
    padding: 5px 14px;
    font-size: 13px;
    border-radius: 50px;
    background-color: transparent;
    border: 1px solid #ddd;
    color: #666;
    transition: all 0.25s;
    display: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
.model-option:hover .model-edit-btn {
    display: block;
}
.model-edit-btn:hover {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(13, 110, 253, 0.25);
}
.model-option.selected .model-edit-btn {
    border-color: #0d6efd;
    color: #0d6efd;
}
.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}
/* 大图查看模态框 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.9);
    transition: opacity 0.3s ease;
    opacity: 0;
    backdrop-filter: blur(5px);
}
.image-modal.show {
    opacity: 1;
}
.modal-content {
    position: relative;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    max-width: 100%;
    padding: 60px 20px 100px;
    box-sizing: border-box;
}
.modal-content img {
    max-width: 100%;
    max-height: calc(100vh - 160px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    cursor: default;
    user-select: none;
    -webkit-user-drag: none;
}
.modal-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateY(0);
    opacity: 0.8;
}
.modal-controls:hover {
    opacity: 1;
    transform: translateY(-5px);
}
.modal-info {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 15px 60px 15px 20px;
    color: white;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateY(0);
    opacity: 0.8;
}
.modal-info:hover {
    opacity: 1;
    transform: translateY(5px);
}
.modal-caption {
    margin: 0;
    font-size: 16px;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.modal-subcaption {
    margin: 5px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}
.close-modal {
    position: absolute;
    top: 12px;
    right: 20px;
    color: #f1f1f1;
    font-size: 30px;
    font-weight: bold;
    transition: 0.3s;
    z-index: 2001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.close-modal:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
    cursor: pointer;
}
.modal-btn {
    background-color: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.modal-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}
.modal-btn i {
    font-size: 16px;
}
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 3px;
}
.zoom-level {
    color: white;
    font-size: 14px;
    min-width: 40px;
    text-align: center;
}
.image-navigator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    pointer-events: none;
}
.nav-btn {
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: auto;
    opacity: 0.7;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
    opacity: 1;
    transform: scale(1.1);
}
.nav-btn.disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
    transform: scale(0.9);
}
.modal-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2002;
    display: none;
}
/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100%;
    background-color: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1900;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}
.sidebar.open {
    right: 0;
}
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    background-color: #f8f9fa;
}
.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}
.sidebar-close {
    font-size: 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
}
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f8f9fa;
}
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}
.sidebar-content::-webkit-scrollbar-track {
    background: #f8f9fa;
}
.sidebar-content::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 6px;
}
.sidebar-footer {
    padding: 12px 15px;
    border-top: 1px solid #eee;
    background-color: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sidebar-btn {
    padding: 5px 12px;
    font-size: 14px;
}
.history-empty {
    text-align: center;
    padding: 40px 0;
    color: #999;
    font-size: 14px;
}
.history-empty i {
    font-size: 40px;
    margin-bottom: 10px;
    color: #ddd;
    display: block;
}
.history-item {
    margin-bottom: 18px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #eee;
    transition: all 0.2s ease;
    background-color: white;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.history-item:hover {
    border-color: #ddd;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}
.history-img-container {
    height: 180px;
    overflow: hidden;
    position: relative;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.history-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: pointer;
}
/* 为方形图片添加特殊样式 */
.history-img.square {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.history-img:hover {
    transform: scale(1.05);
}
.history-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 30px 10px 10px;
    color: white;
    font-size: 13px;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.history-actions {
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
}
.history-date {
    font-size: 12px;
    color: #888;
}
.history-action-btns {
    display: flex;
    gap: 8px;
}
.history-action-btn {
    border: none;
    background: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    border-radius: 4px;
    transition: all 0.2s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.history-action-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333;
    transform: translateY(-2px);
}
.history-action-btn.view-btn:hover {
    color: #0d6efd;
}
.history-action-btn.download-btn:hover {
    color: #198754;
}
.history-action-btn.delete-btn:hover {
    color: #dc3545;
}
.toggle-sidebar {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #0d6efd;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 1800;
    transition: all 0.3s;
}
.toggle-sidebar:hover {
    background-color: #0b5ed7;
    transform: translateY(-3px) rotate(15deg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
}
.toggle-sidebar i {
    font-size: 20px;
}
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1800;
    display: none;
}
.overlay.show {
    display: block;
}
.clear-confirm {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 2100;
    max-width: 90%;
    width: 400px;
}
.clear-confirm.show {
    display: block;
}
.clear-confirm-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}
.clear-confirm-message {
    margin-bottom: 20px;
    color: #555;
}
.clear-confirm-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.api-key-container {
    position: relative;
    border-radius: 10px;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid rgba(0,0,0,0.05);
}
.api-key-input-group {
    display: flex;
    position: relative;
}
.api-key-input {
    font-family: monospace;
    border-radius: 8px;
    padding-right: 40px;
    border: 1px solid #ced4da;
    transition: all 0.3s ease;
}
.api-key-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
    border-color: #86b7fe;
}
.toggle-password {
    position: absolute;
    right: 3px;
    top: 3px;
    bottom: 3px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    border-radius: 0 6px 6px 0;
    transition: all 0.2s ease;
}
.toggle-password:hover {
    color: #495057;
    background-color: rgba(0,0,0,0.03);
}
.settings-modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}
.settings-modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 15px 20px;
}
.settings-modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding: 15px 20px;
}
.save-api-btn {
    background: linear-gradient(45deg, #0d6efd, #0b5ed7);
    border: none;
    font-weight: 500;
    padding: 8px 20px;
    transition: all 0.3s;
}
.save-api-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.2);
} 