/* ========================================
   CSS Variables
======================================== */
:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --danger-color: #EF4444;
    --danger-hover: #DC2626;
    --success-color: #10B981;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-dark: #1F2937;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --sidebar-width: 300px;
    --navbar-height: 60px;
}

/* ========================================
   Reset & Base Styles
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    overflow-y: auto;
    min-height: 100vh;
    zoom: 1.4; /* 150%减10%=140% */
}

/* ========================================
   Login Page
======================================== */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 9999;
    zoom: 1;
}

.login-box {
    position: fixed;
    top: 50%;
    left: 50%;
    margin-left: -200px; /* 负的宽度的一半 (400px / 2) */
    margin-top: -250px; /* 根据实际高度调整 */
    width: 400px;
    background-color: var(--bg-primary);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 38px;
    cursor: pointer;
    font-size: 20px;
    user-select: none;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.btn-login {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-login:active {
    transform: translateY(0);
}

.login-error {
    padding: 12px;
    background-color: #FEE2E2;
    border-left: 3px solid var(--danger-color);
    border-radius: 4px;
    color: var(--danger-color);
    font-size: 14px;
}

.app-container {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ========================================
   Navbar
======================================== */
.navbar {
    height: var(--navbar-height);
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 100;
}

.navbar-left {
    display: flex;
    align-items: center;
}

.logo {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.user-avatar {
    font-size: 18px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.api-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--danger-color);
    animation: pulse 2s infinite;
}

.status-dot.active {
    background-color: var(--success-color);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========================================
   Main Container - 三栏布局
======================================== */
.main-container {
    display: flex;
    min-height: calc(100vh - var(--navbar-height));
    gap: 0;
}

/* ========================================
   Left Panel - 参数控制区 (20%)
======================================== */
.left-panel {
    width: 20%;
    min-width: 250px;
    background-color: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.left-panel::-webkit-scrollbar {
    width: 6px;
}

.left-panel::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

/* ========================================
   Middle Panel - 上传区域 (20%)
======================================== */
.middle-panel {
    width: 20%;
    min-width: 250px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.middle-panel::-webkit-scrollbar {
    width: 6px;
}

.middle-panel::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.upload-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: #FEF3C7; /* 浅黄色背景 */
    padding: 16px;
    border-radius: 8px;
}

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

/* ========================================
   Right Panel - 结果展示区 (50%)
======================================== */
.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-primary);
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 14px;
    color: var(--text-secondary);
}

.control-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: #F3F4F6; /* 浅灰色背景 */
    padding: 16px;
    border-radius: 8px;
}

.control-label {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.control-select,
.control-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: border-color 0.2s;
}

.control-select:focus,
.control-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.control-textarea {
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

.control-range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--primary-color)) no-repeat var(--border-color);
    background-size: 40% 100%;
    outline: none;
    -webkit-appearance: none;
}

.control-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--primary-color);
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.control-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-md);
}

/* 输入框+滑块组合 */
.input-with-range {
    display: flex;
    gap: 12px;
    align-items: center;
}

.control-input-number {
    width: 70px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    text-align: center;
    transition: border-color 0.2s;
}

.control-input-number:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-with-range .control-range {
    flex: 1;
}

/* ========================================
   Upload Area
======================================== */
.upload-box {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background-color: var(--bg-secondary);
    position: relative;
}

.upload-box:hover {
    border-color: var(--primary-color);
    background-color: #EEF2FF;
}

.upload-box.dragover {
    border-color: var(--primary-color);
    background-color: #EEF2FF;
}

.upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.upload-text {
    font-size: 16px;
    color: var(--text-secondary);
}

.upload-preview {
    position: relative;
    margin-top: 12px;
}

.upload-preview img {
    width: 100%;
    max-height: 150px;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: var(--shadow-md);
}

.upload-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--danger-color);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.upload-remove:hover {
    transform: scale(1.1);
}

/* ========================================
   Buttons
======================================== */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-settings {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    width: 100%;
}

.btn-danger:hover {
    background-color: var(--danger-hover);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-settings {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-logout {
    background-color: var(--danger-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.btn-logout:hover {
    background-color: var(--danger-hover);
}

.btn-icon {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.btn-icon:hover {
    background-color: var(--bg-secondary);
}

/* ========================================
   Progress Bar
======================================== */
.progress-bar {
    margin-top: 12px;
    height: 32px;
    background-color: var(--bg-secondary);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #8B5CF6);
    transition: width 0.3s;
    width: 0%;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 删除旧的 content-area 样式，已被 right-panel 替代 */

/* ========================================
   Tabs
======================================== */
.tabs {
    display: flex;
    gap: 2px;
    background-color: var(--bg-secondary);
    padding: 12px 24px 0;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background-color: transparent;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s;
}

.tab-btn:hover {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.tab-btn.active {
    background-color: var(--bg-primary);
    color: var(--primary-color);
    box-shadow: 0 -2px 0 var(--primary-color) inset;
}

/* ========================================
   Tab Content
======================================== */
.tab-content {
    flex: 1; /* Make tab-content fill remaining vertical space */
    background-color: var(--bg-primary);
    overflow: hidden; /* Ensure no double scrollbars */
    display: flex; /* Make it a flex container */
    flex-direction: column;
}

.tab-pane {
    display: none;
    width: 100%;
    flex: 1; /* Use flex to fill available space */
    min-height: 0; /* Allow shrinking to fit container */
    overflow-y: auto; /* Enable vertical scrolling */
    padding: 24px 24px 400px 24px; /* Extreme bottom padding to force content visibility */
}

.tab-pane.active {
    display: block;
}

.tab-pane::-webkit-scrollbar {
    width: 8px;
}

.tab-pane::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

/* ========================================
   Toolbar
======================================== */
.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

/* ========================================
   Results Grid (结果网格 - 3列布局)
======================================== */
.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 1200px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

.result-card {
    break-inside: avoid;
    margin-bottom: 20px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    position: relative;
}

.result-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.result-card-image {
    width: 100%;
    display: block;
    background-color: var(--bg-secondary);
    position: relative;
}

.result-card-image img {
    width: 100%;
    display: block;
}

.result-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.result-card-body {
    padding: 12px;
}

.result-card-prompt {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
    max-height: 60px;
    overflow: hidden;
}

.result-card-actions {
    display: flex;
    gap: 8px;
}

.result-card-actions button {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.result-card-actions button:hover {
    background-color: var(--border-color);
}

.result-card-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    z-index: 10;
}

/* 加载动画 */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* 骨架屏 */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, #E0E0E0 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========================================
   Prompt Cards
======================================== */
.prompt-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.prompt-card {
    padding: 16px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.prompt-card-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.prompt-card-text {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========================================
   History List
======================================== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-item {
    padding: 16px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.history-item-time {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.history-item-mode {
    font-size: 12px;
    color: var(--text-secondary);
}

.history-item-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}

.history-item-images img {
    width: 100%;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.history-item-images img:hover {
    transform: scale(1.05);
}

/* ========================================
   Modal
======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--bg-primary);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s;
}

.modal-large {
    max-width: 800px;
    max-height: 65vh; /* Adjusted max height to fit within viewport, considering zoom */
    overflow: hidden; /* Keep this to hide overall modal scrollbar */
    display: flex;
    flex-direction: column;
}

.modal-large .modal-body {
    flex: 1; /* Allow body to grow and shrink, taking available space */
    overflow-y: auto; /* Enable vertical scrolling for body content */
    min-height: 0; /* Important for flex items to shrink below their content size */
    padding-bottom: 20px; /* Add some padding to the bottom of the scrollable area */
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: var(--bg-secondary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.help-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ========================================
   Toast
======================================== */
.toast {
    position: fixed;
    top: 80px;
    right: 24px;
    background-color: var(--bg-dark);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* ========================================
   Mode Edit Items
======================================== */
.mode-edit-item {
    margin-bottom: 20px;
    padding: 16px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.mode-edit-item-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.mode-edit-item textarea {
    width: 100%;
    min-height: 100px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    resize: vertical;
    transition: border-color 0.2s;
}

.mode-edit-item textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ========================================
   API Test Result
======================================== */
.api-test-success {
    color: var(--success-color);
    padding: 8px;
    background-color: #ECFDF5;
    border-radius: 4px;
    border-left: 3px solid var(--success-color);
}

.api-test-error {
    color: var(--danger-color);
    padding: 8px;
    background-color: #FEE2E2;
    border-radius: 4px;
    border-left: 3px solid var(--danger-color);
}

.api-test-loading {
    color: var(--text-secondary);
    padding: 8px;
    background-color: var(--bg-secondary);
    border-radius: 4px;
}

/* ========================================
   Image Viewer (Lightbox)
======================================== */
.image-viewer {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.image-viewer-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-viewer-content {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    object-fit: contain;
}

.image-viewer-info {
    margin-top: 20px;
    width: 100%;
    max-width: 900px;
    color: #fff;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(15px);
    padding: 24px;
    border-radius: 12px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-row {
    display: flex;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row-full {
    flex-direction: column;
    align-items: flex-start;
}

.info-label {
    min-width: 130px;
    color: #9CA3AF;
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
}

.info-value {
    color: #F9FAFB;
    font-size: 14px;
    flex: 1;
}

.info-tag {
    background: var(--primary-color);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
}

.info-time {
    color: #D1D5DB;
    font-size: 13px;
}

.info-prompt {
    font-size: 13px;
    line-height: 1.7;
    color: #D1D5DB;
    margin-top: 8px;
    width: 100%;
    max-height: 150px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.info-prompt::-webkit-scrollbar {
    width: 6px;
}

.info-prompt::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.info-actions {
    margin-top: 18px;
    display: flex;
    gap: 12px;
}

.btn-detail-download {
    flex: 1;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-detail-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.image-viewer-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 3001;
}

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

/* ========================================
   Account Management
======================================== */
.form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.account-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-username {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.account-role {
    font-size: 12px;
    color: var(--text-secondary);
}

.account-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 账号操作按钮 - 统一基础样式 */
.account-btn {
    height: 32px;
    padding: 0 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.account-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.account-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 停用按钮 - 橙色 */
.account-btn-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.account-btn-warning:hover {
    background: linear-gradient(135deg, #D97706 0%, #B45309 100%);
}

/* 启用按钮 - 绿色 */
.account-btn-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.account-btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* 改密码按钮 - 蓝色 */
.account-btn-primary {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    padding: 0 10px;
}

.account-btn-primary:hover {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
}

/* 删除按钮 - 红色 */
.account-btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    padding: 0 10px;
}

.account-btn-danger:hover {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
}

/* ========================================
   Task Panel
======================================== */
.task-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    max-height: 400px;
    font-size: 13px;
    transition: transform 0.3s ease;
}

.task-panel.collapsed {
    transform: translateY(calc(100% - 40px));
}

.task-panel-header {
    padding: 10px 15px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.task-panel-title {
    font-weight: 600;
    color: var(--text-primary);
}

.task-panel-toggle {
    font-size: 12px;
    color: var(--text-secondary);
}

.task-list {
    overflow-y: auto;
    padding: 0;
    margin: 0;
    list-style: none;
    flex: 1;
}

.task-item {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: background-color 0.2s;
}

.task-item:last-child {
    border-bottom: none;
}

.task-item:hover {
    background-color: var(--bg-primary);
}

.task-item.active {
    background-color: rgba(37, 99, 235, 0.05);
    border-left: 3px solid var(--primary-color);
}

.task-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.task-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.task-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--border-color);
    color: var(--text-secondary);
}

.task-status.pending { background: #FEF3C7; color: #92400E; }
.task-status.processing { background: #DBEAFE; color: #1E40AF; }
.task-status.completed { background: #D1FAE5; color: #065F46; }
.task-status.failed { background: #FEE2E2; color: #B91C1C; }

.task-progress-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.task-progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.task-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
}

/* 适配暗色模式 */
@media (prefers-color-scheme: dark) {
    .task-panel {
        background: #1F2937;
        border-color: #374151;
    }
    .task-panel-header {
        background: #111827;
        border-color: #374151;
    }
    .task-item:hover {
        background-color: #374151;
/* =========================================
   历史记录网格布局 (New)
   ========================================= */
.history-date-group {
    margin-bottom: 30px;
}

.history-date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
    border-bottom: 2px solid #eee;
    margin-bottom: 15px;
}

.history-date-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.history-grid {
    display: flex;
    flex-wrap: nowrap;  /* 不换行，横向滚动 */
    overflow-x: auto;   /* 横向滚动 */
    overflow-y: hidden;
    gap: 10px;
    padding: 10px 0;
}

.history-grid::-webkit-scrollbar {
    height: 8px;
}

.history-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.history-grid::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.history-grid::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.history-card {
    flex: 0 0 150px;  /* 固定宽度150px，不换行 */
    min-width: 150px;
    height: 150px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.history-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.history-card-inner {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 正方形 */
    background: #f8f9fa;
    overflow: hidden;
}

.history-card-inner img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s;
}

.history-card:hover img {
    transform: scale(1.05);
}

/* 复选框定位 */
.history-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 18px;
    height: 18px;
    z-index: 10;
    cursor: pointer;
    accent-color: var(--primary-color);
    background: rgba(255,255,255,0.8);
    border-radius: 4px;
}

/* 悬浮遮罩层 */
.history-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none; /* 让点击穿透到img */
}

/* 仅在卡片悬浮时显示遮罩 */
.history-card:hover .history-card-overlay {
    opacity: 1;
    pointer-events: auto; /* 恢复交互 */
}

.history-card-mode {
    color: #fff;
    font-size: 10px;
    background: rgba(0,0,0,0.5);
    padding: 2px 6px;
    border-radius: 4px;
    align-self: flex-start;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-icon-download {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.25s ease;
}

.btn-icon-download:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.history-card-info {
    padding: 6px 8px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
}

.history-time {
    font-size: 12px;
    color: #888;
    font-family: monospace; /* 等宽字体显示时间更整齐 */
}

/* 响应式调整 - 已禁用，固定8列 */
/* @media (max-width: 1600px) {
    .history-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 1200px) {
    .history-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 992px) {
    .history-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
    .history-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
    .history-grid { grid-template-columns: repeat(2, 1fr); }
} */
