* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.8rem;
    background: linear-gradient(90deg, #00d4ff, #7b2cbf, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(0, 212, 255, 0.3);
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.main-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
}

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}

.input-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    color: #e0e0e0;
    font-size: 14px;
}

.label-icon {
    font-size: 18px;
}

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 15px;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
    background: rgba(0, 0, 0, 0.6);
}

textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.6;
}

.btn {
    width: 100%;
    background: linear-gradient(135deg, #00d4ff 0%, #7b2cbf 100%);
    color: #fff;
    border: none;
    padding: 18px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 212, 255, 0.4);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.output-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 600px;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.output-title {
    font-size: 1.5rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.image-count {
    background: linear-gradient(135deg, #00d4ff, #7b2cbf);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

#status {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 15px;
    align-items: center;
    gap: 12px;
}

#status.loading {
    display: flex;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(123, 44, 191, 0.15));
    border: 1px solid rgba(0, 212, 255, 0.3);
}

#status.error {
    display: flex;
    background: rgba(255, 71, 87, 0.15);
    border: 1px solid rgba(255, 71, 87, 0.3);
}

#status.success {
    display: flex;
    background: rgba(46, 213, 115, 0.15);
    border: 1px solid rgba(46, 213, 115, 0.3);
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
}

.image-card {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s ease;
}

.image-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 212, 255, 0.3);
}

.image-wrapper {
    position: relative;
    background: linear-gradient(45deg, #1a1a2e 25%, transparent 25%),
                linear-gradient(-45deg, #1a1a2e 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #1a1a2e 75%),
                linear-gradient(-45deg, transparent 75%, #1a1a2e 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #0f0f1a;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.image-wrapper img.loaded {
    opacity: 1;
}

.image-loading {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: #666;
}

.image-number {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.image-actions {
    padding: 20px;
    display: flex;
    gap: 12px;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
}

.image-actions button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-actions button:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: #00d4ff;
    animation: spin 1s ease-in-out infinite;
}

.large-spinner {
    width: 50px;
    height: 50px;
    border-width: 4px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #444;
    text-align: center;
}

.empty-state-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 18px;
    margin-bottom: 10px;
}

.empty-state-hint {
    font-size: 14px;
    color: #333;
}

.settings-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #888;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.settings-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.advanced-settings {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.advanced-settings.show {
    display: block;
}

.advanced-settings .form-group {
    margin-bottom: 16px;
}

.advanced-settings .form-group:last-child {
    margin-bottom: 0;
}

.advanced-settings label {
    font-size: 13px;
    color: #888;
}

.advanced-settings input {
    padding: 12px;
    font-size: 13px;
}

.info-tag {
    display: inline-block;
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    margin-left: 8px;
}

.history-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.history-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-prompt {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    color: #888;
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-prompt:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
    color: #fff;
}

.debug-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.debug-toggle {
    background: none;
    border: none;
    color: #444;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
}

.debug-toggle:hover {
    color: #666;
}

.debug-content {
    display: none;
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 12px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: #888;
}

.debug-content.show {
    display: block;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.text-response {
    background: rgba(0, 0, 0, 0.3);
    padding: 24px;
    border-radius: 16px;
}

.text-response-header {
    color: #ffd700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.text-response-content {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.8;
    color: #ccc;
}
