/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", "PingFang SC", sans-serif;
}
:root {
    --dark-bg: #0e0e0e;
    --panel-bg: #1a1a1a;
    --panel-bg-hover: #242424;
    --accent-pink: #f8a8b8;
    --accent-green: #d8e878;
    --text-primary: #f8f8f8;
    --text-secondary: #c8c8c8;
    --text-tertiary: #888888;
    --border-color: #2a2a2a;
    --input-bg: #242424;
    --input-border: #333333;
    --module-gap: 12px;
    --module-radius: 12px;
    --btn-gradient: linear-gradient(90deg, #f8a8b8 0%, #d8e878 100%);
    --border-gradient: linear-gradient(90deg, #f8a8b8, #d8e878);
    --light-flow-gradient: linear-gradient(90deg, transparent, rgba(248, 168, 184, 0.15), rgba(216, 232, 120, 0.2), rgba(248, 168, 184, 0.15), transparent);
    --neon-shadow: 0 0 8px rgba(248, 168, 184, 0.6), 0 0 12px rgba(216, 232, 120, 0.4);
    --module-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0e0e0e;
    color: #f8f8f8;
    min-height: 100vh;
    display: flex;
    overflow: hidden;
    height: 100vh;
}
/* 动画定义 */
@keyframes
spin {
    to { transform: rotate(360deg); }
}
@keyframes
fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes
pulse-ring {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.3); opacity: 0; }
}
/* ===== 主体布局容器 ===== */
.main-content-wrapper {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--module-gap);
    overflow: hidden;
    padding: 12px;
    min-width: 0;
}
.content-container {
    display: flex;
    flex: 1;
    gap: var(--module-gap);
    overflow: hidden;
    min-height: 0;
}
.left-center-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--module-gap);
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.top-row {
    display: flex;
    gap: var(--module-gap);
    flex: 1;
    min-height: 0;
}
.top-row .operation-panel {
    width: 340px;
    flex-shrink: 0;
}
.top-row .result-panel {
    flex: 1;
    min-width: 0;
}
/* ===== 左侧操作面板 ===== */
.operation-panel {
    border-radius: var(--module-radius);
    background-color: var(--panel-bg);
    padding: 16px;
    box-shadow: var(--module-shadow);
    overflow-y: auto;
}
.panel-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.panel-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}
.form-group {
    margin-bottom: 14px;
}
.form-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.form-input {
    width: 100%;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 10px;
    resize: none;
    font-size: 14px;
    transition: all 0.3s ease;
}
.form-input:focus {
    outline: none;
    border-color: var(--accent-pink);
    box-shadow: 0 0 6px rgba(248, 168, 184, 0.4);
}
.form-input:hover {
    border-color: var(--accent-green);
}
.char-count {
    text-align: right;
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.option-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.option-btn {
    padding: 6px 14px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
}
.option-btn:hover {
    border-color: var(--accent-green);
    color: var(--text-primary);
}
.option-btn.active {
    background-color: rgba(248, 168, 184, 0.2);
    color: var(--text-primary);
    border-color: rgba(248, 168, 184, 0.3);
}
.cost-preview {
    text-align: center;
    font-size: 14px;
    color: var(--accent-green);
    padding: 8px 0;
    background: rgba(216, 232, 120, 0.05);
    border-radius: 8px;
    margin: 20px 0;
}
.generate-btn {
    width: 100%;
    height: 44px;
    background: var(--btn-gradient);
    border: none;
    border-radius: 24px;
    color: #1a1a1a;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;

    transition: all 0.3s ease;
}
.generate-btn:hover {
    transform: translateY(-2px);

}
.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.generate-btn .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(26, 26, 26, 0.2);
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.generate-btn.loading .spinner { display: block; }
.generate-btn.loading .btn-text { display: none; }
/* ===== 上传组件 ===== */
.upload-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
}
.upload-item {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}
.upload-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.upload-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.upload-item .remove-btn:hover { background: #f87171; }
.upload-plus {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    background: rgba(30, 30, 30, 0.8);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
    user-select: none;
}
.upload-plus:hover {
    background: rgba(40, 40, 40, 0.9);
    border-color: rgba(248, 168, 184, 0.5);
    color: var(--text-primary);
    transform: scale(1.02);
}
/* ===== 结果展示面板 ===== */
.result-panel {
    border-radius: var(--module-radius);
    background-color: var(--panel-bg);
    padding: 16px;
    box-shadow: var(--module-shadow);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-shrink: 0;
}
.result-title {
    display: flex;
    align-items: center;
    gap: 8px;
}
.badge {
    font-size: 12px;
    padding: 4px 14px;
    border-radius: 20px;
    background: rgba(216, 232, 120, 0.10);
    color: var(--accent-green);
    border: 1px solid rgba(216, 232, 120, 0.10);
}
#galleryBody {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    gap: 12px;
}
.image-result {
    display: none;
    flex: 1;
    width: 100%;
    min-height: 0;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    align-items: center;
    justify-content: center;
}
.image-result.show { display: flex; }

.creation-card .card-header .header-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f8a8b8, #d8e878);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #1a1a1a;
    flex-shrink: 0;
}
.task-card .card-header .header-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: linear-gradient(135deg, #f8a8b8, #d8e878);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #000;
    flex-shrink: 0;
}

/* 图片网格 */
.image-grid {
    display: grid;
    gap: 12px;
    width: 100%;
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;
}

.image-item {
    aspect-ratio: 1 / 1;       /* 正方形，也可用 16/9 等 */
    background: rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.image-grid.single {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    max-height: 100%;
}
.image-grid.single .image-item {
    flex: 0 1 auto;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-grid.single .image-item img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.image-grid:not(.single) {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    width: 100%;
    height: 100%;
    max-height: 100%;
}
.image-grid:not(.single) .image-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-grid:not(.single) .image-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
/* 下载按钮 */
.image-item .download-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.35s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    backdrop-filter: blur(4px);
    z-index: 2;
}
.image-item .download-btn:hover {
    background: rgba(248, 168, 184, 0.4);
    color: var(--text-primary);
}
/* 占位与加载状态 */
.placeholder-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    padding: 40px 20px;
    width: 100%;
    height: 100%;
}
.placeholder-state .placeholder-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(248, 168, 184, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    color: var(--accent-pink);
    border: 1px solid rgba(248, 168, 184, 0.15);
}
.placeholder-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}
.placeholder-state p {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    max-width: 340px;
    line-height: 1.6;
}
.generating-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 40px 20px;
    width: 100%;
    height: 100%;
}
.generating-state.show { display: flex; }
.generating-state .pulse-ring {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid var(--accent-pink);
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    position: relative;
}
.generating-state .pulse-ring::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(248, 168, 184, 0.1);
    animation: pulse-ring 1.6s ease-in-out infinite;
}
.generating-state .gen-text {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
}
.generating-state .gen-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}
.generating-state .gen-progress .progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-pink), var(--accent-green));
    border-radius: 4px;
    transition: width 0.3s ease;
}
.progress-text {
    color: var(--accent-green);
    font-weight: 600;
    margin-top: 8px;
    font-size: 1rem;
}
.error-msg {
    color: #f87171;
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.15);
    padding: 16px 20px;
    border-radius: 12px;
    width: 100%;
    text-align: center;
}
/* ===== 右侧信息区 ===== */
.info-panel {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.info-panel::-webkit-scrollbar { display: none; }
.info-card,
.history-card {
    border-radius: var(--module-radius);
    background-color: var(--panel-bg);
    padding: 16px;
    box-shadow: var(--module-shadow);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.info-card::-webkit-scrollbar,
.history-card::-webkit-scrollbar { display: none; }
.info-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.info-item { margin-bottom: 8px; }
.info-label {
    font-size: 12px;
    color: var(--text-tertiary);
    display: block;
    margin-bottom: 4px;
}
.info-value {
    font-size: 12px;
    color: var(--text-primary);
    white-space: pre-line;
}
.info-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}
.copy-btn {
    width: 100%;
    padding: 8px;
    background-color: var(--panel-bg-hover);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}
.copy-btn:hover {
    border-color: var(--accent-green);
    color: var(--accent-green);
    box-shadow: 0 0 8px rgba(216, 232, 120, 0.3);
}
/* 历史记录 */
.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.history-more {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
}
.history-more:hover { color: var(--accent-green); }
.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}
.history-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    border-radius: 8px;
    background-color: var(--panel-bg-hover);
    transition: all 0.3s ease;
    cursor: pointer;
}
.history-item:hover {
    background-color: #2a2a2a;
    box-shadow: 0 0 8px rgba(248, 168, 184, 0.3);
}
.history-text {
    flex: 1;
    min-width: 0;
}
.history-desc {
    font-size: 12px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
    max-height: 2.8em;
}
.history-time {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 4px;
    display: block;
}
.history-thumbs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-top: 8px;
    width: 100%;
    max-width: 100%;
}
.history-thumbs .thumb-wrap {
    position: relative;
    padding-bottom: 100%;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
}
.history-thumbs .thumb-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
    border-radius: 4px;
    transition: 0.2s;
}
.history-thumbs .thumb-wrap img:hover {
    transform: scale(1.05);
    border: 1px solid var(--accent-green);
}
.history-thumbs .more-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    cursor: default;
}
.clear-btn {
    width: 100%;
    padding: 8px;
    background-color: var(--panel-bg-hover);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}
.clear-btn:hover {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
    box-shadow: 0 0 8px rgba(248, 168, 184, 0.3);
}
.history-empty {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    text-align: center;
    padding: 20px 0;
}
/* ===== 底部页脚 ===== */
.footer {
    text-align: center;
    padding: 8px 0;
    font-size: 11px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}
.footer:hover { color: var(--text-secondary); }
/* ===== Toast 消息提示 ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 28px;
    border-radius: 16px;
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    font-size: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.success { border-color: rgba(216, 232, 120, 0.3); }
.toast.error { border-color: rgba(248, 113, 113, 0.3); }
.toast.info { border-color: rgba(248, 168, 184, 0.3); }
/* ===== 预览模态框样式 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}
.modal-overlay.active {
    display: flex;
}
@keyframes
fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-overlay .modal-content {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    background: rgba(20, 20, 20, 0.55);
    backdrop-filter: blur(32px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.modal-overlay .modal-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 12px;
    display: block;
}
.modal-overlay .modal-content .modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
    padding: 2px 12px;
    border-radius: 8px;
    transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
    z-index: 10;
}
.modal-overlay .modal-content .modal-close:hover {
    background: rgba(248, 113, 113, 0.3);
}
.modal-overlay .modal-content .modal-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    width: 100%;
}
.modal-overlay .modal-content .modal-footer .btn-modal {
    padding: 8px 28px;
    border: none;
    border-radius: 30px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
}
.modal-overlay .modal-content .modal-footer .btn-modal.primary {
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-green));
    color: #1a1a1a;
    font-weight: 600;
}
.modal-overlay .modal-content .modal-footer .btn-modal.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 25px rgba(248, 168, 184, 0.2);
}
.modal-overlay .modal-content .modal-footer .btn-modal.primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.modal-overlay .modal-content .modal-footer .btn-modal.outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}
.modal-overlay .modal-content .modal-footer .btn-modal.outline:hover {
    border-color: var(--text-secondary);
}
/* ===== 任务列表样式（内部滚动，无滚动条） ===== */
.task-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 16px 18px;
    backdrop-filter: blur(8px);
    margin-top: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.task-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-shrink: 0;
}
.task-badge {
    background: rgba(248, 168, 184, 0.2);
    color: var(--text-secondary);
    font-size: 12px;
    border-radius: 20px;
    padding: 2px 12px;
}
.task-list-container {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.task-list-container::-webkit-scrollbar {
    display: none;
}
.task-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 8px;
}
.task-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 12px;
    border-left: 3px solid transparent;
    transition: 0.3s;
    flex-shrink: 0;
}
.task-item:hover {
    background: rgba(255, 255, 255, 0.05);
}
.task-item .task-status {
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 30px;
    display: inline-block;
}
.task-status.queued { background: #fbbf24; color: #000; }
.task-status.processing { background: var(--accent-pink); color: #1a1a1a; }
.task-status.completed { background: var(--accent-green); color: #1a1a1a; }
.task-status.failed { background: #f87171; color: #fff; }
.task-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.task-progress .progress-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--accent-pink), var(--accent-green));
    border-radius: 10px;
    flex: 1;
}
.task-progress .progress-text {
    font-size: 12px;
    color: var(--text-tertiary);
    min-width: 36px;
}
.task-prompt {
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.task-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
    flex-wrap: wrap;
}
.task-thumbnail {
    margin-top: 6px;
    max-width: 60px;
    max-height: 60px;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
}
.task-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.task-footer {
    margin-top: 12px;
    text-align: right;
    flex-shrink: 0;
}
.view-all-link {
    color: var(--accent-green);
    font-size: 13px;
    text-decoration: none;
}
.task-empty {
    color: var(--text-tertiary);
    text-align: center;
    padding: 20px 0;
    font-size: 14px;
}
.info-panel {
    display: flex;
}
.info-card {
    flex-shrink: 0;
}
/* ===== 额外样式：取消按钮和提示 ===== */
.btn-cancel {
    display: none;
    padding: 8px 24px;
    border-radius: 30px;
    border: 1px solid #f87171;
    background: transparent;
    color: #f87171;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-family: inherit;
}
.btn-cancel:hover {
    background: rgba(248, 113, 113, 0.1);
    box-shadow: 0 0 20px rgba(248, 113, 113, 0.1);
}
.btn-cancel.show {
    display: inline-block;
}
.timeout-hint {
    display: none;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 6px;
}
.timeout-hint.show {
    display: block;
}
.timeout-hint a {
    color: var(--accent-green);
    text-decoration: none;
}
.timeout-hint a:hover {
    text-decoration: underline;
}
/* ===== 历史记录中的状态徽章 ===== */
.status-badge {
    display: inline-block;
    padding: 1px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.8;
    color: #fff;
    border: none;
}
.status-badge.queued { background: #fbbf24; color: #000; }
.status-badge.processing { background: var(--accent-pink); color: #1a1a1a; }
.status-badge.completed { background: var(--accent-green); color: #1a1a1a; }
.status-badge.failed { background: #f87171; }
/* ===== 迷你进度条 ===== */
.progress-bar-mini {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
}
.progress-bar-mini .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-pink), var(--accent-green));
    border-radius: 4px;
    transition: width 0.3s;
}
/* ================================================================
   响应式布局
   ================================================================ */
@media
(max-width: 1200px) {
    body {
        padding: 8px;
        gap: 8px;
        height: auto;
        overflow-y: auto;
        flex-wrap: wrap;
    }
    .main-content-wrapper {
        height: auto;
        padding: 8px;
    }
    .content-container {
        flex-wrap: wrap;
    }
    .top-row {
        flex-wrap: wrap;
    }
    .top-row .operation-panel {
        width: 100%;
        flex-shrink: 0;
    }
    .top-row .result-panel {
        flex: 1 1 100%;
    }
    .info-panel {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .info-panel .info-card,
    .info-panel .history-card {
        flex: 1 1 45%;
    }
}
@media
(max-width: 768px) {
    .image-grid:not(.single) .image-item {
        flex: 0 0 calc(50% - 6px);
        max-width: calc(50% - 6px);
    }
    .info-panel .info-card,
    .info-panel .history-card {
        flex: 1 1 100%;
    }
    .main-content-wrapper {
        padding: 60px 16px 12px;
    }
}
@media
(max-width: 480px) {
    .image-grid:not(.single) .image-item {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

 /* 保持原有样式不变 */
        .generating-state .progress-bar { transition: width 0.3s ease; }
        .result-close-btn {
            position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
            border-radius: 50%; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1);
            color: #94A3B8; display: flex; align-items: center; justify-content: center;
            cursor: pointer; transition: all 0.2s ease; z-index: 10; font-size: 14px;
        }
        .result-close-btn:hover { background: rgba(255,255,255,0.15); color: #FFFFFF; }
        .image-result { position: relative; }
        .info-panel {
            width: 310px; flex-shrink: 0; display: flex; flex-direction: column; 
            overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; padding-right: 2px;
        }
        .info-panel::-webkit-scrollbar { display: none; }
        .creation-card { border-radius: 12px; padding: 18px 16px 16px; background-color: var(--panel-bg); }
        .creation-card .card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
        .creation-card .card-header .header-title { font-size: 15px; font-weight: 600; color: #FFFFFF; letter-spacing: 0.3px; }
        .creation-card .info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-bottom: 14px; }
        .creation-card .info-grid .info-item { display: flex; flex-direction: column; gap: 3px; }
        .creation-card .info-grid .info-item.full-width { grid-column: 1 / -1; }
        .creation-card .info-grid .info-item .info-label { font-size: 11px; color: #94A3B8; font-weight: 400; line-height: 1.5; letter-spacing: 0.2px; }
        .creation-card .info-grid .info-item .info-value { font-size: 13px; color: #E2E8F0; font-weight: 400; line-height: 1.5; }
        .creation-card .info-grid .info-item .info-value.prompt-value { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
        .creation-card .info-grid .info-item .info-value .expand-btn { font-size: 11px; color: #0EA5E9; cursor: pointer; background: none; border: none; padding: 0; font-family: inherit; opacity: 0.7; transition: opacity 0.2s; flex-shrink: 0; white-space: nowrap; }
        .creation-card .info-grid .info-item .info-value .expand-btn:hover { opacity: 1; }
        .creation-card .info-grid .info-item .info-value .empty-state { color: #64748B; font-style: normal; }
        .creation-card .copy-btn { width: 100%; padding: 8px; background: rgba(0, 0, 0, 0.15); border: 1px solid rgba(255, 255, 255, 0.03); border-radius: 8px; color: #94A3B8; cursor: pointer; font-size: 13px; font-family: inherit; transition: all 0.2s ease; }
        .creation-card .copy-btn:hover { background: rgba(14, 165, 233, 0.06); border-color: rgba(14, 165, 233, 0.15); color: #E2E8F0; }
        .task-card { background-color: var(--panel-bg); border-radius: 12px; padding: 18px 16px 14px; display: flex; flex-direction: column; flex: 1; min-height: 0; }
        .task-card .card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-shrink: 0; }
        .task-card .card-header .header-title { font-size: 15px; font-weight: 600; color: #FFFFFF; letter-spacing: 0.3px; }
        .task-card .card-header .header-stats { margin-left: auto; font-size: 12px; color: #94A3B8; background: rgba(255, 255, 255, 0.04); padding: 3px 12px; border-radius: 20px; white-space: nowrap; }
        .task-card .task-list-container { flex: 1; overflow-y: auto; overflow-x: hidden; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.2) transparent; padding-top: 10px; }
        .task-card .task-list-container::-webkit-scrollbar { width: 4px; }
        .task-card .task-list-container::-webkit-scrollbar-track { background: transparent; }
        .task-card .task-list-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 8px; }
        .task-card .task-list { display: flex; flex-direction: column; gap: 8px; padding-bottom: 4px; }
        .task-card .task-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(0, 0, 0, 0.2); border-radius: 8px; border-left: 3px solid transparent; transition: all 0.2s ease; cursor: pointer; border: none; border-bottom: 1px solid var(--input-border); margin-bottom: 10px; }
        .task-card .task-item:hover { background: rgba(255, 255, 255, 0.1); }
        .task-card .task-item.active-task { background: rgba(14, 165, 233, 0.1); }
        .task-card .task-item .task-thumb { width: 34px; height: 34px; border-radius: 6px; background: #1A2744; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #3A5A8A; font-size: 13px; overflow: hidden; }
        .task-card .task-item .task-thumb.has-media img { width: 100%; height: 100%; object-fit: cover; }
        .task-card .task-item .task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
        .task-card .task-item .task-body .task-name { font-size: 13px; color: #E2E8F0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; line-height: 1.4; }
        .task-card .task-item .task-body .task-status-row { display: flex; align-items: center; gap: 5px; }
        .task-card .task-item .task-body .task-status-row .status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
        .task-card .task-item .task-body .task-status-row .status-dot.queued { background: #F59E0B; box-shadow: 0 0 4px rgba(245, 158, 11, 0.4); }
        .task-card .task-item .task-body .task-status-row .status-dot.processing { background: #3B82F6; box-shadow: 0 0 4px rgba(59, 130, 246, 0.4); animation: pulse-dot 1.5s ease-in-out infinite; }
        .task-card .task-item .task-body .task-status-row .status-dot.completed { background: #34D399; box-shadow: 0 0 4px rgba(52, 211, 153, 0.4); }
        .task-card .task-item .task-body .task-status-row .status-dot.failed { background: #F87171; box-shadow: 0 0 4px rgba(248, 113, 113, 0.4); }
        @keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
        .task-card .task-item .task-body .task-status-row .status-text { font-size: 12px; color: #94A3B8; }
        .task-card .task-item .task-body .task-status-row .status-progress { font-size: 11px; color: #64748B; margin-left: auto; }
        .task-card .task-item .task-time { font-size: 11px; color: #475569; flex-shrink: 0; font-family: 'SF Mono', 'Consolas', monospace; letter-spacing: 0.3px; }
        .task-card .view-all-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 9px 0; background: rgba(0, 0, 0, 0.15); border: 1px solid rgba(255, 255, 255, 0.03); border-radius: 8px; color: #94A3B8; font-size: 13px; font-family: inherit; cursor: pointer; transition: all 0.2s ease; flex-shrink: 0; margin-top: 10px; }
        .task-card .view-all-btn:hover { background: rgba(14, 165, 233, 0.06); border-color: rgba(14, 165, 233, 0.15); color: #E2E8F0; }
        .task-card .view-all-btn i { font-size: 11px; transition: transform 0.2s; }
        .task-card .view-all-btn:hover i { transform: translateX(2px); }
        .task-card .empty-state { text-align: center; padding: 20px 0; color: #475569; font-size: 13px; }
        @media (max-width: 768px) {
            .info-panel { width: 100% !important; padding: 0 8px 12px !important; overflow-y: visible !important; max-height: none !important; }
            .creation-card { padding: 14px 12px !important; }
            .creation-card .info-grid { grid-template-columns: 1fr !important; gap: 8px 0 !important; }
            .creation-card .info-grid .info-item.full-width { grid-column: 1 !important; }
            .creation-card .info-grid .info-item .info-label { font-size: 10px !important; }
            .creation-card .info-grid .info-item .info-value { font-size: 12px !important; }
            .creation-card .copy-btn { font-size: 12px !important; padding: 6px !important; }
            .task-card { padding: 14px 12px !important; min-height: 200px !important; max-height: 50vh !important; }
            .task-card .card-header .header-title { font-size: 14px !important; }
            .task-card .card-header .header-stats { font-size: 11px !important; padding: 2px 10px !important; }
            .task-card .task-item { padding: 6px 8px !important; gap: 8px !important; }
            .task-card .task-item .task-thumb { width: 28px !important; height: 28px !important; font-size: 11px !important; }
            .task-card .task-item .task-body .task-name { font-size: 12px !important; max-width: 100px !important; }
            .task-card .task-item .task-body .task-status-row .status-text { font-size: 11px !important; }
            .task-card .task-item .task-body .task-status-row .status-progress { font-size: 10px !important; }
            .task-card .task-item .task-time { font-size: 10px !important; }
            .task-card .view-all-btn { font-size: 12px !important; padding: 7px 0 !important; margin-top: 8px !important; }
            .task-card .empty-state { font-size: 12px !important; padding: 16px 0 !important; }
        }
        .task-thumb img { cursor: pointer; }
        
        /* ===== 骨架屏效果 ===== */
.task-thumb.has-media.loading::before,
.image-item.loading::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.02) 25%, 
        rgba(255,255,255,0.08) 50%, 
        rgba(255,255,255,0.02) 75%);
    background-size: 200% 100%;
    animation: lumiShimmer 1.5s infinite;
    z-index: 2;
    pointer-events: none;
}
@keyframes lumiShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.task-thumb.has-media.loading img,
.image-item.loading img {
    opacity: 0;
    transition: opacity 0.3s;
}
.task-thumb.has-media:not(.loading) img,
.image-item:not(.loading) img {
    opacity: 1;
}

/* ===== 结果区骨架屏修复 ===== */
.image-grid .image-item {
    position: relative;
    overflow: hidden;
    min-height: 200px;          /* 提供初始高度，让骨架屏可见 */
    background: rgba(255,255,255,0.03); /* 轻微背景，防止完全透明 */
    border-radius: var(--radius-sm);
}

/* 确保伪元素能占满容器 */
.image-item.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.03) 25%, 
        rgba(255,255,255,0.10) 50%, 
        rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: lumiShimmer 1.5s infinite;
    z-index: 1;
    pointer-events: none;
}

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

.image-item.loading img {
    opacity: 0;
    transition: opacity 0.3s;
}

.image-item:not(.loading) img {
    opacity: 1;
}
/* 保证容器可以定位伪元素 */
.task-thumb.has-media,
.image-item {
    position: relative;
    overflow: hidden;
}
        .form-group input,
        .form-group textarea {
            width: 100%;
            padding: 12px 14px;
            background: rgba(0,0,0,0.2);
            font-size: 14px;
            font-family: inherit;
            transition: border-color 0.2s;
            resize: vertical;
        }
        .form-group input:focus,
        .form-group textarea:focus {
            outline: none;
        }
        .form-group textarea { min-height: 120px; }