:root {
    --bg-color: #0f172a;
    --sidebar-bg: rgba(30, 41, 59, 0.7);
    --card-bg: rgba(51, 65, 85, 0.5);
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: rgba(148, 163, 184, 0.1);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(12px);
    border-right: var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--accent-color);
}

.nav-links {
    list-style: none;
    flex: 1;
}

.nav-links li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.nav-links li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-links li.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.settings-trigger {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    margin-top: auto;
    border-top: var(--glass-border);
    padding-top: 1.5rem;
}

.settings-trigger:hover {
    color: var(--text-primary);
}

/* Sidebar Bottom — Status + Debug */
.sidebar-bottom {
    margin-top: auto;
    border-top: var(--glass-border);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.sidebar-status .status-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 50%;
    background: #ef4444;
    transition: all 0.3s;
}

.sidebar-status .status-dot.connected {
    background: #22c55e;
    box-shadow: 0 0 6px #22c55e;
}

.debug-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.debug-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.debug-toggle-btn.active {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

/* Debug Section (Tab Content) */
.debug-section {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid rgba(239, 68, 68, 0.2);
    background: rgba(10, 10, 20, 0.6);
}

.debug-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.08);
    border-bottom: 1px solid rgba(239, 68, 68, 0.15);
}

.debug-title {
    font-size: 0.85rem;
    color: #f87171;
    font-weight: 500;
}

.debug-actions {
    display: flex;
    gap: 0.5rem;
}

.debug-action-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.3rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.debug-action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.debug-log-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    font-size: 0.72rem;
    font-family: 'Consolas', 'Fira Code', monospace;
    color: #a5f3a5;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    min-height: 300px;
}

/* Main Content */
.content-area {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* API Key Bar */
.api-key-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bar-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
}

.api-key-bar .status-dot {
    width: 10px;
    height: 10px;
    min-width: 10px;
    border-radius: 50%;
    background-color: #ef4444;
    transition: all 0.3s ease;
}

.api-key-bar .status-dot.connected {
    background-color: #22c55e;
    box-shadow: 0 0 8px #22c55e;
}

.api-key-bar input[type="password"] {
    width: 220px;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.api-key-bar input[type="password"]:focus {
    outline: none;
    border-color: var(--accent-color);
}

.key-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.key-save-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    border: none;
    border-radius: 0.375rem;
    color: white;
    cursor: pointer;
    font-size: 0.8rem;
    white-space: nowrap;
    transition: transform 0.1s, box-shadow 0.2s;
}

.key-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.key-save-btn:active {
    transform: translateY(0);
}

/* Tabs */
.tab-content {
    display: none;
    /* Hidden by default */
    flex: 1;
    overflow-y: auto;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Generation Container Layout */
.generation-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    height: 100%;
}

.controls-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    padding: 1.5rem;
    border-radius: 1rem;
    border: var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: fit-content;
}

/* Inputs */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

textarea,
select,
input[type="text"],
input[type="password"] {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: white;
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
}

textarea {
    height: 120px;
}

textarea:focus,
input:focus,
select:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* 下拉选项样式 — 浅黄色背景 */
select option {
    background: #3d3a2e;
    color: #f8fafc;
    padding: 0.5rem;
}

select option:hover,
select option:checked {
    background: #5c5630;
    color: #fff;
}

/* Buttons */
.primary-btn {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    border: none;
    padding: 0.875rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

.primary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Preview Panel */
.preview-panel {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 1rem;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.preview-panel img,
.preview-panel video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* File Upload */
.file-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.file-upload-zone:hover {
    border-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.05);
}

.file-upload-zone img {
    max-width: 100%;
    max-height: 200px;
    display: none;
    margin-top: 1rem;
    border-radius: 0.25rem;
}

.file-upload-zone img.visible {
    display: block;
}



/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal {
    background: #1e293b;
    width: 500px;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    border: var(--glass-border);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 1rem 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
}

.close-btn:hover {
    color: white;
}

/* Gallery Notice */
.gallery-notice {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    margin-bottom: 1rem;
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.25);
    border-radius: 0.5rem;
    color: #fbbf24;
    font-size: 0.8rem;
    line-height: 1.5;
}

.gallery-notice i {
    font-size: 1rem;
    flex-shrink: 0;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.gallery-item {
    aspect-ratio: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
    border: var(--glass-border);
    cursor: zoom-in;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Gallery Overlay (prompt + model info on hover) */
.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    padding: 2.5rem 0.75rem 0.75rem;
    opacity: 0;
    transition: opacity 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-prompt {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.gallery-model {
    font-size: 0.6rem;
    color: var(--accent-color);
    opacity: 0.8;
}

/* Gallery Delete Button */
.gallery-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    background: rgba(239, 68, 68, 0.85);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.gallery-item:hover .gallery-delete-btn {
    opacity: 1;
}

.gallery-delete-btn:hover {
    transform: scale(1.15);
    background: #ef4444;
}

/* Gallery Empty State */
.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.gallery-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.gallery-empty p {
    font-size: 0.95rem;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    animation: fadeIn 0.2s ease;
    cursor: zoom-out;
}

.lightbox-overlay.hidden {
    display: none;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    cursor: default;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 90vw;
}

.lightbox-info p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    max-width: 600px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lightbox-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--accent-color);
    color: white;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s;
}

.lightbox-download-btn:hover {
    background: var(--accent-hover);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(12px);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    border: var(--glass-border);
    border-left: 4px solid var(--accent-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    pointer-events: auto;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.success {
    border-left-color: #22c55e;
}

.toast i {
    font-size: 1.25rem;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        left: 0;
        border-right: none;
        border-top: var(--glass-border);
        padding: 0.5rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        background: rgba(15, 23, 42, 0.95);
    }

    .logo {
        display: none;
    }

    .nav-links {
        display: flex;
        justify-content: space-around;
        width: 100%;
        margin: 0;
    }

    .nav-links li {
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.75rem;
        padding: 0.5rem;
        margin: 0;
        border-radius: 0.5rem;
    }

    .nav-links li i {
        font-size: 1.25rem;
    }

    .settings-trigger {
        display: none;
        /* Accessible via other means or simplify for mobile */
        /* For now, maybe add settings as a tab or keep hidden on mobile MVP */
    }

    /* Add a Settings icon to the nav for mobile if needed, 
       but for now let's make the last item Settings or keep it simple.
       Actually, let's keep Settings Trigger but move it into the flex row */

    .settings-trigger {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.75rem;
        padding: 0.5rem;
        margin: 0;
        border-top: none;
        align-items: center;
    }

    .content-area {
        padding: 1rem;
        padding-bottom: 80px;
        /* Space for bottom nav */
        overflow-y: auto;
    }

    .generation-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .preview-panel {
        min-height: 300px;
        order: -1;
        /* Preview on top for mobile? Or keep bottom? Standard is controls top. Keep default order. */
    }

    .modal {
        width: 90%;
    }
}

/* Multi-Image Upload Grid */
.multi-upload-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.image-grid-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
}

.image-grid-item:hover {
    border-color: var(--accent-color);
}

.image-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-grid-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.image-grid-item:hover .remove-btn {
    opacity: 1;
}

.add-image-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-image-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.add-image-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

/* ============================================
   Travel Agent — 旅拍智能体
   ============================================ */

.travel-page {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-bottom: 2rem;
}

.travel-section {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    padding: 1.5rem;
    border-radius: 1rem;
    border: var(--glass-border);
}

.travel-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.travel-section-title i {
    color: var(--accent-color);
}

/* Material Row — 人物上传 + 换装开关 */
.travel-material-row {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

/* Upload Zone (通用) */
.travel-upload-zone {
    width: 180px;
    height: 180px;
    border: 2px dashed rgba(148, 163, 184, 0.2);
    border-radius: 0.75rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.travel-upload-zone:hover {
    border-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.05);
}

.upload-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.upload-placeholder i {
    font-size: 2rem;
    opacity: 0.5;
}

.upload-placeholder span {
    font-size: 0.8rem;
}

.upload-hint {
    font-size: 0.65rem !important;
    opacity: 0.6;
}

.upload-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.5rem;
}

.upload-clear-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.85);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
    z-index: 2;
}

.upload-clear-btn:hover {
    transform: scale(1.15);
    background: #ef4444;
}

/* Toggle Switch — iOS 风格 */
.travel-toggle-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.5rem;
}

.toggle-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.travel-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    display: inline-block;
}

.travel-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.travel-toggle input:checked + .toggle-slider {
    background: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.travel-toggle input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

/* Dressup Area */
.dressup-area {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dressup-btn {
    max-width: 200px;
}

/* Dressup Upload Row — 商品图 + 产品名输入 */
.dressup-upload-row {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.dressup-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 0.5rem;
}

.dressup-config-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.dressup-config-row .input-group {
    flex: 1;
}

/* Travel / Prompt Card Config Row — 水平排列 */
.travel-config-row {
    display: flex;
    gap: 0.75rem;
}

.travel-config-row .input-group {
    flex: 1;
}

.prompt-card-config-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.config-chip {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    padding: 0.3rem 0.55rem 0.3rem 0.65rem;
    transition: border-color 0.2s, background 0.2s;
}

.config-chip:hover {
    border-color: var(--accent-color);
    background: rgba(var(--accent-rgb, 99, 102, 241), 0.1);
}

.config-chip i {
    font-size: 0.7rem;
    color: var(--accent-color);
    flex-shrink: 0;
}

.config-chip select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.75rem;
    padding: 0.15rem 0;
    cursor: pointer;
    outline: none;
    min-width: 40px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Dressup Results — 横向滚动 */
.dressup-results h4 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.dressup-thumbs {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.dressup-thumbs::-webkit-scrollbar {
    height: 4px;
}

.dressup-thumbs::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.dressup-thumbs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.dressup-thumb {
    flex-shrink: 0;
    width: 140px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dressup-thumb img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: zoom-in;
    transition: border-color 0.2s, transform 0.2s;
}

.dressup-thumb img:hover {
    border-color: var(--accent-color);
    transform: scale(1.03);
}

.thumb-actions {
    display: flex;
    gap: 0.35rem;
}

.thumb-actions button {
    flex: 1;
    padding: 0.35rem 0.4rem;
    font-size: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.35rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.thumb-btn-delete {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.thumb-btn-delete:hover {
    background: rgba(239, 68, 68, 0.3);
}

.thumb-btn-add {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.thumb-btn-add:hover {
    background: rgba(59, 130, 246, 0.3);
}

/* Travel Gen Row — 参考图 + 配置 */
.travel-gen-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.travel-ref-zone {
    width: 200px;
    height: 200px;
}

.travel-gen-config {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Prompt Cards */
.prompt-cards-container {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.prompt-cards-title {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prompt-cards-title i {
    color: var(--accent-color);
}

.prompt-cards-title span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.prompt-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.prompt-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 1rem;
    transition: border-color 0.2s;
}

.prompt-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.prompt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.prompt-card-num {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-color);
}

.prompt-card-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.prompt-card textarea {
    width: 100%;
    min-height: 80px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
}

.prompt-card textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.prompt-card-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.prompt-gen-img-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border: none;
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.prompt-gen-img-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.prompt-gen-img-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Prompt Card Result Image */
.prompt-card-result {
    margin-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 0.75rem;
}

.prompt-card-result img {
    max-width: 300px;
    max-height: 300px;
    object-fit: contain;
    border-radius: 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: zoom-in;
    transition: border-color 0.2s, transform 0.2s;
}

.prompt-card-result img:hover {
    border-color: var(--accent-color);
    transform: scale(1.02);
}

.prompt-card-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 1rem 0;
}

.prompt-card-loading .spinner {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

/* Prompt Result Grid — 多图横向排列 */
.prompt-result-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.prompt-result-slot {
    min-width: 120px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.5rem;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.prompt-result-slot img {
    max-width: 260px;
    max-height: 260px;
    object-fit: contain;
    border-radius: 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: zoom-in;
    transition: border-color 0.2s, transform 0.2s;
}

.prompt-result-slot img:hover {
    border-color: var(--accent-color);
    transform: scale(1.02);
}

.prompt-result-slot .prompt-card-loading {
    padding: 0.5rem;
}

/* ============================================
   万能提示词生成器 (Prompt Generator)
   ============================================ */

.prompt-gen-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.5rem;
    height: 100%;
}

/* 输入面板 */
.prompt-gen-input-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    padding: 1.5rem;
    border-radius: 1rem;
    border: var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: fit-content;
}

.prompt-gen-input-panel .section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prompt-gen-input-panel .section-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: -0.5rem;
}

/* 模式切换按钮组 */
.pg-mode-toggle {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.pg-mode-btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.pg-mode-btn:hover {
    border-color: var(--accent-color);
    color: var(--text-primary);
}

.pg-mode-btn.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-color);
    color: var(--accent-color);
    font-weight: 500;
}

/* 结果面板 */
.prompt-gen-result-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
}

/* 空状态 */
.pg-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: var(--text-secondary);
    gap: 1rem;
}

.pg-empty-state i {
    font-size: 3rem;
    opacity: 0.3;
}

.pg-empty-state p {
    font-size: 0.9rem;
    opacity: 0.6;
}

/* 结果块 */
.pg-result-block {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border-radius: 0.75rem;
    border: var(--glass-border);
    overflow: hidden;
}

.pg-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pg-result-header h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pg-copy-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    font-size: 0.72rem;
    border-radius: 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.pg-copy-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* 字段卡片网格 */
.pg-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0.5rem;
}

.pg-field-card {
    display: grid;
    grid-template-columns: 130px 1fr;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
}

.pg-field-card:last-child {
    border-bottom: none;
}

.pg-field-card:hover {
    background: rgba(255, 255, 255, 0.03);
}

.pg-field-key {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: capitalize;
    letter-spacing: 0.02em;
    word-break: break-word;
}

.pg-field-value {
    background: rgba(0, 0, 0, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 0.35rem !important;
    padding: 0.4rem 0.6rem !important;
    font-size: 0.78rem !important;
    color: var(--text-primary) !important;
    width: 100%;
}

.pg-field-value:focus {
    border-color: var(--accent-color) !important;
}

/* 自然语言文本区 */
.pg-result-block textarea {
    width: 100%;
    border: none;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.1);
    padding: 1rem;
    font-size: 0.85rem;
    line-height: 1.6;
    resize: vertical;
    color: var(--text-primary);
}

/* 一键生图栏 */
.pg-gen-image-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border-radius: 0.75rem;
    border: var(--glass-border);
}

.pg-gen-image-bar .primary-btn {
    flex: 1;
}

/* 生成的图片 */
.pg-image-result {
    background: var(--card-bg);
    border-radius: 0.75rem;
    border: var(--glass-border);
    padding: 1rem;
    text-align: center;
}

.pg-generated-img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.pg-generated-img:hover {
    transform: scale(1.01);
}

/* 上传清除按钮 */
.upload-clear-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.8);
    color: white;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: background 0.2s;
}

.upload-clear-btn:hover {
    background: #ef4444;
}

.file-upload-zone {
    position: relative;
}