﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(180deg, #FFF9E6 0%, #FFE0B2 100%); /* 鏆栬壊娓愬彉鑳屾櫙 */
    background-attachment: fixed;
    color: #2d3748;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

/* Original drawing workspace: three-column layout */
#originalPageView .main-content {
    display: grid;
    grid-template-columns: repeat(3, 450px);
    column-gap: 24px;
    row-gap: 12px;
    align-items: start;
}

#originalPageView .left-panel {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#originalPageView .middle-panel {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#originalPageView .middle-settings-panel {
    height: 1000px;
    min-height: 1000px;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #FFF8E1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#originalPageView .middle-settings-panel::-webkit-scrollbar,
#originalPageView .result-body::-webkit-scrollbar {
    display: none;
}

#originalPageView .middle-settings-panel .params-card,
#originalPageView .middle-settings-panel .prompt-card {
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    background: transparent;
}

#originalPageView .middle-settings-panel .prompt-card {
    border-top: 1px solid #f1d9a6;
    position: relative;
}

#originalPageView .middle-settings-panel .prompt-card::before {
    content: 'image';
    position: absolute;
    top: -13px;
    left: 50%;
    z-index: 1;
    min-width: 78px;
    padding: 3px 16px;
    border: 1px solid #f1d9a6;
    border-radius: 999px;
    background: #fff8e1;
    color: #c05621;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    transform: translateX(-50%);
}

#originalPageView .middle-settings-panel .card h3 {
    background: transparent;
}

#originalPageView .middle-settings-panel .card-body {
    padding-top: 20px;
}

#originalPageView .middle-settings-panel .params-card .card-body {
    padding-top: 5px;
}

#originalPageView .middle-settings-panel .prompt-card .card-body {
    padding-top: 5px;
}

#originalPageView .middle-settings-panel .action-bar {
    position: static;
    margin: 0 20px 20px;
    padding-top: 12px;
    border-top: 1px solid #f1d9a6;
}

#originalPageView .upload-card {
    height: 600px;
    min-height: 600px;
}

#originalPageView .upload-card .card-body {
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#originalPageView .upload-card .card-body::-webkit-scrollbar {
    display: none;
}

#originalPageView .right-panel {
    grid-column: 3;
    grid-row: 2;
    min-width: 0;
}

#originalPageView .result-card {
    height: 1000px;
    min-height: 1000px;
    display: flex;
    flex-direction: column;
}

#originalPageView .result-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#originalPageView #resultImages {
    min-height: 0;
    overflow: visible;
    padding-right: 6px;
}

#originalPageView #resultImages .result-group-container {
    margin-bottom: 16px !important;
}

#originalPageView #resultImages .image-grid-container {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
}

#originalPageView #resultImages .generated-image {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
}

#originalPageView #resultImages .generated-image + .btn-result-action {
    display: block;
}

#originalPageView .model-selection-container {
    gap: 14px;
}

#originalPageView .model-selection-container {
    display: block;
}

#originalPageView .model-column + .model-column {
    margin-top: 14px;
}

#originalPageView .model-column select {
    width: 100%;
}

#originalPageView .reference-upload-grid {
    display: block;
}

#originalPageView .reference-upload-tip {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
    padding: 10px 13px;
    border: 1px solid #fbd38d;
    border-radius: 10px;
    background: #fffaf0;
    color: #7b341e;
    font-size: 0.82rem;
    line-height: 1.45;
}

#originalPageView .reference-upload-tip > span:first-child {
    flex: 0 0 auto;
}

#originalPageView .reference-slot-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
    border: 2px dashed #fbd38d;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.55);
}

#originalPageView .reference-upload-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3px;
    margin-top: 12px;
    min-height: 57px;
    box-sizing: border-box;
    padding: 9px 7px;
    border: 1px solid #fbd38d;
    border-radius: 10px;
    background: #fffaf0;
    color: #7b341e;
    font-size: 0.82rem;
    font-weight: 700;
}

#originalPageView .reference-upload-status > span {
    flex: 0 0 auto;
    white-space: nowrap;
}

#originalPageView .reference-upload-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    flex: 0 0 auto;
    flex-wrap: nowrap;
}

#originalPageView .reference-upload-generated,
#originalPageView .reference-upload-more,
#originalPageView .reference-upload-clear {
    border: 1px solid transparent;
    min-height: 30px;
    border-radius: 6px;
    padding: 5px 6px;
    font: inherit;
    font-size: 0.72rem;
    line-height: 1.1;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

#originalPageView .reference-upload-generated:hover,
#originalPageView .reference-upload-more:hover,
#originalPageView .reference-upload-clear:hover {
    transform: translateY(-1px);
}

#originalPageView .reference-upload-generated {
    border-color: #93c5fd;
    background: #dbeafe;
    color: #1d4ed8;
}

#originalPageView .reference-upload-generated:hover {
    background: #bfdbfe;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.16);
}

#originalPageView .reference-upload-more {
    border-color: #f6c56e;
    background: #fff1d6;
    color: #c2410c;
}

#originalPageView .reference-upload-more:hover {
    background: #ffe8b5;
    box-shadow: 0 4px 10px rgba(194, 65, 12, 0.14);
}

#originalPageView .reference-upload-clear {
    border-color: #dc2626;
    background: #ef4444;
    color: #fff;
}

#originalPageView .reference-upload-clear:hover {
    background: #dc2626;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.2);
}

#originalPageView .prompt-description-label {
    display: none;
}

#originalPageView .prompt-editor-shell {
    position: relative;
    margin-top: -4px;
}

#originalPageView .prompt-mode-hint {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    margin-left: auto;
    padding: 7px 12px;
    border: 1px solid #fbd38d;
    border-radius: 9px;
    color: #d97706;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.35;
}

#originalPageView .prompt-mode-generate {
    background: #fff4d9;
}

#originalPageView .prompt-mode-edit {
    background: #fff1d9;
    color: #c56a08;
}

#originalPageView .prompt-mode-hint-icon {
    flex: 0 0 auto;
    font-size: 0.82rem;
    line-height: 1;
}

#originalPageView .middle-settings-panel .prompt-card h3 {
    flex-wrap: wrap;
}

@media (max-width: 520px) {
    #originalPageView .prompt-mode-hint {
        flex-basis: 100%;
        margin-left: 0;
    }
}

#originalPageView .prompt-editor-shell textarea#prompt {
    width: 100%;
    min-height: 130px;
    padding: 13px 44px 38px 13px;
    border: 2px solid #a9783a;
    border-radius: 10px;
    background: #fffdf7;
    box-shadow: inset 0 1px 2px rgba(120, 53, 15, 0.08);
    resize: vertical;
}

#originalPageView .prompt-editor-shell textarea#prompt:focus {
    border-color: #c05621;
    outline: 3px solid rgba(192, 86, 33, 0.14);
}

#originalPageView .quick-prompts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin-bottom: 8px;
}

#originalPageView .quick-prompts-header label {
    margin: 0;
    font-weight: 700;
}

#originalPageView .quick-prompts-header .prompt-library-open-btn {
    flex: 0 0 auto;
    margin: 0;
    padding: 5px 10px;
    font-size: 0.74rem;
}

#originalPageView .prompt-corner-action {
    position: absolute;
    bottom: 8px;
    z-index: 1;
    min-height: 22px;
    padding: 3px 8px;
    border: 1px solid #e2c38b;
    border-radius: 999px;
    background: #fff7e6;
    color: #9a3412;
    cursor: pointer;
    font-size: 0.68rem;
    line-height: 1.15;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    white-space: nowrap;
}

#originalPageView .prompt-corner-action:hover {
    background: #ffedd5;
    transform: translateY(-1px);
}

#originalPageView .prompt-corner-action span:first-child {
    font-size: 0.62rem;
    line-height: 1;
}

#originalPageView .prompt-clear-action {
    left: 6px;
}

#originalPageView .prompt-save-action {
    left: 62px;
}

#originalPageView .prompt-expand-action {
    right: 6px;
}

.prompt-editor-modal[hidden] {
    display: none;
}

.prompt-editor-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(45, 55, 72, 0.38);
    backdrop-filter: blur(4px);
}

.prompt-editor-dialog {
    width: min(760px, 100%);
    padding: 20px;
    border: 1px solid #f1d9a6;
    border-radius: 16px;
    background: #fff8e1;
    box-shadow: 0 20px 48px rgba(120, 53, 15, 0.24);
}

.prompt-editor-header,
.prompt-editor-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.prompt-editor-header h3 {
    color: #7b341e;
    font-size: 1.05rem;
}

.prompt-editor-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #ffedd5;
    color: #9a3412;
    cursor: pointer;
    font-size: 1.2rem;
}

.prompt-editor-textarea {
    display: block;
    width: 100%;
    min-height: 360px;
    margin: 16px 0;
    padding: 14px;
    border: 2px solid #a9783a;
    border-radius: 10px;
    background: #fffdf7;
    color: #2d3748;
    font: inherit;
    line-height: 1.6;
    resize: vertical;
}

.prompt-editor-textarea:focus {
    border-color: #c05621;
    outline: 3px solid rgba(192, 86, 33, 0.14);
}

.prompt-editor-actions {
    justify-content: flex-end;
}

.prompt-editor-cancel,
.prompt-editor-save {
    border: 1px solid #e2c38b;
    border-radius: 8px;
    padding: 8px 18px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.prompt-editor-cancel {
    background: #fffdf7;
    color: #7b341e;
}

.prompt-editor-save {
    border-color: #f59e0b;
    background: #f59e0b;
    color: #fff;
}

#originalPageView .reference-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

#originalPageView .reference-slot {
    position: relative;
    min-width: 0;
    overflow: hidden;
    aspect-ratio: 1 / 0.88;
    border: 2px dashed #fbd38d;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    color: #718096;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

#originalPageView .reference-slot:hover,
#originalPageView .reference-slot:focus-visible {
    border-color: #ff9f1c;
    background: #fff3e0;
    color: #e65100;
    transform: translateY(-1px);
    outline: none;
}

#originalPageView .reference-slot.has-image {
    padding: 0;
    border-style: solid;
    background: #fff;
}

#originalPageView .reference-slot-icon {
    color: #ff9f1c;
    font-size: 1.8rem;
    line-height: 1;
}

#originalPageView .reference-slot-label {
    font-size: 0.82rem;
    font-weight: 600;
}

#originalPageView .reference-slot-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

#originalPageView .reference-slot-action {
    position: absolute;
    z-index: 2;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    background: rgba(45, 55, 72, 0.78);
    color: #fff;
    cursor: pointer;
    font-size: 0.88rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

#originalPageView .reference-slot:hover .reference-slot-action,
#originalPageView .reference-slot:focus-within .reference-slot-action {
    opacity: 1;
}

#originalPageView .reference-slot.has-image .reference-slot-action {
    opacity: 1;
}

#originalPageView .reference-slot-action:hover {
    transform: scale(1.08);
}

#originalPageView .reference-slot-save {
    left: 6px;
    top: 6px;
    background: rgba(22, 163, 74, 0.88);
}

#originalPageView .reference-slot-delete {
    right: 6px;
    top: 6px;
    background: rgba(220, 38, 38, 0.88);
}

#originalPageView .reference-slot.is-drag-over {
    border-color: #f97316;
    background: #fff7ed;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.16);
}

/* 临时素材悬浮面板 */
#originalPageView .temporary-materials-dock {
    position: fixed;
    left: 0;
    top: calc(50% - 10px);
    z-index: 11000;
    transform: translateY(-50%);
}

#originalPageView .temporary-materials-toggle {
    position: relative;
    z-index: 3;
    width: 49px;
    height: 96px;
    min-height: 96px;
    box-sizing: border-box;
    padding: 9px 5px;
    border: 1px solid #fbd38d;
    border-left: none;
    border-radius: 0 13px 13px 0;
    background: linear-gradient(180deg, #fffaf0 0%, #fff1cf 100%);
    color: #7b341e;
    cursor: pointer;
    opacity: 0.5;
    box-shadow: 6px 6px 16px rgba(180, 83, 9, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

#originalPageView .temporary-materials-toggle-icon {
    font-size: 0.9rem;
}

#originalPageView .temporary-materials-toggle-label {
    writing-mode: vertical-rl;
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

#originalPageView .prompt-library-toggle {
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    z-index: 2;
}

#originalPageView .prompt-library-dock-panel {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 12000;
    width: min(390px, calc(100vw - 12px));
    height: min(960px, calc(100dvh - 24px));
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    grid-template-rows: 40px minmax(0, 1fr) 28px;
    padding: 0;
    border: 1px solid #ffdda6;
    border-radius: 0 16px 16px 0;
    background: #fffbea;
    box-shadow: 8px 12px 32px rgba(120, 53, 15, 0.18);
    overflow: hidden;
    transform: translate(-104%, 0);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.18s ease, opacity 0.18s ease, visibility 0.18s ease;
}

#originalPageView .prompt-library-dock-panel.is-open {
    transform: translate(0, 0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#originalPageView .prompt-dock-header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    padding: 6px 10px 6px 14px;
    align-items: center;
    background: #fffaf0;
    border-bottom: 1px solid #fbd38d;
}

#originalPageView .prompt-dock-header h2 {
    font-size: 14px;
    color: #92400e;
}

#originalPageView .prompt-library-dock-panel .temporary-materials-close {
    margin-left: auto;
    width: 28px;
    height: 28px;
    background: transparent;
    color: #c05621;
    font-size: 1.3rem;
}

#originalPageView .prompt-dock-sidebar {
    grid-row: 2 / 4;
    border-right: 1px solid #ffebc3;
    padding: 10px 5px;
    overflow-y: auto;
}

#originalPageView .prompt-dock-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    padding: 10px;
}

#originalPageView .prompt-dock-sidebar button,
#originalPageView #promptDockNewTag {
    width: 100%;
    min-width: 0;
    padding: 7px 3px;
    margin-bottom: 6px;
    border: 1px solid #ffdda6;
    border-radius: 6px;
    font-size: 11px;
    color: #9a3412;
    background: #fffdf7;
    overflow-wrap: anywhere;
    cursor: pointer;
}

#originalPageView .prompt-dock-sidebar button[aria-pressed="true"] {
    background: #ff9f1c;
    color: white;
}

#originalPageView .prompt-dock-tag-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    color: #c05621;
    font-size: 12px;
}

#originalPageView .prompt-dock-tag-row label {
    flex-shrink: 0;
    margin: 0;
    font-size: inherit;
}

#originalPageView .prompt-dock-create-tab {
    cursor: pointer;
    font-weight: 800;
    text-align: center;
}

#originalPageView .prompt-dock-compose {
    display: flex;
    gap: 8px;
}

#originalPageView .prompt-dock-compose textarea,
#originalPageView .prompt-dock-search input,
#originalPageView .prompt-dock-select {
    min-width: 0;
    height: 26px;
    border: 1px solid #fbd38d;
    border-radius: 10px;
    background: #fffdf7;
    color: #7b341e;
    font: inherit;
    font-size: 0.78rem;
}

#originalPageView .prompt-dock-compose textarea {
    flex: 1;
    height: 42px;
    min-height: 42px;
    padding: 8px;
    resize: vertical;
    line-height: 1.4;
}

#originalPageView .prompt-dock-compose button {
    border: none;
    border-radius: 10px;
    padding: 0 12px;
    background: #f6c56e;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

#originalPageView .prompt-dock-select {
    flex: 1;
    width: 0;
    margin: 0;
    padding: 0 10px;
}

#originalPageView .prompt-dock-search {
    position: relative;
    margin-top: 8px;
}

#originalPageView .prompt-dock-search span {
    position: absolute;
    left: 10px;
    top: 50%;
    color: #a9783a;
    transform: translateY(-50%);
}

#originalPageView .prompt-dock-search input {
    width: 100%;
    padding: 0 10px;
}

#originalPageView .prompt-dock-list {
    flex: 1;
    min-height: 0;
    margin-top: 10px;
    overflow-y: auto;
    scrollbar-width: none;
}

#originalPageView .prompt-dock-list::-webkit-scrollbar {
    display: none;
}

#originalPageView .prompt-dock-empty {
    padding: 36px 8px;
    color: #d69e2e;
    font-size: 0.82rem;
    text-align: center;
}

#originalPageView .prompt-dock-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 3px;
    position: relative;
    margin-bottom: 6px;
    padding: 6px 7px;
    border: 1px solid #fbd38d;
    border-radius: 8px;
    background: #fffdf7;
    color: #7b341e;
    cursor: default;
}

#originalPageView .prompt-dock-item-title {
    grid-column: 1 / -1;
    font-weight: 400;
    font-size: 0.72rem;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

#originalPageView .prompt-dock-item-tag {
    justify-self: start;
    display: inline-block;
    margin-top: 2px;
    padding: 1px 5px;
    border-radius: 999px;
    background: #fff1d6;
    color: #c2410c;
    font-size: 0.6rem;
}

#originalPageView .prompt-dock-item-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    flex-wrap: wrap;
}

#originalPageView .prompt-dock-item-actions button {
    border: 1px solid #fbd38d;
    border-radius: 7px;
    padding: 3px 6px;
    background: #fffdf7;
    cursor: pointer;
    font: inherit;
    font-size: 0.64rem;
    font-weight: 700;
}

#originalPageView .prompt-dock-item-use {
    border-color: #f59e0b !important;
    background: #f59e0b !important;
    color: #fff;
}

#originalPageView .prompt-dock-item-copy {
    color: #0891b2;
}

#originalPageView .prompt-dock-item-delete {
    color: #dc2626;
}

#originalPageView .prompt-dock-item-actions button:hover {
    filter: brightness(0.96);
    transform: translateY(-1px);
}

#originalPageView .prompt-dock-item-delete:hover {
    background: #fff1f2;
}

#originalPageView .prompt-dock-item-delete {
    position: static;
    cursor: pointer;
}

#originalPageView .prompt-dock-footer {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 10px;
    border-top: 1px solid #fbd38d;
    color: #c05621;
    font-size: 0.72rem;
}

#originalPageView #promptDockClearAll {
    border: 0;
    background: transparent;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
}

#originalPageView .temporary-materials-count {
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    border-radius: 999px;
    background: #f59e0b;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 15px;
    text-align: center;
}

#originalPageView .temporary-materials-panel {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 11000;
    width: 330px;
    height: 500px;
    max-height: calc(100vh - 28px);
    box-sizing: border-box;
    padding: 16px;
    border: 1px solid #fbd38d;
    border-radius: 0 18px 18px 0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 12px 16px 36px rgba(120, 53, 15, 0.18);
    display: flex;
    flex-direction: column;
    transform: translateX(-104%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
}

#originalPageView .temporary-materials-panel.is-open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#originalPageView .temporary-materials-header {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: start;
    gap: 8px;
}

#originalPageView .temporary-materials-header h2 {
    color: #1f2937;
    font-size: 1.08rem;
}

#originalPageView .temporary-materials-header p {
    margin-top: 4px;
    color: #718096;
    font-size: 0.78rem;
    line-height: 1.4;
}

#originalPageView .temporary-materials-help,
#originalPageView .temporary-materials-close {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 800;
}

#originalPageView .temporary-materials-help {
    background: #ffedd5;
    color: #c2410c;
}

#originalPageView .temporary-materials-close {
    background: #f8fafc;
    color: #64748b;
}

#originalPageView .temporary-materials-tip {
    display: flex;
    justify-content: space-between;
    margin: 14px 0 10px;
    padding: 10px 12px;
    border: 1px dashed #fbd38d;
    border-radius: 12px;
    color: #9a3412;
    font-size: 0.82rem;
    cursor: pointer;
}

#originalPageView .temporary-materials-tip:focus-visible {
    outline: 3px solid rgba(249, 115, 22, 0.35);
    outline-offset: 2px;
}

#originalPageView .temporary-materials-guide {
    position: absolute;
    top: 54px;
    right: 8px;
    z-index: 4;
    width: min(282px, calc(100% - 16px));
    margin: 0;
    padding: 12px;
    border: 1px solid #f3d39a;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 26px rgba(120, 53, 15, 0.18);
    color: #4b5563;
    font-size: 0.74rem;
    line-height: 1.45;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-5px) scale(0.98);
    transform-origin: top right;
    transition: opacity 0.16s ease, visibility 0.16s ease, transform 0.16s ease;
}

#originalPageView .temporary-materials-guide.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

#originalPageView .temporary-materials-guide.is-pinned {
    pointer-events: auto;
}

#originalPageView .temporary-materials-guide strong {
    display: block;
    margin-bottom: 8px;
    color: #1f2937;
    font-size: 0.84rem;
}

#originalPageView .temporary-materials-guide p {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: start;
    gap: 7px;
    margin: 6px 0 0;
}

#originalPageView .temporary-materials-guide p span:last-child {
    min-width: 0;
}

#originalPageView .guide-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

#originalPageView .guide-tag-orange {
    background: #ffeadb;
    color: #c2410c;
}

#originalPageView .guide-tag-pink {
    background: #ffe3eb;
    color: #be185d;
}

#originalPageView .guide-tag-blue {
    background: #e0ecff;
    color: #2563eb;
}

#originalPageView .guide-tag-green {
    background: #dff5ec;
    color: #047857;
}

#originalPageView .guide-tag-amber {
    background: #ffedc7;
    color: #b45309;
}

#originalPageView .guide-tag-purple {
    background: #eee4ff;
    color: #7c3aed;
}

#originalPageView .temporary-materials-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: max-content;
    align-content: start;
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding: 2px;
    scrollbar-width: none;
}

#originalPageView .temporary-materials-grid::-webkit-scrollbar {
    display: none;
}

#originalPageView .temporary-materials-panel.is-drag-over,
#originalPageView:has(.temporary-materials-panel.is-drag-over) .temporary-materials-toggle {
    border-color: #f97316;
}

#originalPageView .temporary-materials-panel.is-drag-over {
    background: #fff7ed;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.14), 12px 16px 36px rgba(120, 53, 15, 0.18);
}

#originalPageView .temporary-material-item {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid #fbd38d;
    border-radius: 10px;
    background: #fffaf0;
    cursor: grab;
}

#originalPageView .temporary-material-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

#originalPageView .temporary-material-actions {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 3px;
    padding: 5px;
    background: rgba(30, 41, 59, 0.52);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.16s ease, visibility 0.16s ease;
}

#originalPageView .temporary-material-item:hover .temporary-material-actions,
#originalPageView .temporary-material-item:focus-within .temporary-material-actions {
    opacity: 1;
    visibility: visible;
}

#originalPageView .temporary-material-actions button {
    min-width: 0;
    min-height: 0;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.94);
    color: #7b341e;
    cursor: pointer;
    font: inherit;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

#originalPageView .temporary-material-actions button:hover {
    background: #fff7ed;
    transform: translateY(-1px);
}

#originalPageView .temporary-material-action-delete {
    color: #dc2626 !important;
}

#originalPageView .temporary-materials-empty {
    grid-column: 1 / -1;
    padding: 28px 8px;
    color: #a0aec0;
    text-align: center;
    font-size: 0.82rem;
}

#originalPageView .temporary-materials-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex: 0 0 auto;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ffedc7;
    color: #a0aec0;
    font-size: 0.75rem;
}

#originalPageView .temporary-materials-footer button {
    border: none;
    border-radius: 10px;
    padding: 7px 12px;
    background: #fff1e6;
    color: #c2410c;
    cursor: pointer;
    font-weight: 800;
}

@media (max-width: 640px) {
    #originalPageView .temporary-materials-panel {
        width: min(330px, calc(100vw - 18px));
        height: min(500px, calc(100vh - 18px));
        max-height: calc(100vh - 18px);
    }
}

@media (max-width: 1180px) {
    #originalPageView .main-content {
        grid-template-columns: minmax(230px, 0.8fr) minmax(330px, 1fr);
        column-gap: 18px;
        row-gap: 12px;
    }

    #originalPageView .left-panel {
        grid-column: 1;
        grid-row: 2;
    }

    #originalPageView .middle-panel {
        grid-column: 2;
        grid-row: 2;
    }

    #originalPageView .right-panel {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    #originalPageView .result-card {
        height: 1000px;
        min-height: 1000px;
    }
}

@media (max-width: 1024px) {
    #originalPageView .main-content {
        grid-template-columns: minmax(0, 1fr);
    }

    #originalPageView .left-panel,
    #originalPageView .middle-panel,
    #originalPageView .right-panel {
        grid-column: 1;
        grid-row: auto;
    }

    #originalPageView .middle-settings-panel {
        height: 1000px;
        min-height: 1000px;
    }

    #originalPageView .result-card {
        height: 1000px;
        min-height: 1000px;
    }
}

@media (max-width: 768px) {
    #originalPageView .left-panel > .config-card {
        order: 1;
    }

    #originalPageView .left-panel > .upload-card {
        order: 2;
    }
}

.container {
    max-width: 1518px; /* 为绘画页 450px 三列布局预留空间 */
    margin: 0 auto;
    padding: 0 40px; /* 澧炲姞涓や晶鍐呰竟璺?*/
}

/* 椤堕儴鏍囬 */
.header-section {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #2d3436;
    margin-bottom: 10px;
    letter-spacing: -0.025em;
}

.header-logo {
    height: 48px;
    width: auto;
    vertical-align: middle;
    margin-right: 12px;
    margin-bottom: 6px;
}

.subtitle {
    color: #718096;
    font-size: 1.1rem;
}

.language-switch {
    width: fit-content;
    max-width: calc(100% - 24px);
    margin: 18px auto 0;
    padding: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid #fbd38d;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(237, 137, 54, 0.12);
}

.language-btn {
    min-width: 78px;
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    background: transparent;
    color: #7b341e;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-btn:hover {
    background: rgba(255, 247, 237, 0.95);
}

.language-btn.active {
    background: linear-gradient(135deg, #FFAA00 0%, #FF8800 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(255, 136, 0, 0.2);
}

.recharge-link {
    min-width: 88px;
    border-radius: 999px;
    padding: 8px 14px;
    background: rgba(102, 126, 234, 0.1);
    color: #4c51bf;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.recharge-link:hover {
    background: rgba(102, 126, 234, 0.18);
    color: #3c366b;
    box-shadow: 0 8px 18px rgba(102, 126, 234, 0.16);
}

/* 涓诲竷灞€锛氬乏鍙冲垎鏍?*/
.main-content {
    display: grid;
    grid-template-columns: 500px 1fr; /* 榛勯噾姣斾緥璋冩暣锛屽姞瀹藉乏渚ч潰鏉?*/
    gap: 35px;
    margin-bottom: 40px;
    align-items: start;
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.right-panel {
    min-width: 0;
}

/* 椤甸潰妯″紡鍒囨崲 */
.page-mode-switch {
    width: min(760px, 100%);
    margin: -8px auto 28px;
    padding: 8px;
    display: flex;
    gap: 10px;
    justify-content: center;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(10px);
    border: 1px solid #fbd38d;
    border-radius: 22px;
    box-shadow: 0 12px 28px rgba(237, 137, 54, 0.12);
}

.page-mode-btn {
    flex: 1;
    min-height: 56px;
    border: none;
    border-radius: 16px;
    background: transparent;
    color: #7b341e;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.25s ease;
}

.page-mode-btn:hover {
    background: rgba(255, 247, 237, 0.95);
    transform: translateY(-1px);
}

.page-mode-btn.active {
    background: linear-gradient(135deg, #FFAA00 0%, #FF8800 100%);
    color: #fff;
    box-shadow: 0 12px 24px rgba(255, 136, 0, 0.22);
}

.page-mode-btn-icon {
    font-size: 1.05rem;
    line-height: 1;
}

#originalPageView,
#batchPageView,
#canvasPageView {
    width: 100%;
}

#originalPageView.shared-docks-only > .main-content {
    display: none;
}

#originalPageView.shared-docks-only {
    height: 0;
    min-height: 0;
}

.canvas-page-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.canvas-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #fbd38d;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 28px rgba(237, 137, 54, 0.1);
}

.canvas-toolbar-title {
    color: #7b341e;
    font-size: 0.95rem;
    font-weight: 800;
}

.canvas-expand-btn {
    border: 1px solid #f6ad55;
    border-radius: 12px;
    background: linear-gradient(135deg, #FFAA00 0%, #FF8800 100%);
    color: #fff;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 800;
    min-height: 38px;
    padding: 0 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.canvas-expand-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(255, 136, 0, 0.18);
}

.canvas-app-frame {
    display: block;
    width: 100%;
    height: calc(100vh - 210px);
    min-height: 720px;
    border: 1px solid #fbd38d;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(237, 137, 54, 0.12);
}

body.canvas-expanded-body {
    overflow: hidden;
}

.canvas-page-view.canvas-expanded {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 10px;
    background: #ffffff;
}

.canvas-page-view.canvas-expanded .canvas-toolbar {
    flex-shrink: 0;
    border-radius: 12px 12px 0 0;
    box-shadow: none;
}

.canvas-page-view.canvas-expanded .canvas-app-frame {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: none;
}

.batch-page-view {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.batch-top-grid {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.batch-shared-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.batch-shared-settings-actions {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.batch-shared-settings-tip {
    margin: 0;
    color: #9c4221;
    font-size: 0.82rem;
    line-height: 1.7;
}

.batch-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 16px 20px;
    border: 1px solid #fbd38d;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 24px rgba(237, 137, 54, 0.08);
}

.batch-toolbar-stats {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    color: #7b341e;
    font-size: 0.92rem;
    font-weight: 600;
}

.batch-toolbar-stats strong {
    color: #dd6b20;
    font-size: 1rem;
}

.batch-toolbar-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.batch-primary-btn,
.batch-secondary-btn {
    border: none;
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.25s ease;
}

.batch-primary-btn {
    background: linear-gradient(135deg, #FFAA00 0%, #FF8800 100%);
    color: #fff;
    box-shadow: 0 10px 20px rgba(255, 136, 0, 0.2);
}

.batch-primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(255, 136, 0, 0.28);
}

.batch-secondary-btn {
    background: #fff7ed;
    color: #c05621;
    border: 1px solid #f6ad55;
}

.batch-secondary-btn:hover {
    background: #ffedd5;
    transform: translateY(-1px);
}

.batch-primary-btn:disabled,
.batch-secondary-btn:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.batch-tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 22px;
    align-items: start;
}

.batch-task-card {
    background: #FFF8E1;
    border: 1px solid #fbd38d;
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(251, 146, 60, 0.08);
    padding: 20px;
}

.batch-task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.batch-task-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.batch-task-title {
    margin: 0;
    color: #7c2d12;
    font-size: 1.05rem;
    font-weight: 800;
}

.batch-task-status {
    width: fit-content;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    border: 1px solid transparent;
}

.batch-task-status.status-idle {
    color: #7c2d12;
    background: #fff7ed;
    border-color: #fbd38d;
}

.batch-task-status.status-running {
    color: #9c4221;
    background: #fef3c7;
    border-color: #f6ad55;
}

.batch-task-status.status-success {
    color: #276749;
    background: #f0fff4;
    border-color: #9ae6b4;
}

.batch-task-status.status-error {
    color: #c53030;
    background: #fff5f5;
    border-color: #feb2b2;
}

.batch-task-remove-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #fff1f2;
    color: #e53e3e;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.batch-task-remove-btn:hover {
    background: #ffe4e6;
    transform: scale(1.05);
}

.batch-task-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    min-height: 64px;
}

.batch-task-preview-item {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #fbd38d;
    background: #fffdf7;
}

.batch-task-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.batch-task-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: rgba(229, 62, 62, 0.92);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.batch-task-preview-badge {
    position: absolute;
    left: 4px;
    top: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.92);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

.batch-task-preview-empty {
    width: 100%;
    min-height: 64px;
    border: 1px dashed #fbd38d;
    border-radius: 12px;
    background: #fffaf0;
    color: #c05621;
    font-size: 0.84rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 12px;
}

.batch-task-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.batch-file-upload-label {
    min-height: 92px;
    background: #fffdf7;
}

.batch-url-input-wrapper textarea {
    min-height: 92px;
    height: 92px;
    resize: vertical;
}

.batch-task-prompt {
    min-height: 120px;
}

.batch-task-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.batch-task-actions {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.batch-task-actions button {
    flex: 1;
    min-width: 140px;
}

.batch-task-message {
    margin-top: 12px;
    font-size: 0.82rem;
    color: #9c4221;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

.batch-task-message.is-error {
    color: #c53030;
}

.batch-task-result-panel {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #fde68a;
}

.batch-task-result-title {
    margin: 0 0 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: #7c2d12;
    font-size: 0.92rem;
    font-weight: 800;
}

.batch-result-counter {
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff7ed;
    color: #c05621;
    border: 1px solid #fbd38d;
    font-size: 0.78rem;
}

.batch-task-results {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.batch-task-empty-state {
    min-height: 180px;
    border: 1px dashed #fbd38d;
    border-radius: 14px;
    background: linear-gradient(135deg, #fffaf0 0%, #fff7ed 100%);
    color: #c05621;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 18px;
    font-size: 0.88rem;
    line-height: 1.7;
}

.batch-task-card .result-group-container {
    margin-bottom: 12px !important;
    border-color: #fde68a !important;
    background: #fffdf8 !important;
}

.batch-task-card .image-grid-container {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
}

.batch-task-card .result-prompt-info {
    display: none !important;
}

.batch-task-card .btn-result-action {
    margin-top: 0;
    font-size: 0.78rem;
    padding: 6px 10px;
}

@media (max-width: 1024px) {
    .batch-top-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-mode-switch {
        width: 100%;
    }

    .batch-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .batch-toolbar-actions {
        width: 100%;
    }

    .batch-toolbar-actions button {
        flex: 1;
    }

    .batch-tasks-grid {
        grid-template-columns: 1fr;
    }

    .batch-task-upload-grid,
    .batch-task-settings-grid,
    .batch-shared-settings-grid {
        grid-template-columns: 1fr;
    }
}

/* 鍗＄墖閫氱敤鏍峰紡 */
.card {
    background: #FFF8E1;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

.card h3 {
    font-size: 0.95rem; /* 绋嶅井璋冨皬鏍囬瀛椾綋 */
    font-weight: 700;
    color: #2d3748;
    padding: 16px 20px; /* 鍑忓皬鍐呰竟璺?*/
    margin: 0;
    border-bottom: 1px solid #f7fafc;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #FFF8E1;
}

.card-body {
    padding: 24px;
}

/* 鍥炬爣鐩掑瓙 */
.icon-box {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 寰界珷 */
.badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: #edf2f7;
    color: #718096;
    margin-left: auto;
    font-weight: 500;
}
.badge-blue { background: #FFF3E0; color: #F57C00; }

/* 琛ㄥ崟鍏冪礌 */
.input-group { margin-bottom: 20px; }
.input-group:last-child { margin-bottom: 0; }

.api-key-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.api-key-input-wrap .glass-input {
    padding-right: 42px;
}

.api-key-visibility-toggle {
    position: absolute;
    right: 7px;
    top: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    transform: translateY(-50%);
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.18s ease, transform 0.18s ease;
}

.api-key-visibility-icon {
    display: block;
    width: 21px;
    height: 21px;
    fill: none;
    stroke: #64748b;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.api-key-eye-closed-icon {
    width: 22px;
    height: 22px;
    stroke-width: 1.7;
}

.api-key-visibility-toggle:hover {
    background: rgba(102, 126, 234, 0.12);
}

.api-key-visibility-toggle:focus-visible {
    outline: 2px solid rgba(102, 126, 234, 0.65);
    outline-offset: 1px;
}

.input-group label {
    display: block;
    font-size: 0.85rem; /* 璋冨皬瀛椾綋 */
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px; /* 鍑忓皬闂磋窛 */
}

.input-group input,
.input-group textarea,
.input-group select,
#customImageModelInput,
#customVideoModelInput,
#imageUrls,
#customOptimizerModelInput,
#customNInput {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 13px; /* 缁熶竴灏忓瓧浣?*/
    color: #2d3748;
    transition: all 0.2s;
    background: #FFF8E1;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus,
#customImageModelInput:focus,
#customVideoModelInput:focus,
#imageUrls:focus,
#customOptimizerModelInput:focus,
#customNInput:focus {
    background: #FFF8E1;
    border-color: #FF9F1C;
    box-shadow: 0 0 0 3px rgba(255, 159, 28, 0.2);
    outline: none;
}

/* 鍗曠嫭閽堝鍒涙剰鎻忚堪鏂囨湰鍩熶紭鍖?*/
#prompt {
    font-size: 13px !important;
    line-height: 1.6;
}

.input-group textarea { resize: vertical; min-height: 100px; font-family: inherit; }

.highlight-group textarea {
    border-color: #e2e8f0;
    background: #FFF8E1;
    font-size: 1rem;
}
.highlight-group textarea:focus {
    border-color: #FF9F1C;
}

/* 蹇嵎鎻愮ず璇嶆爣绛?*/
.quick-prompts {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-prompt-tag {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.quick-prompt-tag:hover {
    background: #edf2f7;
    color: #2d3748;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.quick-prompt-tag:active {
    transform: scale(0.95);
}

/* Tooltip 鏍峰紡 */
.tooltip-trigger {
    position: relative;
}

.tooltip-trigger::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.tooltip-trigger::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-3px);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    pointer-events: none;
    z-index: 100;
}

.tooltip-trigger:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-12px);
}

.tooltip-trigger:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-7px);
}

/* 妯″瀷閫夋嫨 */
.model-selection-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
/* 寮哄埗璁╁閫夋鏈夎冻澶熼珮搴?*/
#imageModels {
    height: 150px !important;
    background: #FFF8E1;
}
#videoModels {
    height: 100px !important; /* 瑙嗛妯″瀷杈冨皯锛屽噺灏忛珮搴?*/
    background: #FFF8E1;
}

.image-models-close-btn {
    display: none;
    width: 100%;
    min-height: 44px;
    margin-top: 8px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #3182ce 0%, #63b3ed 100%);
    color: #ffffff;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(49, 130, 206, 0.18);
}

.image-models-close-btn:hover,
.image-models-close-btn:focus-visible {
    box-shadow: 0 10px 22px rgba(49, 130, 206, 0.26);
    outline: none;
}

.model-column {
    display: flex;
    flex-direction: column;
}
.model-column label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

@media (max-width: 768px), (pointer: coarse) {
    .image-models-close-btn {
        display: block;
    }
}

/* 鍙傛暟缃戞牸 */
.param-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

/* 涓婁紶鍖哄煙 */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.file-upload { position: relative; width: 100%; }

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80px;
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    background: #f7fafc;
    cursor: pointer;
    transition: all 0.2s;
    color: #718096;
    font-size: 0.9rem;
    text-align: center;
    padding: 10px;
}

.file-upload-label:hover {
    border-color: #FF9F1C;
    background: #FFF3E0;
    color: #E65100;
}

#originalPageView .file-upload {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#originalPageView .upload-grid.has-reference-picker {
    gap: 10px;
}

#originalPageView .file-upload-label,
#originalPageView .generated-reference-entry {
    width: 100%;
    min-height: 92px;
    height: 92px;
    border-color: #cbd5e0;
    border-radius: 18px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.22;
    gap: 6px;
    padding: 12px;
}

#originalPageView .generated-reference-entry {
    justify-self: stretch;
}

#originalPageView .file-upload:hover .file-upload-label,
#originalPageView .file-upload-label:hover,
#originalPageView .file-upload-label.is-drag-over,
#originalPageView .generated-reference-entry:hover {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

#originalPageView .file-upload-label .upload-icon {
    margin-bottom: 0;
    font-size: 1.62rem;
    line-height: 1;
}

#originalPageView .file-upload-label .upload-text {
    display: block;
    max-width: 76px;
}

.upload-icon { font-size: 1.5rem; margin-bottom: 4px; display: block; }

.file-upload input[type="file"] { 
    position: absolute; 
    top: 0; left: 0; width: 100%; height: 100%; 
    opacity: 0; cursor: pointer; 
}

.url-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.url-input-wrapper textarea {
    min-height: 40px;
    height: 40px;
    padding: 8px 12px;
}
.btn-url-load {
    width: 100%;
    padding: 6px;
    background: #e2e8f0;
    border: none;
    border-radius: 6px;
    color: #4a5568;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.btn-url-load.active {
    background: #FF9F1C;
    color: white;
}

/* 鍥剧墖棰勮 */
.image-preview-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}
.image-preview-container > div {
    position: relative;
    width: 60px;
    height: 60px;
}
.image-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}
.delete-image-btn {
    position: absolute; top: -6px; right: -6px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #e53e3e; color: white;
    border: 2px solid white;
    font-size: 10px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}

/* 鎿嶄綔鏍?*/
.action-bar {
    position: sticky;
    bottom: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.warning-note-in-btn {
    font-size: 0.75rem;
    color: #d32f2f;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    margin-top: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #FFAA00 0%, #FF8800 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px -10px rgba(255, 136, 0, 0.5);
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -10px rgba(255, 136, 0, 0.6);
}
.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.mode-badge {
    text-align: center;
    font-size: 0.85rem;
    color: #718096;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.background-task-status {
    text-align: center;
    font-size: 0.82rem;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.92);
    color: #718096;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    line-height: 1.5;
}

.background-task-status.ready {
    background: #f0fff4;
    color: #2f855a;
    border-color: #9ae6b4;
}

.background-task-status.unavailable {
    background: #fff5f5;
    color: #c53030;
    border-color: #feb2b2;
}

.background-task-status.checking {
    background: #fffaf0;
    color: #c05621;
    border-color: #fbd38d;
}

/* 鍙充晶缁撴灉鍖哄煙 - 澧炲姞绌虹姸鎬?*/
.result-body {
    min-height: 600px; /* 鍔犻珮 */
    display: flex;
    flex-direction: column;
    position: relative;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 鑷€傚簲濉厖锛岄伩鍏嶇暀鐧?*/
    gap: 20px;
    flex-grow: 1;
    min-height: 300px;
}

/* 绌虹姸鎬佹牱寮?*/
.empty-state {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #cbd5e0;
    pointer-events: none; /* 璁╃偣鍑荤┛閫?*/
}
.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    opacity: 0.5;
}
.empty-state p { font-size: 1.1rem; font-weight: 500; }

.generated-image {
    width: 100%;
    height: 100%; /* 鎾戞弧瀹瑰櫒 */
    object-fit: cover; /* 淇濇寔姣斾緥瑁佸壀濉厖 */
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    display: block;
}
.generated-image:hover { transform: scale(1.02); }

/* 缁撴灉涓殑鍒嗙粍瀹瑰櫒 */
.result-prompt-info {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #4a5568;
    margin-bottom: 15px;
    border: 1px solid #edf2f7;
    word-break: break-all;
}

.btn-result-action {
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}
.btn-result-action:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

/* 鏃ュ織鍖哄煙浼樺寲 */
.log-section {
    margin-top: 20px;
    background: #FFF8E1;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    background: #FFF8E1;
    border-bottom: 1px solid #e2e8f0;
}

.log-panel {
    background: #FFF8E1;
    color: #4a5568;
    padding: 16px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    height: 450px; /* 澧炲姞楂樺害 */
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
    resize: vertical; /* 鍏佽鍨傜洿鎷栨嫿璋冩暣楂樺害 */
    min-height: 200px;
}
.log-line { margin: 4px 0; border-bottom: 1px dashed #f0f0f0; padding-bottom: 2px; }
.log-info { color: #E65100; }
.log-warn { color: #d69e2e; }
.log-error { color: #e53e3e; }

.request-preview-panel {
    margin: 14px 16px 16px;
    border: 2px solid #fb923c;
    border-radius: 8px;
    background: #fffbeb;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(251, 146, 60, 0.12);
}

.request-preview-panel.is-hidden {
    display: none;
}

.request-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px;
    border-bottom: 1px solid #fed7aa;
    background: #fff7ed;
    color: #c2410c;
    font-size: 0.88rem;
    font-weight: 700;
}

.request-preview-close {
    border: none;
    background: transparent;
    color: #fb923c;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0 4px;
}

.request-preview-close:hover {
    color: #ea580c;
}

.request-preview-body {
    padding: 14px 16px 16px;
    background: #fffbeb;
    color: #1f2937;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.86rem;
}

.request-preview-empty { 
    color: #92400e;
    font-family: inherit;
}

.request-preview-url-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    margin-bottom: 10px;
}

.request-preview-method {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 6px;
    background: #fb923c;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.request-preview-url {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #111827;
    font-weight: 700;
}

.request-preview-content-type,
.request-preview-body-label {
    margin-top: 8px;
    color: #475569;
}

.request-preview-table {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    border-radius: 6px;
    background: #f8fafc;
    border-collapse: separate;
    border-spacing: 0 7px;
    table-layout: fixed;
}

.request-preview-table td {
    vertical-align: top;
    padding: 3px 0;
    color: #334155;
    word-break: break-word;
}

.request-preview-key {
    width: 28%;
    font-weight: 700;
    color: #0f172a;
}

.request-preview-type {
    width: 16%;
    color: #8b5cf6;
    white-space: nowrap;
}

.request-preview-value {
    width: 56%;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}
.btn-icon:hover { background: #e2e8f0; }

/* 鍘嗗彶璁板綍鍏ㄥ鍗＄墖 */
.history-card { margin-top: 0; }
.history-count-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #f7fafc;
    color: #718096;
    font-size: 0.78rem;
    font-weight: 700;
    vertical-align: middle;
}

.history-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.history-card.history-collapsed .history-grid,
.history-card.history-collapsed .pagination-controls {
    display: none;
}

.history-card.history-collapsed #selectAllBtn,
.history-card.history-collapsed #deleteSelectedBtn {
    opacity: 0.45;
    cursor: not-allowed;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f7fafc;
}
.card-header h3 { border: none; padding: 0; }

.history-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 寮哄埗姣忚4涓?*/
    gap: 15px;
    padding: 20px;
}

@media (max-width: 1100px) {
    .history-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 800px) {
    .history-grid { grid-template-columns: repeat(2, 1fr); }
}

.history-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}
.history-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e0;
}
.history-item.selected {
    border-color: #FF9F1C;
    box-shadow: 0 0 0 3px rgba(255, 159, 28, 0.3);
}

.history-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}
.history-prompt {
    padding: 8px 10px;
    font-size: 12px; /* 鏇村皬鐨勫瓧浣?*/
    color: #4a5568;
    line-height: 1.4;
}
.history-prompt strong {
    font-size: 12px; /* 鏍囬涔熷彉灏?*/
}
.history-time {
    padding: 0 10px 8px;
    font-size: 11px; /* 鏇村皬鐨勫瓧浣?*/
    color: #a0aec0;
}

.history-logs {
    padding: 0 10px 10px;
}

.history-logs summary {
    font-size: 11px;
    cursor: pointer;
    color: #718096;
    margin-bottom: 4px;
    outline: none;
    font-weight: 500;
}

.history-logs pre {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px;
    font-size: 10px; /* 鏇村皬鐨勫瓧浣?*/
    color: #4a5568;
    max-height: 120px; /* 鍥哄畾楂樺害 */
    overflow-y: auto; /* 鏀寔婊氬姩 */
    white-space: pre-wrap;
    word-break: break-all;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    margin: 0;
}

/* 鑷畾涔夋粴鍔ㄦ潯鏍峰紡 */
.history-logs pre::-webkit-scrollbar {
    width: 4px;
}
.history-logs pre::-webkit-scrollbar-track {
    background: transparent;
}
.history-logs pre::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 2px;
}
.history-logs pre::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.history-item-checkbox {
    position: absolute;
    top: 8px; left: 8px;
    transform: scale(1.1);
    z-index: 10;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    gap: 15px;
    border-top: 1px solid #f0f0f0;
}
.page-btn {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #4a5568;
    transition: all 0.2s;
}
.page-btn:hover:not(:disabled) {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #2d3748;
}
.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.page-info {
    font-size: 0.85rem;
    color: #718096;
}

.btn-outline {
    padding: 6px 16px;
    border: 1px solid #cbd5e0;
    background: white;
    color: #4a5568;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-outline:hover {
    border-color: #a0aec0;
    background: #f7fafc;
}
.btn-outline.danger { color: #e53e3e; border-color: #feb2b2; }
.btn-outline.danger:hover { background: #fff5f5; border-color: #fc8181; }

/* Loading */
.loading { display: none; padding: 40px; text-align: center; color: #718096; }
.loading.show { display: block; }
.spinner {
    border: 3px solid #edf2f7;
    border-top: 3px solid #FF9F1C;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* 鍏憡寮圭獥鏍峰紡 (杩樺師澶囦唤鐗堝苟浼樺寲) */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.8); /* 澧炲姞閫忔槑搴?*/
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1); /* 鏌斿拰闃村奖 */
    padding: 20px 25px;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    border-radius: 16px;
    max-width: 380px; /* 鎭㈠鍘熸湁瀹藉害 */
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow: hidden;
    font-size: 14px;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    visibility: hidden;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
}

.toast-content {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    max-height: calc(100vh - 80px);
    max-height: calc(100dvh - 80px);
    overflow-y: auto;
    padding-right: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.toast-content::-webkit-scrollbar {
    display: none;
}

.toast-changelog {
    height: 240px;
    overflow-y: auto;
    overflow-x: hidden;
    overflow-wrap: anywhere;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.toast-changelog::-webkit-scrollbar {
    display: none;
}

.toast-changelog:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.toast-content p { margin: 0; }
.toast-content strong { color: #434190; }
.toast-content a { color: #FF9F1C; text-decoration: none; font-weight: 600;}
.toast-content a:hover { text-decoration: underline; }

.toast-header { font-size: 1.1em; font-weight: 600; color: #333; margin-bottom: 15px; border-bottom: none; padding-bottom: 0; display: block; }
.toast-section { margin-bottom: 12px; }
.toast-section > strong { display: block; margin-bottom: 8px; font-size: 1em; color: #434190; }
.toast-section ul { list-style: none; padding: 5px 0 0 5px; margin: 0; }
.toast-section code {
    background: linear-gradient(135deg, #FFAA00, #FF8800);
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 500;
    margin: 4px 2px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.toast-section code:hover {
    transform: scale(1.1) rotate(-2deg);
}

.toast-tips {
    background: rgba(255, 159, 28, 0.1); padding: 8px 12px; border-radius: 8px; font-size: 0.9em; margin-top: 10px; border-left: none; color: inherit;
}
.toast-tips strong { color: #FF9F1C; }

.toast button {
    background: rgba(0,0,0,0.05);
    border: none;
    cursor: pointer;
    color: #888;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
    flex-shrink: 0;
    transition: background-color 0.3s, color 0.3s;
    position: static; /* 鎭㈠闈欐€佸畾浣?*/
}

.toast button:hover {
    background-color: rgba(0,0,0,0.1);
    color: #333;
}

/* 鏂版ā鍨嬪叕鍛婄殑鐗规畩鏍峰紡 */
.toast-section .new-model {
    background: linear-gradient(135deg, #f97794 0%, #623aa2 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(249, 119, 148, 0.4);
    transform: scale(1.05);
    transform-origin: left center;
    display: inline-block;
    transition: transform 0.3s ease;
    border: none; /* 绉婚櫎杈规 */
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 1em;
}

.toast-section .new-model:hover {
    transform: scale(1.2) rotate(-2deg);
}

@media (max-width: 640px) {
    .toast {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        padding: 16px 18px;
    }

    .toast-content {
        max-height: calc(100vh - 56px);
        max-height: calc(100dvh - 56px);
        padding-right: 0;
    }

    .toast-changelog {
        height: 180px;
    }
}

.link-card {
    background: linear-gradient(to right, #f8f9fa, #e9ecef);
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #2d3748;
    font-size: 0.85rem;
    transition: all 0.2s;
    border: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.link-card:hover {
    background: #fff;
    border-color: #FF9F1C;
    color: #FF9F1C;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(255, 159, 28, 0.15);
}

.wechat-id {
    font-weight: 800;
    color: #2d3748;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f0fff4;
    border: 1px dashed #9ae6b4;
    transition: all 0.2s;
    margin-left: 5px;
}
.wechat-id:hover {
    background: #c6f6d5;
    border-color: #48bb78;
}
.wechat-id:active {
    transform: scale(0.95);
}

/* 鎻愮ず淇℃伅 */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 3000;
    display: none;
}
.toast-notification.show { display: block; animation: fadeInDown 0.3s; }
.toast-notification.success { background: #48bb78; }
.toast-notification.error { background: #f56565; }

@keyframes fadeInDown {
    from { opacity: 0; transform: translate(-50%, -20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* 鍝嶅簲寮?*/
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    .action-bar {
        position: static;
    }
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.9rem;
    color: #4a5568;
    cursor: pointer;
}
.custom-checkbox input { margin: 0; }

/* ========== 瑙嗛浠诲姟UI鏍峰紡 ========== */

/* 瑙嗛浠诲姟瀹瑰櫒 */
.video-tasks-container {
    margin-bottom: 30px;
    padding: 20px;
    background: #FFF8E1;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.image-tasks-container {
    border-color: #f6ad55;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.08);
}

.image-task-tip {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fffaf0;
    border: 1px solid #fbd38d;
    color: #9c4221;
    font-size: 0.82rem;
    line-height: 1.6;
}

.video-tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.video-tasks-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
    padding: 0;
    border: none;
}

.tasks-count {
    background: linear-gradient(135deg, #FFAA00 0%, #FF8800 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(255, 136, 0, 0.3);
}

/* 鍨傜洿婊氬姩瀹瑰櫒 */
.video-tasks-scroll {
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 600px;
    padding: 5px;
    margin: 0;
}

.video-tasks-scroll::-webkit-scrollbar {
    width: 8px;
}

.video-tasks-scroll::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 4px;
}

.video-tasks-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.video-tasks-scroll::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 浠诲姟鍒楄〃 - 缃戞牸甯冨眬锛屾瘡琛?涓?*/
.video-tasks-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0;
}

/* Desktop image background tasks use one full-width card per row. */
@media (min-width: 769px) {
    #imageTasksList {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* 浠诲姟鍗＄墖 */
.video-task-card {
    width: 100%;
    background: #FFF8E1;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    display: flex;
    flex-direction: column;
}

.video-task-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e0;
}

.video-task-card.selected {
    border-color: #FF9F1C;
    box-shadow: 0 0 0 3px rgba(255, 159, 28, 0.2);
}

/* 浠诲姟澶嶉€夋 */
.task-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

.task-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #FF9F1C;
}

/* 棰勮鍖?*/
.task-preview {
    width: 100%;
    height: 158px;
    background: #1a202c;
    position: relative;
    overflow: hidden;
}

.task-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 鍔犺浇鍗犱綅绗?- 浼樺寲甯冨眬 */
.task-loading-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FFAA00 0%, #FF8800 100%);
    color: white;
    position: relative;
    gap: 20px;
    padding: 20px;
}

.task-loading-placeholder p {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    width: 100%;
    z-index: 2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
                 0 0 20px rgba(255, 255, 255, 0.2);
    letter-spacing: 0.5px;
    animation: textGlow 2s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
                     0 0 20px rgba(255, 255, 255, 0.2);
    }
    50% {
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
                     0 0 30px rgba(255, 255, 255, 0.4);
    }
}

/* 鍔犺浇鍔ㄧ敾 - 浼樺寲鍚庢洿鏄剧溂 */
.loading-spinner {
    width: 70px;
    height: 70px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-right-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: spin 0.8s linear infinite, pulse 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5),
                inset 0 0 20px rgba(255, 255, 255, 0.2);
    position: relative;
}

.loading-spinner::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: spin 1.5s linear infinite reverse;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

/* 閿欒鍗犱綅绗?*/
.task-error-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #feb2b2;
    color: #742a2a;
    padding: 20px;
    text-align: center;
}

.error-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.task-error-placeholder p {
    font-size: 0.85rem;
    margin: 0;
}

.task-image-completed-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    color: #9a3412;
    gap: 10px;
    padding: 20px;
    text-align: center;
}

.image-task-complete-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.task-image-completed-placeholder p {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

/* 鎻愮ず璇嶆樉绀哄尯鍩?*/
.task-prompt-display {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 15px;
    overflow-y: auto;
    font-size: 0.75rem;
    line-height: 1.5;
}

.task-prompt-display .prompt-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-prompt-display .prompt-section {
    background: white;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.task-prompt-display .prompt-section strong {
    display: block;
    color: #4a5568;
    font-size: 0.7rem;
    margin-bottom: 4px;
}

.task-prompt-display .prompt-section p {
    margin: 0;
    color: #2d3748;
    word-break: break-word;
    white-space: pre-wrap;
}

.task-prompt-display::-webkit-scrollbar {
    width: 4px;
}

.task-prompt-display::-webkit-scrollbar-track {
    background: transparent;
}

.task-prompt-display::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 2px;
}

.task-prompt-display::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 杩涘害瑕嗙洊灞?*/
.task-progress-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
}

/* 鎾斁鎸夐挳瑕嗙洊灞?*/
.task-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s;
}

.task-preview:hover .task-play-overlay {
    opacity: 1;
}

.play-button {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #FF9F1C;
    transition: transform 0.2s;
}

.play-button:hover {
    transform: scale(1.1);
}

/* 杩涘害鏉?- 浼樺寲鍚庢洿鏄剧溂 */
.task-progress-bar {
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, #e2e8f0 0%, #cbd5e0 100%);
    position: relative;
    overflow: hidden;
    border-radius: 0 0 4px 4px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 50%, #10b981 100%);
    background-size: 200% 100%;
    transition: width 0.5s ease;
    position: relative;
    animation: progressGradient 2s ease infinite;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.4) 0%,
        transparent 100%);
    border-radius: 4px 4px 0 0;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.6) 50%,
        transparent 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes progressGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 浠诲姟淇℃伅 */
.task-info {
    padding: 10px 15px 6px;
    background: #FFF8E1;
    flex-grow: 1;
}

.task-id {
    font-size: 0.75rem;
    color: #718096;
    margin-bottom: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-status {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.task-status.status-queued {
    color: #ed8936;
}

.task-status.status-in_progress {
    color: #F57C00;
}

.task-status.status-completed {
    color: #48bb78;
}

.task-status.status-failed {
    color: #f56565;
}

.task-time {
    font-size: 0.75rem;
    color: #a0aec0;
}

.task-model-bar {
    margin-top: 4px;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid #fde68a;
    background: linear-gradient(135deg, #fffaf0 0%, #fff7ed 100%);
    color: #9c4221;
    font-size: 0.64rem;
    font-weight: 500;
    line-height: 1.2;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-task-model-bar {
    margin-top: 4px;
}

.video-task-card[data-status="failed"] .task-model-bar,
.image-task-card[data-status="failed"] .image-task-model-bar {
    border-color: #fed7aa;
    background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%);
    color: #c05621;
}

/* 浠诲姟鎿嶄綔鎸夐挳 */
.task-actions {
    display: flex;
    gap: 8px;
    padding: 0 15px 10px;
    border-top: 1px solid #f7fafc;
    padding-top: 8px;
}

.task-actions-completed {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.video-task-card .task-actions-completed {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.image-task-card .task-actions-completed {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.task-actions-single {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.task-actions-failed {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.btn-task-action {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    background: #FFF8E1;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-task-action:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.btn-task-action:disabled,
.btn-task-action.is-loading {
    opacity: 0.72;
    cursor: not-allowed;
    transform: none;
}

.btn-task-action span {
    font-size: 1rem;
}

.task-actions-completed .btn-task-action,
.task-actions-single .btn-task-action,
.task-actions-failed .btn-task-action {
    min-width: 0;
    padding: 10px 6px 9px;
    min-height: 62px;
    flex-direction: column;
    gap: 6px;
    border-radius: 10px;
    font-size: 0.72rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.task-actions-completed .btn-task-action:hover,
.task-actions-single .btn-task-action:hover,
.task-actions-failed .btn-task-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

.task-actions-completed .btn-task-action strong,
.task-actions-single .btn-task-action strong,
.task-actions-failed .btn-task-action strong {
    font-size: 0.72rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.task-actions-completed .btn-task-action span,
.task-actions-single .btn-task-action span,
.task-actions-failed .btn-task-action span {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.task-actions-completed .btn-show-result {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.task-actions-completed .btn-show-result span {
    background: #dbeafe;
    color: #1d4ed8;
}

.task-actions-completed .btn-show-result:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #60a5fa;
    color: #1e40af;
}

.task-actions-completed .btn-view-prompt {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border-color: #ddd6fe;
    color: #7c3aed;
}

.task-actions-completed .btn-view-prompt span {
    background: #ede9fe;
    color: #7c3aed;
}

.task-actions-completed .btn-view-prompt:hover {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border-color: #a78bfa;
    color: #6d28d9;
}

.btn-show-result:hover {
    border-color: #fb923c;
    color: #ea580c;
}

.btn-view-prompt:hover {
    border-color: #FF9F1C;
    color: #FF9F1C;
}

.task-actions-completed .btn-remove-display {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fcd34d;
    color: #b45309;
}

.task-actions-completed .btn-remove-display span {
    background: #fde68a;
    color: #b45309;
}

.task-actions-completed .btn-remove-display:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
    color: #92400e;
}

.btn-remove-display:hover {
    border-color: #f59e0b;
    color: #f59e0b;
}

.btn-task-detail {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.btn-task-detail span {
    background: #dbeafe;
    color: #1d4ed8;
}

.btn-task-detail:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #60a5fa;
    color: #1e40af;
}

.btn-task-retry {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fcd34d;
    color: #b45309;
}

.btn-task-retry span {
    background: #fde68a;
    color: #b45309;
}

.btn-task-retry:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
    color: #92400e;
}

.btn-task-delete {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
    color: #dc2626;
}

.btn-task-delete span {
    background: #fecaca;
    color: #dc2626;
}

.btn-task-delete:hover {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #f87171;
    color: #b91c1c;
}

/* ========== 瑙嗛鎴愬姛寮圭獥鏍峰紡 ========== */

.video-success-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    width: 420px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e8e8e8;
    z-index: 2000;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    padding: 16px 20px;
}

.video-success-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.video-success-toast .toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.video-success-toast .toast-icon {
    width: 24px;
    height: 24px;
    background: #52c41a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
    font-weight: bold;
}

.video-success-toast .toast-text {
    flex: 1;
    line-height: 1.5;
}

.video-success-toast .toast-title {
    font-size: 14px;
    font-weight: 500;
    color: #000;
    margin: 0;
}

.video-success-toast .toast-id {
    font-size: 13px;
    color: #666;
    margin: 2px 0 0 0;
    font-family: 'Monaco', 'Courier New', monospace;
    word-break: break-all;
}

.video-success-toast .toast-id span {
    color: #666;
    font-weight: normal;
}

.video-success-toast .toast-status {
    font-size: 13px;
    color: #666;
    margin: 2px 0 0 0;
}

.video-success-toast .toast-close {
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #999;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.video-success-toast .toast-close:hover {
    color: #333;
}

/* 鍝嶅簲寮忛€傞厤 */
@media (max-width: 768px) {
    .video-tasks-list {
        grid-template-columns: 1fr;
    }
    
    .video-success-toast {
        width: calc(100% - 40px);
        right: -100%;
    }
    
    .video-success-toast.show {
        right: 20px;
    }
}

/* ========== 鎻愮ず璇嶅簱鏍峰紡 ========== */

.hidden {
    display: none !important;
}

.prompt-library-entry {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #fbd38d;
    background: linear-gradient(135deg, #fffaf0 0%, #fff7e6 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}

.prompt-library-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
}

.prompt-library-entry-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #9c4221;
}

.prompt-library-entry-tip {
    margin: 0;
    font-size: 0.82rem;
    color: #7b341e;
    line-height: 1.65;
}

.prompt-library-open-btn {
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #FFAA00 0%, #FF8800 100%);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(255, 136, 0, 0.22);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.prompt-library-open-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(255, 136, 0, 0.28);
}

.prompt-library-modal {
    position: fixed;
    inset: 0;
    z-index: 3200;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(7px);
}

.prompt-library-dialog {
    width: min(1180px, 100%);
    max-height: 92vh;
    background: #fffaf0;
    border-radius: 22px;
    border: 1px solid #fbd38d;
    box-shadow: 0 25px 70px rgba(15, 23, 42, 0.24);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.prompt-library-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 18px;
    background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%);
    border-bottom: 1px solid #fde68a;
}

.prompt-library-header h3 {
    margin: 0 0 6px;
    font-size: 1.25rem;
    font-weight: 800;
    color: #7c2d12;
}

.prompt-library-header p {
    margin: 0;
    color: #9a3412;
    font-size: 0.9rem;
}

.prompt-library-close-btn,
.prompt-image-preview-close {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.88);
    color: #9a3412;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(154, 52, 18, 0.12);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.prompt-library-close-btn:hover,
.prompt-image-preview-close:hover {
    background: #fff;
    transform: scale(1.05);
}

.prompt-library-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px 10px;
    background: #fffaf0;
}

.prompt-library-search {
    flex: 1;
    min-width: 0;
    position: relative;
}

.prompt-library-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 0.95rem;
}

.prompt-library-search input {
    width: 100%;
    height: 44px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    padding: 0 46px 0 42px;
    font-size: 0.92rem;
    color: #2d3748;
    transition: all 0.2s ease;
}

.prompt-search-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: #fff7ed;
    color: #c05621;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(246, 173, 85, 0.35);
}

.prompt-search-clear-btn:hover {
    background: #fed7aa;
    color: #9c4221;
    transform: translateY(-50%) scale(1.05);
}

.prompt-search-clear-btn:active {
    transform: translateY(-50%) scale(0.96);
}

.prompt-library-search input:focus {
    outline: none;
    border-color: #FF9F1C;
    box-shadow: 0 0 0 3px rgba(255, 159, 28, 0.15);
}

.prompt-library-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.prompt-library-toggle-btn,
.prompt-library-category-btn,
.prompt-copy-btn,
.prompt-use-btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #4a5568;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.prompt-library-toggle-btn {
    width: 44px;
    height: 44px;
    font-size: 1rem;
}

.prompt-library-category {
    position: relative;
}

.prompt-library-category-btn {
    height: 44px;
    min-width: 112px;
    padding: 0 14px;
    font-size: 0.9rem;
}

.prompt-library-toggle-btn:hover,
.prompt-library-category-btn:hover,
.prompt-copy-btn:hover,
.prompt-use-btn:hover {
    border-color: #f6ad55;
    background: #fff7ed;
    color: #c05621;
}

.prompt-library-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 24px 18px;
    flex-wrap: wrap;
}

.prompt-filter-chip {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #4a5568;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prompt-filter-chip:hover {
    border-color: #f6ad55;
    color: #c05621;
    background: #fff7ed;
}

.prompt-filter-chip.active {
    background: linear-gradient(135deg, #FFAA00 0%, #FF8800 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 20px rgba(255, 136, 0, 0.18);
}

.prompt-library-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 24px 16px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.prompt-library-content,
.prompt-image-preview-dialog {
    scrollbar-width: thin;
    scrollbar-color: #f6ad55 #fff7ed;
}

.prompt-library-content::-webkit-scrollbar,
.prompt-image-preview-dialog::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.prompt-library-content::-webkit-scrollbar-track,
.prompt-image-preview-dialog::-webkit-scrollbar-track {
    background: #fff7ed;
    border-radius: 999px;
}

.prompt-library-content::-webkit-scrollbar-thumb,
.prompt-image-preview-dialog::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #f6ad55 0%, #ed8936 100%);
    border-radius: 999px;
}

.prompt-library-content::-webkit-scrollbar-thumb:hover,
.prompt-image-preview-dialog::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ed8936 0%, #dd6b20 100%);
}

.prompt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.prompt-card-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
    transition: all 0.25s ease;
}

.prompt-card-item:hover {
    transform: translateY(-4px);
    border-color: #f6ad55;
    box-shadow: 0 16px 30px rgba(245, 158, 11, 0.14);
}

.prompt-card-preview {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
}

.prompt-card-preview .preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

.prompt-card-preview .no-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b45309;
    font-size: 0.88rem;
    font-weight: 700;
}

.prompt-card-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px 14px 12px;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.45) 60%, transparent 100%);
    color: #fff;
}

.prompt-card-title {
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.3;
    text-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.prompt-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.prompt-card-tags span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.16);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
}

.prompt-card-tags .mode {
    background: rgba(255, 170, 0, 0.24);
}

.prompt-fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    color: #cbd5e0;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    transition: all 0.2s ease;
}

.prompt-fav-btn:hover {
    transform: scale(1.06);
    color: #f59e0b;
}

.prompt-fav-btn.active {
    color: #f59e0b;
    background: #fff7ed;
}

.prompt-card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.prompt-text {
    color: #4a5568;
    font-size: 0.84rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 7.2em;
}

.prompt-footer {
    margin-top: auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
}

.prompt-footer .author {
    color: #a0aec0;
    font-size: 0.76rem;
    font-weight: 600;
    word-break: break-word;
}

.prompt-card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.prompt-copy-btn,
.prompt-use-btn {
    padding: 8px 10px;
    font-size: 0.78rem;
}

.prompt-use-btn {
    background: linear-gradient(135deg, #FFAA00 0%, #FF8800 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 18px rgba(255, 136, 0, 0.14);
}

.prompt-use-btn:hover {
    background: linear-gradient(135deg, #ffb429 0%, #ff9424 100%);
    color: #fff;
    border-color: transparent;
}

.prompt-loading,
.prompt-empty {
    grid-column: 1 / -1;
    min-height: 280px;
    border: 1px dashed #f6ad55;
    border-radius: 18px;
    background: linear-gradient(135deg, #fffaf0 0%, #fff7ed 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #9c4221;
    text-align: center;
    padding: 24px;
}

.prompt-loading .spinner {
    margin: 0;
}

.prompt-library-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 24px 20px;
    border-top: 1px solid #fde68a;
    background: #fffdf7;
}

.prompt-library-category-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    max-height: 280px;
    overflow-y: auto;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid #fbd38d;
    background: #fff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    z-index: 12;
}

.prompt-category-item {
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prompt-category-item:hover {
    background: #fff7ed;
    color: #c05621;
}

.prompt-image-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 3300;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.prompt-image-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
}

.prompt-image-preview-dialog {
    position: relative;
    z-index: 1;
    width: min(1000px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    border-radius: 22px;
    background: #fff;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.3);
}

.prompt-image-preview-media {
    background: #111827;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 0;
    padding: 20px;
}

.prompt-image-preview-media img {
    max-width: 100%;
    max-height: none;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    display: block;
}

.prompt-image-preview-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
}

.prompt-image-preview-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    background: linear-gradient(180deg, #fffaf0 0%, #fff 100%);
}

.prompt-image-preview-title-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prompt-image-preview-title-row h4 {
    margin: 0;
    font-size: 1.15rem;
    color: #7c2d12;
    font-weight: 800;
}

.prompt-image-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.prompt-image-preview-info p {
    margin: 0;
    color: #4a5568;
    font-size: 0.92rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 900px) {
    .prompt-library-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .prompt-library-actions {
        justify-content: space-between;
    }

    .prompt-grid {
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    }

    .prompt-image-preview-dialog {
        grid-template-columns: 1fr;
    }

    .prompt-image-preview-media {
        min-height: 280px;
    }
}

@media (max-width: 640px) {
    .prompt-library-modal,
    .prompt-image-preview-modal {
        padding: 14px;
    }

    .prompt-library-header,
    .prompt-library-toolbar,
    .prompt-library-tabs,
    .prompt-library-content,
    .prompt-library-pagination,
    .prompt-image-preview-info {
        padding-left: 16px;
        padding-right: 16px;
    }

    .prompt-library-entry-header {
        flex-direction: column;
        align-items: stretch;
    }

    .prompt-library-open-btn {
        width: 100%;
    }

    .prompt-grid {
        grid-template-columns: 1fr;
    }

    .prompt-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .prompt-card-actions {
        width: 100%;
    }

    .prompt-copy-btn,
    .prompt-use-btn {
        flex: 1;
    }
}

/* ===== 鎵归噺椤靛弬鑰冨浘鏍峰紡瑕嗙洊 ===== */
.batch-empty-state-board {
    display: grid;
    grid-template-columns: minmax(320px, 1.05fr) minmax(360px, 0.95fr);
    gap: 24px;
    align-items: stretch;
    padding: 26px;
    border-radius: 22px;
    border: 2px dashed #ffb347;
    background: linear-gradient(135deg, rgba(255, 248, 225, 0.96) 0%, rgba(255, 243, 205, 0.92) 100%);
    box-shadow: 0 18px 38px rgba(255, 170, 0, 0.12);
}

.batch-empty-state-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 8px 4px;
}

.batch-empty-badge {
    width: fit-content;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #c05621;
    border: 1px solid #f6ad55;
    font-size: 0.82rem;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(246, 173, 85, 0.16);
}

.batch-empty-state-main h3 {
    margin: 0;
    color: #7c2d12;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.25;
}

.batch-empty-state-main p {
    margin: 0;
    color: #8b5e34;
    font-size: 0.96rem;
    line-height: 1.8;
    max-width: 560px;
}

.batch-empty-state-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.batch-empty-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.batch-empty-preview-card {
    min-height: 248px;
    padding: 20px 18px;
    border-radius: 18px;
    border: 2px dashed #ffb347;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 247, 237, 0.96) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.batch-empty-preview-card::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    height: 14px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.batch-empty-preview-card strong {
    margin-top: 28px;
    color: #334155;
    font-size: 1rem;
    font-weight: 800;
}

.batch-empty-preview-card span {
    color: #94a3b8;
    font-size: 0.88rem;
    line-height: 1.7;
}

@media (max-width: 900px) {
    .batch-empty-state-board {
        grid-template-columns: 1fr;
    }

    .batch-empty-preview-grid {
        grid-template-columns: 1fr;
    }

    .batch-empty-preview-card {
        min-height: 180px;
    }
}

.batch-field-hidden {
    display: none !important;
}

.batch-page-view {
    gap: 22px;
    margin-bottom: 32px;
}

.batch-top-grid {
    grid-template-columns: minmax(320px, 0.92fr) minmax(420px, 1.4fr);
    gap: 20px;
    align-items: stretch;
}

.batch-config-card,
.batch-shared-settings-card {
    min-height: 242px;
    border: 1.5px solid #f4c430;
    background: linear-gradient(180deg, rgba(255, 249, 227, 0.96), rgba(255, 244, 200, 0.92));
    box-shadow: 0 14px 34px rgba(255, 170, 0, 0.12);
}

.batch-config-card .card-body,
.batch-shared-settings-card .card-body {
    display: flex;
    flex-direction: column;
    height: calc(100% - 70px);
}

.batch-shared-settings-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 14px;
}

.batch-shared-settings-grid .input-group {
    margin-bottom: 0;
}

.batch-shared-settings-actions {
    margin-top: 12px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.batch-shared-settings-actions .batch-secondary-btn {
    min-width: 180px;
}

.batch-shared-settings-tip {
    max-width: 520px;
    color: #8b6b2f;
    line-height: 1.65;
}

.batch-price-strip {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 22px;
    padding: 16px 22px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(245, 158, 11, 0.2);
    box-shadow: 0 10px 22px rgba(247, 181, 90, 0.08);
}

.batch-price-item {
    color: #4a5568;
    font-size: 0.96rem;
    font-weight: 700;
    white-space: nowrap;
}

.batch-price-item strong {
    color: #2d3748;
}

.batch-toolbar {
    padding: 16px 20px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 18px;
    background: #FFF8E1;
    box-shadow: 0 12px 28px rgba(247, 181, 90, 0.11);
    gap: 16px;
}

.batch-toolbar-stats {
    gap: 22px;
    color: #7d8793;
    font-size: 0.98rem;
    font-weight: 600;
}

.batch-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.batch-stat-pill strong {
    color: #ff8a00;
    font-size: 1.22rem;
    font-weight: 800;
}

.batch-stat-pill-running {
    display: none;
}

.batch-toolbar-actions {
    margin-left: auto;
    gap: 12px;
}

#addBatchTaskBtn {
    display: none !important;
}

.batch-toolbar-actions .batch-primary-btn,
.batch-toolbar-actions .batch-secondary-btn {
    min-width: 150px;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.98rem;
    font-weight: 800;
    box-shadow: none;
}

#stopAllBatchTasksBtn {
    background: #f3a39a;
    color: #fff;
    border: none;
}

#stopAllBatchTasksBtn:hover {
    background: #eb8f84;
}

#startAllBatchTasksBtn {
    background: linear-gradient(135deg, #ffd591 0%, #ffc56d 100%);
    color: #fff;
    box-shadow: none;
}

#startAllBatchTasksBtn:hover {
    box-shadow: none;
}

#downloadAllBatchTasksBtn {
    background: #97c8ec;
    color: #fff;
    border: none;
}

#downloadAllBatchTasksBtn:hover {
    background: #84bce6;
}

.batch-tasks-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    align-items: stretch;
}

.batch-task-card,
.batch-add-task-card {
    border-radius: 18px;
    min-height: 360px;
}

.batch-task-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 249, 227, 0.96), rgba(255, 244, 200, 0.92));
    border: 1.5px solid #f4c430;
    box-shadow: 0 14px 34px rgba(255, 170, 0, 0.12);
}

.batch-task-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0;
    padding: 18px 18px 14px;
    background: #FFF8E1;
    border-bottom: 1px solid rgba(244, 196, 48, 0.24);
}

.batch-task-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.batch-task-title {
    margin: 0;
    color: #23354d;
    font-size: 1.05rem;
    font-weight: 800;
}

.batch-task-header-right {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.batch-task-status {
    width: auto;
    padding: 6px 14px;
    border-radius: 999px;
    border: none;
    background: #eef2f3;
    color: #8a929c;
    font-size: 0.82rem;
    font-weight: 800;
}

.batch-task-status.status-idle {
    background: #eef2f3;
    color: #7f8c8d;
}

.batch-task-status.status-running {
    background: #fff0bf;
    color: #c77600;
}

.batch-task-status.status-success {
    background: #dcfce7;
    color: #15803d;
}

.batch-task-status.status-error {
    background: #ffe4e6;
    color: #e11d48;
}

.batch-task-status.status-interrupted {
    background: #e2e8f0;
    color: #4a5568;
}

.batch-task-remove-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 999px;
    background: #ef5b45;
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    box-shadow: none;
}

.batch-task-remove-btn:hover {
    background: #e14b34;
    transform: none;
}

.batch-task-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 18px 18px;
    flex: 1;
}

.batch-task-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0;
    min-height: 0;
}

.batch-task-preview-item {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 12px;
    background: transparent;
    overflow: visible;
}

.batch-task-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 12px;
    border: 1px solid #dbe3ee;
    background: #fff;
}

.batch-task-preview-empty {
    display: none;
}

.batch-task-preview-placeholder-icon,
.batch-task-preview-placeholder-text {
    display: none;
}

.batch-task-preview-remove {
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #ef5b45;
    color: #fff;
    font-size: 12px;
    box-shadow: 0 4px 8px rgba(239, 91, 69, 0.24);
}

.batch-task-preview-badge {
    display: none;
}

.batch-task-hidden-tools {
    display: none !important;
}

.batch-task-result-panel {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.batch-task-upload-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    align-items: center;
}

.batch-file-upload-label {
    min-height: 106px;
    border: 2px dashed #cbd5e0;
    border-radius: 18px;
    background: #f7fafc;
    color: #718096;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.6;
    text-align: center;
    padding: 18px 22px;
    transition: all 0.2s ease;
}

.batch-file-upload-label:hover {
    border-color: #FF9F1C;
    background: #FFF3E0;
    color: #E65100;
}

.batch-file-upload-label.is-drag-over {
    border-color: #FF9F1C;
    background: #FFF3E0;
    color: #E65100;
    box-shadow: 0 0 0 4px rgba(255, 159, 28, 0.16);
    transform: translateY(-1px);
}

.batch-file-upload-label.is-disabled,
.batch-file-upload-label.is-disabled:hover,
.batch-file-upload-label.is-disabled.is-drag-over {
    cursor: not-allowed;
    opacity: 0.72;
    border-color: #cbd5e0;
    background: #f7fafc;
    color: #718096;
    box-shadow: none;
    transform: none;
}

.batch-task-url-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.batch-task-url-input {
    min-height: 70px !important;
    height: 70px !important;
    resize: vertical;
    padding: 12px 14px !important;
    border-radius: 16px;
    border-color: #d7dce5 !important;
    background: #fff8dc !important;
    color: #6b7280;
    box-shadow: none !important;
}

.batch-task-url-input:focus {
    border-color: #f0b35a !important;
    box-shadow: 0 0 0 3px rgba(240, 179, 90, 0.18) !important;
}

.batch-task-url-load-btn {
    width: 100%;
    min-height: 52px;
    border: none;
    border-radius: 14px;
    background: #dbe3f0;
    color: #5f6c80;
    font-size: 0.96rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.batch-task-url-load-btn:hover:not(:disabled) {
    background: #cfd9eb;
}

.batch-task-url-load-btn:disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

.batch-task-result-shell {
    min-height: 360px;
    padding: 12px;
    border-radius: 14px;
    border: 1.5px solid rgba(244, 196, 48, 0.55);
    background: rgba(255, 251, 235, 0.7);
}

.batch-task-result-shell.is-loading {
    min-height: 190px;
}

.batch-task-result-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.batch-task-result-title {
    margin: 0;
    color: #7d8793;
    font-size: 0.9rem;
    font-weight: 800;
}

.batch-result-counter {
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef2f7;
    color: #718096;
    border: none;
    font-size: 0.78rem;
    font-weight: 800;
}

.batch-task-results {
    min-height: 290px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.batch-task-results.is-loading {
    min-height: 120px;
}

.batch-task-loading-placeholder {
    height: auto;
    min-height: 120px;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 12px;
}

.batch-task-loading-placeholder p {
    font-size: 0.95rem;
    line-height: 1.5;
    letter-spacing: 0;
}

.batch-task-loading-placeholder .loading-spinner {
    width: 38px;
    height: 38px;
    border-width: 4px;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.35),
                inset 0 0 12px rgba(255, 255, 255, 0.18);
}

.batch-task-loading-placeholder .loading-spinner::before {
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
}

.batch-task-loading-placeholder .task-progress-bar {
    max-width: 240px;
    height: 10px;
}

.batch-task-empty-state {
    min-height: 290px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #9aa5b1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 18px;
    font-size: 1rem;
    line-height: 1.7;
}

.batch-task-empty-state .empty-icon {
    font-size: 3rem;
    line-height: 1;
}

.batch-task-empty-state .empty-text {
    font-size: 0.98rem;
    font-weight: 700;
}

.batch-task-message-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 20px;
}

.batch-task-message {
    margin: 0;
    min-height: 20px;
    flex: 1;
    color: #8b98a7;
    font-size: 0.8rem;
    line-height: 1.6;
}

.batch-task-message.is-error {
    color: #e11d48;
}

.batch-task-detail-btn {
    flex-shrink: 0;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1d4ed8;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1;
    padding: 7px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
}

.batch-task-detail-btn:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #60a5fa;
    color: #1e40af;
    transform: translateY(-1px);
}

.batch-task-detail-btn:active {
    transform: translateY(0);
}

.batch-task-prompt {
    min-height: 104px;
    margin: 0;
    padding: 14px 16px !important;
    border: 1.5px solid rgba(240, 179, 90, 0.48) !important;
    border-radius: 16px !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 249, 235, 0.98) 100%) !important;
    color: #000;
    font-size: 0.94rem !important;
    line-height: 1.7;
    resize: vertical;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 10px 24px rgba(255, 170, 0, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.batch-task-prompt::placeholder {
    color: #b08968;
}

.batch-task-prompt:hover:not(:disabled) {
    border-color: rgba(240, 179, 90, 0.82) !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(255, 248, 225, 1) 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 14px 28px rgba(255, 170, 0, 0.12);
}

.batch-task-prompt:focus {
    outline: none;
    border-color: #f59e0b !important;
    background: linear-gradient(180deg, #fffefb 0%, #fff7e8 100%) !important;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16), 0 16px 30px rgba(255, 170, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.98) !important;
}

.batch-task-prompt:disabled {
    cursor: not-allowed;
    color: #9c8b75;
    border-color: rgba(203, 213, 224, 0.9) !important;
    background: linear-gradient(180deg, rgba(249, 250, 251, 0.92) 0%, rgba(243, 244, 246, 0.96) 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.batch-task-prompt-editor-shell {
    position: relative;
    width: 100%;
}

.batch-task-prompt-editor-shell .batch-task-prompt {
    width: 100%;
    min-height: 130px;
    padding: 13px 44px 38px 13px !important;
}

.batch-prompt-corner-action {
    position: absolute;
    bottom: 8px;
    z-index: 1;
    min-height: 22px;
    padding: 3px 8px;
    border: 1px solid #e2c38b;
    border-radius: 999px;
    background: #fff7e6;
    color: #9a3412;
    cursor: pointer;
    font-size: 0.68rem;
    line-height: 1.15;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    white-space: nowrap;
}

.batch-prompt-corner-action:hover:not(:disabled) {
    background: #ffedd5;
    transform: translateY(-1px);
}

.batch-prompt-corner-action:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.batch-prompt-corner-action span:first-child {
    font-size: 0.62rem;
    line-height: 1;
}

.batch-prompt-clear-action {
    left: 6px;
}

.batch-prompt-save-action {
    left: 62px;
}

.batch-prompt-expand-action {
    right: 6px;
}

.batch-task-settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.batch-task-settings-grid .input-group {
    margin-bottom: 0;
}

.batch-task-settings-grid .input-group label {
    display: none;
}

.batch-task-actions {
    margin-top: 0;
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
}

.batch-task-actions button {
    min-width: 0;
    flex: 1;
    padding: 7px 10px;
    font-size: 0.9rem;
    line-height: 1.2;
    border-radius: 10px;
}

.batch-task-actions .batch-primary-btn,
.batch-task-actions .batch-secondary-btn {
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, background 0.2s ease;
}

.batch-task-actions .batch-primary-btn {
    background: linear-gradient(180deg, #ffbf40 0%, #ff9b05 100%);
    color: #fff;
    border: none;
    text-shadow: 0 1px 0 rgba(156, 79, 0, 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        inset 0 0 0 1px rgba(206, 113, 10, 0.58),
        inset 0 -1px 0 rgba(168, 83, 0, 0.24),
        0 6px 14px rgba(255, 152, 0, 0.18);
}

.batch-task-actions .batch-secondary-btn {
    border: none;
}

.batch-task-actions > button:first-child {
    background: linear-gradient(180deg, #fff9ee 0%, #ffe9c7 100%);
    color: #b86310;
    border: 1px solid rgba(226, 139, 36, 0.78);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.72),
        inset 0 -1px 0 rgba(219, 143, 41, 0.18),
        0 5px 12px rgba(245, 158, 11, 0.1);
}

.batch-task-actions > button:last-child {
    background: linear-gradient(180deg, #87ccfb 0%, #58b1f2 100%);
    color: #fff;
    text-shadow: 0 1px 0 rgba(28, 92, 140, 0.2);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 0 0 1px rgba(46, 125, 189, 0.54),
        inset 0 -1px 0 rgba(30, 101, 157, 0.22),
        0 6px 14px rgba(66, 153, 225, 0.16);
}

.batch-task-actions .batch-primary-btn:hover:not(:disabled),
.batch-task-actions .batch-secondary-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.batch-task-actions .batch-primary-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #ffc64f 0%, #ffa415 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 0 0 1px rgba(194, 101, 0, 0.66),
        inset 0 -1px 0 rgba(154, 74, 0, 0.28),
        0 8px 16px rgba(255, 152, 0, 0.24);
}

.batch-task-actions > button:first-child:hover:not(:disabled) {
    background: linear-gradient(180deg, #fff5e2 0%, #ffe1ae 100%);
    color: #a45100;
    border-color: rgba(214, 126, 24, 0.9);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.88),
        inset 0 -1px 0 rgba(212, 126, 24, 0.24),
        0 8px 16px rgba(245, 158, 11, 0.16);
}

.batch-task-actions > button:last-child:hover:not(:disabled) {
    background: linear-gradient(180deg, #9bd7fd 0%, #67bcf6 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.36),
        inset 0 0 0 1px rgba(34, 112, 174, 0.64),
        inset 0 -1px 0 rgba(24, 91, 147, 0.28),
        0 8px 16px rgba(66, 153, 225, 0.2);
}

.batch-task-actions .batch-primary-btn:active:not(:disabled),
.batch-task-actions .batch-secondary-btn:active:not(:disabled) {
    transform: translateY(0);
}

.batch-task-card .result-group-container {
    margin-bottom: 8px !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.batch-task-card .image-grid-container {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin-top: 0 !important;
}

.batch-task-card .image-grid-container > div {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.batch-task-card .image-grid-container > div > div:first-of-type {
    display: none !important;
}

.batch-task-card .image-grid-container > div > div:last-of-type {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.batch-task-card .generated-image {
    border-radius: 12px;
    margin-bottom: 0 !important;
}

.batch-task-card .result-model-bar {
    padding: 3px 8px !important;
    margin-bottom: 2px !important;
    font-size: 0.64rem !important;
    font-weight: 600 !important;
    border-radius: 7px !important;
    line-height: 1.25;
}

.batch-task-card .btn-result-action {
    margin-top: 0;
    padding: 6px 10px;
    font-size: 0.78rem;
}

.batch-add-task-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border: 2px dashed #ff9a1f;
    background: linear-gradient(180deg, rgba(255, 215, 154, 0.48), rgba(255, 222, 173, 0.34));
    cursor: pointer;
    transition: all 0.22s ease;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.batch-add-task-card:hover {
    transform: translateY(-2px);
    background: linear-gradient(180deg, rgba(255, 215, 154, 0.6), rgba(255, 222, 173, 0.42));
}

.batch-add-task-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    color: #ff8a00;
    text-align: center;
}

.batch-add-task-icon {
    font-size: 4.2rem;
    line-height: 1;
    font-weight: 300;
}

.batch-add-task-text {
    font-size: 1rem;
    font-weight: 800;
}

@media (max-width: 1280px) {
    .batch-top-grid {
        grid-template-columns: 1fr;
    }

    .batch-tasks-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .batch-shared-settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .batch-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .batch-toolbar-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }

    .batch-toolbar-actions .batch-primary-btn,
    .batch-toolbar-actions .batch-secondary-btn {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .batch-price-strip {
        justify-content: flex-start;
        gap: 12px;
        padding: 14px 16px;
    }

    .batch-tasks-grid {
        grid-template-columns: 1fr;
    }

    .batch-task-preview-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .batch-task-upload-layout,
    .batch-task-settings-grid,
    .batch-shared-settings-grid {
        grid-template-columns: 1fr;
    }

    .batch-task-actions {
        flex-wrap: wrap;
    }
}

/* ===== 鎵归噺浠诲姟鍗′笂浼犲尯瀵归綈浼樺寲锛堝尮閰嶅師椤甸潰鍥?椋庢牸锛?===== */
.batch-task-upload-grid {
    align-items: stretch;
}

.batch-file-upload-label {
    min-height: 92px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
}

.batch-file-upload-label .upload-icon {
    margin-bottom: 0;
    font-size: 1.5rem;
    line-height: 1;
}

.batch-upload-text {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.1;
}

.batch-task-url-input-wrapper {
    min-height: 92px;
    height: 92px;
    gap: 4px;
}

.batch-task-url-input {
    flex: 1;
    min-height: 0 !important;
    height: auto !important;
    padding: 10px 10px !important;
    line-height: 1.4;
}

.batch-task-url-load-btn {
    flex-shrink: 0;
    min-height: 26px;
    height: 26px;
    font-size: 0.82rem;
    line-height: 1;
    border-radius: 10px;
}

/* ===== 鍥剧墖棰勮涓庡浘鐗囧悗鍙颁换鍔″崱澧炲己 ===== */
.image-preview-container img,
.batch-task-preview-item img,
.batch-task-preview-image,
.generated-image,
.image-task-card-result-image {
    cursor: zoom-in;
}

.image-preview-container img,
.batch-task-preview-item img,
.generated-image,
.image-task-card-result-image {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-preview-container img:hover,
.batch-task-preview-item img:hover,
.generated-image:hover,
.image-task-card-result-image:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16);
}

.image-task-card[data-status="completed"] .task-preview {
    height: auto;
    min-height: 320px;
    background: linear-gradient(180deg, #fffaf0 0%, #fff7ed 100%);
}

.image-task-card[data-status="completed"] .task-progress-bar {
    border-top: 1px solid rgba(251, 191, 36, 0.18);
}

.image-task-card-results {
    width: 100%;
    padding: 14px;
    max-height: 560px;
    overflow-y: auto;
}

.image-task-card-results::-webkit-scrollbar {
    width: 6px;
}

.image-task-card-results::-webkit-scrollbar-track {
    background: rgba(255, 247, 237, 0.8);
    border-radius: 999px;
}

.image-task-card-results::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #f6ad55 0%, #ed8936 100%);
    border-radius: 999px;
}

.image-task-card-results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
}

.image-task-card-result-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #fde68a;
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.1);
}

.image-task-card-result-image {
    width: 100%;
    min-height: 280px;
    max-height: 460px;
    display: block;
    object-fit: contain;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
}

.image-task-card-result-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: center;
}

.video-task-result-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px 12px 0;
    background: #FFF8E1;
}

.video-task-original-btn,
.video-task-download-btn {
    width: 100%;
    margin-top: 0;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #bfdbfe;
    font-weight: 700;
}

.video-task-original-btn {
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    color: #1e3a8a;
}

.video-task-original-btn:hover {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #93c5fd;
    color: #1d4ed8;
}

.video-task-download-btn {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1d4ed8;
}

.video-task-download-btn:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #60a5fa;
    color: #1e40af;
}

.image-task-card-open-btn,
.image-task-card-download-btn {
    width: 100%;
    margin-top: 0;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #bfdbfe;
    font-weight: 700;
}

.image-task-card-open-btn {
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    color: #1e3a8a;
}

.image-task-card-open-btn:hover {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #93c5fd;
    color: #1d4ed8;
}

.image-task-card-download-btn {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1d4ed8;
}

.image-task-card-download-btn:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #60a5fa;
    color: #1e40af;
}

.task-actions-completed .btn-task-log,
.task-actions-single .btn-task-log {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #bae6fd;
    color: #0369a1;
}

.task-actions-completed .btn-task-log span,
.task-actions-single .btn-task-log span {
    background: #e0f2fe;
    color: #0369a1;
}

.task-actions-completed .btn-task-log:hover,
.task-actions-single .btn-task-log:hover {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border-color: #7dd3fc;
    color: #0c4a6e;
}

@media (max-width: 640px) {
    .image-task-card-results-grid {
        grid-template-columns: 1fr;
    }

    .image-task-card-result-actions {
        grid-template-columns: 1fr;
    }

.image-task-card-result-image {
        min-height: 220px;
        max-height: 360px;
    }
}

/* ========== MidJourney Page ========== */
.mj-page-view {
    width: 100%;
    padding: 0;
    margin-bottom: 40px;
}

.mj-main-layout {
    display: grid;
    grid-template-columns: 420px minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
}

.mj-left-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.mj-right-panel {
    min-width: 0;
    height: 100%;
}

.mj-config-card,
.mj-main-card,
.mj-result-card {
    border-radius: 16px;
}

.mj-result-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mj-result-card .card-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
}

/* Sub tabs */
.mj-sub-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 18px;
}

.mj-sub-tab {
    padding: 10px 22px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 15px;
    color: #64748b;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.mj-sub-tab:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.06);
}

.mj-sub-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 700;
}

/* Tab content */
.mj-tab-content {
    display: none;
}

.mj-tab-content.active {
    display: block;
}

/* Param grid */
.mj-param-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.mj-param-grid .input-group {
    flex: 1;
    min-width: 160px;
}

/* Action bar */
.mj-action-bar {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
    gap: 10px;
}

/* Face swap layout */
.mj-face-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 20px 0;
}

.mj-face-box {
    width: 110px;
    height: 110px;
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    overflow: hidden;
    background: #f7fafc;
    text-align: center;
    font-size: 13px;
    color: #64748b;
}

.mj-face-box:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.04);
}

.mj-face-plus {
    font-size: 28px;
    color: #a0aec0;
    font-weight: bold;
}

/* Blend images / Draw images */
.mj-image-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.mj-image-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    background: #f7fafc;
}

.mj-image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mj-image-preview-item .mj-img-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(220, 38, 38, 0.85);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    display: none;
}

.mj-image-preview-item:hover .mj-img-remove {
    display: block;
}

.mj-add-image-btn {
    padding: 8px 18px;
    border: 2px dashed #cbd5e0;
    border-radius: 10px;
    background: none;
    color: #667eea;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.mj-add-image-btn:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.06);
}

/* Tip text */
.mj-tip-text {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 12px;
}

/* MJ Tasks List (Chat Style) */
.mj-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
    height: 100%;
    overflow-y: auto;
    background: transparent;
    border-radius: 12px;
    border: none;
    scroll-behavior: smooth;
}

.mj-tasks-list::-webkit-scrollbar { width: 6px; }
.mj-tasks-list::-webkit-scrollbar-track { background: transparent; }
.mj-tasks-list::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 3px; }
.mj-tasks-list::-webkit-scrollbar-thumb:hover { background: #a0aec0; }

.mj-empty-state {
    text-align: center;
    color: #9ca3af;
    padding: 60px 20px;
    font-size: 15px;
}

/* Chat Row */
.mj-chat-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* Chat Message */
.mj-chat-msg {
    display: flex;
    gap: 10px;
    max-width: 80%;
}

.mj-chat-msg.user-msg {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.mj-chat-msg.bot-msg {
    align-self: flex-start;
}

/* Avatar */
.mj-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.user-avatar {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.bot-avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 11px;
    letter-spacing: -0.5px;
}

/* Message Content */
.mj-msg-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-msg .mj-msg-content { align-items: flex-end; }
.bot-msg .mj-msg-content { align-items: flex-start; }

.mj-msg-time {
    font-size: 11px;
    color: #9ca3af;
    padding: 0 4px;
}

/* Message Bubble */
.mj-msg-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.user-bubble {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border-top-right-radius: 4px;
}

.bot-bubble {
    background: white;
    color: #1f2937;
    border-top-left-radius: 4px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 280px;
    max-width: 520px;
}

/* Chat Image */
.mj-chat-image {
    width: 100%;
    max-width: 480px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}

.mj-chat-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Placeholder */
.mj-chat-placeholder {
    width: 100%;
    min-height: 160px;
    background: #f9fafb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 14px;
    border: 1px dashed #d1d5db;
    padding: 20px;
}

.mj-chat-placeholder.loading {
    flex-direction: column;
    gap: 12px;
    color: #3b82f6;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.mj-chat-placeholder.error {
    color: #ef4444;
    border-color: #fca5a5;
    background: #fef2f2;
}

/* Spinner */
.mj-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #bfdbfe;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: mj-spin 0.8s linear infinite;
}

@keyframes mj-spin {
    to { transform: rotate(360deg); }
}

/* Chat Action Buttons */
.mj-chat-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.mj-action-btn {
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.mj-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.mj-action-btn:active {
    transform: translateY(0);
}

.mj-btn-u {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}
.mj-btn-u:hover { background: linear-gradient(135deg, #059669, #047857); }

.mj-btn-v {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}
.mj-btn-v:hover { background: linear-gradient(135deg, #d97706, #b45309); }

.mj-btn-reroll {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}
.mj-btn-reroll:hover { background: linear-gradient(135deg, #2563eb, #1d4ed8); }

.mj-btn-default {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #d1d5db;
}
.mj-btn-default:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

/* MJ Task Card */
.mj-task-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    background: #fff;
    transition: box-shadow 0.2s;
}

.mj-task-card:hover {
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.10);
}

.mj-task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.mj-task-card-id {
    font-size: 13px;
    color: #64748b;
    font-family: monospace;
}

.mj-task-card-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.mj-task-card-status.submitted {
    background: #ebf5ff;
    color: #3b82f6;
}

.mj-task-card-status.running {
    background: #fef9c3;
    color: #ca8a04;
}

.mj-task-card-status.success {
    background: #dcfce7;
    color: #16a34a;
}

.mj-task-card-status.failed {
    background: #fee2e2;
    color: #dc2626;
}

.mj-task-card-prompt {
    font-size: 14px;
    color: #334155;
    margin-bottom: 10px;
    word-break: break-all;
}

/* Final mobile layout pass: keep the workspace readable on narrow screens. */
@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        min-height: 100dvh;
        padding: 10px 10px calc(18px + env(safe-area-inset-bottom));
    }

    .container {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }

    .header-section {
        margin-bottom: 14px;
        padding: 14px 0 8px;
    }

    h1 {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin-bottom: 8px;
        font-size: clamp(1.35rem, 6.2vw, 1.8rem);
        line-height: 1.2;
        letter-spacing: 0;
    }

    .header-logo {
        width: 36px;
        height: 36px;
        flex: 0 0 auto;
        margin: 0;
    }

    .subtitle {
        margin: 0 auto;
        max-width: 34rem;
        font-size: 0.86rem;
        line-height: 1.45;
    }

    .subtitle-tip {
        display: none;
    }

    .language-switch {
        width: 100%;
        max-width: 330px;
        margin-top: 12px;
        padding: 4px;
        gap: 4px;
    }

    .language-btn,
    .recharge-link {
        min-width: 0;
        flex: 1 1 0;
        padding: 8px 6px;
        font-size: 0.84rem;
    }

    .page-mode-switch {
        width: 100%;
        margin: 0 auto 16px;
        padding: 6px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        overflow: visible;
        border-radius: 16px;
    }

    .page-mode-btn {
        min-width: 0;
        min-height: 48px;
        padding: 7px 4px;
        border-radius: 12px;
        font-size: 0.86rem;
        line-height: 1.2;
        white-space: normal;
    }

    .page-mode-btn-icon {
        font-size: 0.95rem;
    }

    .main-content,
    #originalPageView .main-content,
    .batch-page-view,
    .canvas-page-view,
    .batch-top-grid,
    .mj-main-layout {
        width: 100%;
        max-width: 100%;
        gap: 14px;
    }

    #originalPageView .upload-card,
    #originalPageView .middle-settings-panel,
    #originalPageView .result-card {
        height: auto;
        min-height: 0;
    }

    #originalPageView .upload-card .card-body,
    #originalPageView .middle-settings-panel,
    #originalPageView .result-body {
        overflow: visible;
    }

    .card {
        border-radius: 14px;
    }

    .card h3 {
        padding: 13px 14px;
        font-size: 0.92rem;
    }

    .card-body,
    .video-tasks-container,
    .image-tasks-container {
        padding: 14px;
    }

    #originalPageView .temporary-materials-dock {
        left: 0;
        top: 50%;
        transform: translateY(-50%);
    }

    #originalPageView .temporary-materials-toggle {
        width: 28px;
        height: 64px;
        min-height: 64px;
        padding: 6px 2px;
        border-radius: 0 10px 10px 0;
        opacity: 0.92;
        gap: 3px;
    }

    #originalPageView .temporary-materials-toggle-icon {
        font-size: 0.76rem;
    }

    #originalPageView .temporary-materials-toggle-label {
        font-size: 0.62rem;
        letter-spacing: 0;
    }

    #originalPageView .temporary-materials-count {
        min-width: 13px;
        height: 13px;
        padding: 0 2px;
        font-size: 0.5rem;
        line-height: 13px;
    }

    #originalPageView .prompt-library-toggle {
        top: calc(100% + 8px);
    }

    #originalPageView .temporary-materials-panel,
    #originalPageView .prompt-library-dock-panel {
        left: 34px;
        top: max(8px, env(safe-area-inset-top));
        width: min(300px, calc(100vw - 42px));
        height: min(640px, calc(100dvh - 16px));
        max-height: calc(100dvh - 16px);
        border-radius: 0 14px 14px 0;
    }

    #originalPageView .temporary-materials-panel {
        padding: 12px;
    }

    #originalPageView .temporary-materials-header h2 {
        font-size: 1rem;
    }

    #originalPageView .temporary-materials-header p,
    #originalPageView .temporary-materials-footer {
        font-size: 0.7rem;
    }

    #originalPageView .temporary-materials-tip {
        margin: 10px 0 8px;
        padding: 9px 10px;
        font-size: 0.76rem;
    }

    #originalPageView .temporary-materials-grid {
        gap: 8px;
    }

    #originalPageView .prompt-library-dock-panel {
        width: min(340px, calc(100vw - 42px));
        grid-template-columns: 68px minmax(0, 1fr);
        grid-template-rows: 40px minmax(0, 1fr) 28px;
    }

    #originalPageView .prompt-dock-sidebar {
        padding: 8px 4px;
    }

    #originalPageView .prompt-dock-content {
        padding: 8px;
    }

    #originalPageView .prompt-dock-compose {
        gap: 5px;
    }

    #originalPageView .prompt-dock-compose button {
        padding: 0 8px;
    }

    .glass-input,
    .glass-select,
    input,
    select,
    textarea,
    button {
        max-width: 100%;
    }
}

.mj-task-card-progress {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.mj-task-card-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    transition: width 0.4s;
}

.mj-task-card-image {
    width: 100%;
    max-height: 512px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 10px;
    background: #f1f5f9;
}

/* MJ Action Buttons (U1-U4, V1-V4, etc.) */
.mj-task-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.mj-task-card-actions button {
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
}

.mj-task-card-actions button:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.mj-task-card-actions button.mj-btn-upscale {
    color: #2563eb;
    border-color: #93c5fd;
}

.mj-task-card-actions button.mj-btn-variation {
    color: #d97706;
    border-color: #fcd34d;
}

.mj-task-card-actions button.mj-btn-reroll {
    color: #059669;
    border-color: #6ee7b7;
}

/* ===== MJ Draw Panel - Aspect Ratio Bar ===== */
.mj-draw-section {
    margin-bottom: 14px;
}

.mj-section-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 10px;
}

.mj-aspect-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mj-aspect-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: #f7fafc;
    transition: all 0.2s ease;
    min-width: 60px;
}

.mj-aspect-item:hover {
    background: #fff7ed;
    border-color: #fbd38d;
}

.mj-aspect-item.active {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #f6ad55;
    box-shadow: 0 4px 12px rgba(246, 173, 85, 0.2);
}

.mj-aspect-box-wrap {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mj-aspect-box {
    background: #cbd5e0;
    border-radius: 4px;
    transition: background 0.2s;
}

.mj-aspect-item.active .mj-aspect-box {
    background: #f6ad55;
}

.mj-aspect-item p {
    margin: 0;
    font-size: 0.76rem;
    font-weight: 700;
    color: #64748b;
}

.mj-aspect-item.active p {
    color: #c05621;
}

/* ===== MJ Draw Panel - More Settings ===== */
.mj-more-settings {
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fffdf7;
    overflow: hidden;
}

.mj-more-summary {
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #4a5568;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background 0.2s;
}

.mj-more-summary::-webkit-details-marker {
    display: none;
}

.mj-more-summary::after {
    content: '鈻?;
    float: right;
    font-size: 0.7rem;
    color: #a0aec0;
    transition: transform 0.2s;
}

.mj-more-settings[open] .mj-more-summary::after {
    transform: rotate(180deg);
}

.mj-more-summary:hover {
    background: #fff7ed;
}

.mj-settings-body {
    padding: 6px 16px 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px 16px;
}

.mj-setting-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mj-setting-label {
    min-width: 58px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
}

.mj-setting-select,
.mj-setting-input {
    flex: 1;
    min-width: 0;
    padding: 7px 10px !important;
    font-size: 0.82rem !important;
    border-radius: 10px !important;
}

/* ===== MJ Draw Panel - Tool Tags ===== */
.mj-draw-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.mj-tool-tag {
    padding: 7px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #4a5568;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.mj-tool-tag:hover {
    border-color: #f6ad55;
    background: #fff7ed;
    color: #c05621;
}

/* ===== MJ Draw Panel - Clear Button ===== */
.mj-clear-btn {
    padding: 10px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f7fafc;
    color: #64748b;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mj-clear-btn:hover {
    background: #fff5f5;
    border-color: #feb2b2;
    color: #e53e3e;
}

@media (max-width: 900px) {
    .mj-main-layout {
        grid-template-columns: 1fr;
    }
}

/* ========== 鎶ラ敊瑙ｈ ========== */
.error-guide-btn {
    margin-left: auto;
    padding: 6px 14px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    color: #c05621;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(246, 173, 85, 0.16);
    border: 1px solid #fbd38d;
}

.error-guide-btn:hover {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(246, 173, 85, 0.24);
}

.error-guide-modal {
    position: fixed;
    inset: 0;
    z-index: 3200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(7px);
}

.error-guide-dialog {
    width: min(880px, 100%);
    max-height: 92vh;
    background: #fffaf0;
    border-radius: 22px;
    border: 1px solid #fbd38d;
    box-shadow: 0 25px 70px rgba(15, 23, 42, 0.24);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.error-guide-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 18px;
    background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%);
    border-bottom: 1px solid #fde68a;
}

.error-guide-header h3 {
    margin: 0 0 6px;
    font-size: 1.25rem;
    font-weight: 800;
    color: #7c2d12;
    padding: 0;
    border: none;
    background: none;
}

.error-guide-header p {
    margin: 0;
    color: #9a3412;
    font-size: 0.9rem;
}

.error-guide-close-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    color: #9a3412;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(154, 52, 18, 0.12);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.error-guide-close-btn:hover {
    background: #fff;
    transform: scale(1.05);
}

.error-guide-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 24px 20px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #f6ad55 #fff7ed;
}

.error-guide-content::-webkit-scrollbar {
    width: 8px;
}

.error-guide-content::-webkit-scrollbar-track {
    background: #fff7ed;
    border-radius: 999px;
}

.error-guide-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #f6ad55 0%, #ed8936 100%);
    border-radius: 999px;
}

/* 鎶ラ敊瑙ｈ - 琛ㄦ牸鏍峰紡 */
.error-guide-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #fde68a;
    border-radius: 12px;
    overflow: hidden;
    font-size: 0.88rem;
}

.error-guide-table thead th {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    color: #7c2d12;
    font-weight: 800;
    font-size: 0.82rem;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid #fbd38d;
    white-space: nowrap;
}

.error-guide-table thead th:nth-child(1) {
    color: #dc2626;
}

.error-guide-table thead th:nth-child(2) {
    color: #b45309;
}

.error-guide-table thead th:nth-child(3) {
    color: #15803d;
}

.error-guide-table tbody td {
    padding: 12px 16px;
    color: #334155;
    line-height: 1.6;
    word-break: break-word;
    border-bottom: 1px solid #fef3c7;
    vertical-align: top;
    background: #fff;
}

.error-guide-table tbody tr:last-child td {
    border-bottom: none;
}

.error-guide-table tbody tr:hover td {
    background: #fffaf0;
}

.error-guide-table .eg-col-error {
    width: 30%;
    color: #dc2626;
    font-weight: 600;
}

.error-guide-table .eg-col-desc {
    width: 35%;
    color: #b45309;
}

.error-guide-table .eg-col-solution {
    width: 35%;
    color: #15803d;
    font-weight: 600;
}

@media (max-width: 640px) {
    #originalPageView .reference-upload-status {
        gap: 2px;
        padding-left: 4px;
        padding-right: 4px;
    }

    #originalPageView .reference-upload-status > span {
        font-size: 0.76rem;
    }

    #originalPageView .reference-upload-actions {
        gap: 1px;
    }

    #originalPageView .reference-upload-generated,
    #originalPageView .reference-upload-more,
    #originalPageView .reference-upload-clear {
        padding-left: 3px;
        padding-right: 3px;
        font-size: 0.68rem;
    }

    .error-guide-modal {
        padding: 14px;
    }

    .error-guide-header,
    .error-guide-content {
        padding-left: 16px;
        padding-right: 16px;
    }

    .error-guide-table {
        font-size: 0.8rem;
    }

    .error-guide-table thead th,
    .error-guide-table tbody td {
        padding: 8px 10px;
    }
}

/* ========== Mobile-only adaptive overrides ========== */
@media (max-width: 1024px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .main-content,
    .batch-top-grid,
    .mj-main-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .container,
    #originalPageView,
    #batchPageView,
    #canvasPageView,
    .mj-page-view,
    .main-content,
    .left-panel,
    .right-panel,
    .batch-page-view,
    .batch-top-grid,
    .batch-toolbar,
    .batch-toolbar-stats,
    .batch-toolbar-actions,
    .card,
    .card-body,
    .video-tasks-container,
    .image-tasks-container,
    .mj-main-layout,
    .mj-left-panel,
    .mj-right-panel,
    .mj-config-card,
    .mj-main-card,
    .mj-result-card,
    .canvas-page-view,
    .canvas-app-frame {
        min-width: 0;
        max-width: 100%;
    }

    img,
    video,
    canvas,
    svg,
    iframe,
    input,
    select,
    textarea,
    button {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .container {
        width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    .header-section {
        padding: 24px 0;
        margin-bottom: 24px;
    }

    h1 {
        font-size: clamp(1.55rem, 7vw, 2.1rem);
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .subtitle,
    .live-logs,
    .request-preview,
    .prompt-content,
    .image-task-tip,
    .batch-shared-settings-tip,
    .error-guide-content {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .page-mode-switch {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }

    .page-mode-btn {
        flex: 1 0 auto;
        min-width: 0;
        padding-left: 10px;
        padding-right: 10px;
        white-space: nowrap;
    }

    .main-content,
    .batch-page-view,
    .canvas-page-view,
    .batch-top-grid,
    .mj-main-layout {
        gap: 18px;
    }

    .canvas-app-frame {
        height: calc(100vh - 170px);
        min-height: 620px;
        border-radius: 14px;
    }

    .canvas-page-view.canvas-expanded {
        padding: 6px;
    }

    .canvas-page-view.canvas-expanded .canvas-app-frame {
        min-height: 0;
        border-radius: 0 0 10px 10px;
    }

    .card-body,
    .video-tasks-container,
    .image-tasks-container {
        padding: 16px;
    }

    .batch-toolbar,
    .video-tasks-header,
    .batch-toolbar-actions,
    .image-task-card-result-actions {
        flex-wrap: wrap;
    }

    .batch-toolbar-actions,
    .batch-toolbar-actions button,
    .video-tasks-header h3 {
        width: 100%;
    }

    .glass-input,
    .glass-select,
    .url-input-wrapper,
    .url-input-wrapper textarea,
    .batch-url-input-wrapper,
    .batch-url-input-wrapper textarea,
    .batch-task-url-input-wrapper,
    .batch-task-url-input,
    .image-preview-container,
    .generated-image,
    .image-task-card-result-image,
    .batch-task-preview-image {
        max-width: 100%;
    }

    .page-mode-switch,
    .batch-toolbar-actions .batch-primary-btn,
    .batch-toolbar-actions .batch-secondary-btn,
    .mj-sub-tab,
    .mj-aspect-item {
        min-width: 0;
    }

    .mj-sub-tabs,
    .mj-aspect-bar,
    .error-guide-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .error-guide-table {
        min-width: 0;
        table-layout: fixed;
    }
}

@media (max-width: 430px) {
    body {
        padding: 8px;
    }

    .page-mode-switch {
        gap: 6px;
        padding: 6px;
        border-radius: 16px;
    }

    .page-mode-btn {
        min-height: 48px;
        gap: 6px;
        font-size: 0.88rem;
        border-radius: 12px;
    }

    .card h3,
    .card-body,
    .video-tasks-container,
    .image-tasks-container,
    .batch-toolbar {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* ========== Generated image reference picker ========== */
.upload-grid.has-reference-picker,
.batch-task-upload-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.generated-reference-entry {
    width: 100%;
    min-height: 80px;
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    transition: all 0.2s ease;
}

.generated-reference-entry:hover {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.generated-reference-entry.is-disabled,
.generated-reference-entry:disabled {
    opacity: 0.62;
    cursor: not-allowed;
}

.batch-generated-reference-entry {
    min-height: 106px;
    border-radius: 18px;
    font-size: 0.98rem;
}

.history-reference-actions {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 8px;
    margin: 8px 0 4px;
    padding: 0 9px;
}

.generated-result-actions,
.image-task-card-result-actions {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 0;
    flex-wrap: wrap;
}

.generated-result-actions .btn-result-action,
.image-task-card-result-actions .btn-result-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    margin-top: 0 !important;
    padding: 0 10px !important;
    border-radius: 10px !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
    word-break: keep-all;
    flex: 0 0 auto;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.generated-result-actions .btn-result-action:not(.generated-result-reference-btn),
.image-task-card-result-actions .image-task-card-open-btn,
.image-task-card-result-actions .image-task-card-download-btn {
    width: auto !important;
    flex: 1 1 66px;
    max-width: calc(50% - 4px);
    min-width: 66px;
    border-color: #cbd5e1 !important;
    background: #ffffff !important;
    color: #334155 !important;
}

.generated-result-actions .btn-result-action:not(.generated-result-reference-btn):hover,
.image-task-card-open-btn:hover,
.image-task-card-download-btn:hover {
    border-color: #94a3b8 !important;
    background: #f8fafc !important;
    color: #0f172a !important;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.generated-result-actions .generated-result-reference-btn,
.image-task-card-result-actions .image-task-card-reference-btn {
    flex: 1 1 auto;
    width: auto !important;
    min-width: 92px;
    padding: 0 12px !important;
}

.history-download-btn,
.history-reference-btn,
.generated-result-reference-btn,
.image-task-card-reference-btn {
    border-color: #86efac !important;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
    color: #14532d !important;
}

.history-download-btn,
.history-reference-btn {
    flex: 1 1 0;
    min-height: 34px;
    margin: 0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    word-break: keep-all;
}

.history-download-btn {
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #334155 !important;
}

.history-download-btn:hover {
    border-color: #94a3b8 !important;
    background: #f8fafc !important;
    color: #0f172a !important;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.history-reference-btn:hover,
.generated-result-reference-btn:hover,
.image-task-card-reference-btn:hover {
    border-color: #4ade80 !important;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
    color: #14532d !important;
    box-shadow: 0 5px 12px rgba(22, 163, 74, 0.16);
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .generated-result-actions,
    .image-task-card-result-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .generated-result-actions .btn-result-action,
    .image-task-card-result-actions .btn-result-action {
        width: 100%;
        min-width: 0;
        padding: 0 10px !important;
    }

    .generated-result-actions .generated-result-reference-btn,
    .image-task-card-result-actions .image-task-card-reference-btn {
        grid-column: 1 / -1;
    }
}

@media (max-width: 380px) {
    .generated-result-actions,
    .image-task-card-result-actions {
        grid-template-columns: 1fr;
    }

    .generated-result-actions .generated-result-reference-btn,
    .image-task-card-result-actions .image-task-card-reference-btn {
        grid-column: auto;
    }
}

.generated-image-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 6000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(6px);
}

.generated-image-picker-dialog {
    width: min(980px, 100%);
    max-height: min(86vh, 820px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid #dbeafe;
    background: #ffffff;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
}

.generated-image-picker-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.generated-image-picker-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 1.1rem;
    line-height: 1.35;
}

.generated-image-picker-header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.86rem;
    line-height: 1.5;
}

.generated-image-picker-close {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 800;
}

.generated-image-picker-search {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 10px 12px;
    color: #0f172a;
    background: #f8fafc;
    font-size: 0.92rem;
}

.generated-image-picker-grid {
    min-height: 220px;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 2px 2px 4px;
}

.generated-image-picker-card {
    min-width: 0;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    text-align: left;
    transition: all 0.2s ease;
}

.generated-image-picker-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.12);
}

.generated-image-picker-card.is-selected {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}

.generated-image-picker-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8fafc;
}

.generated-image-picker-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.generated-image-picker-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 36px;
}

.generated-image-picker-page-btn {
    min-height: 34px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    padding: 6px 12px;
    font-size: 0.84rem;
    font-weight: 700;
}

.generated-image-picker-page-btn:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.generated-image-picker-page-btn:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.generated-image-picker-page-info {
    color: #64748b;
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
}

.generated-image-picker-meta {
    min-height: 68px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
}

.generated-image-picker-meta strong,
.generated-image-picker-meta span {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
}

.generated-image-picker-meta strong {
    -webkit-line-clamp: 1;
    color: #1e293b;
    font-size: 0.78rem;
}

.generated-image-picker-meta span {
    -webkit-line-clamp: 2;
    color: #64748b;
    font-size: 0.74rem;
    line-height: 1.35;
}

.generated-image-picker-empty {
    grid-column: 1 / -1;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
}

.generated-image-picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 4px;
}

.generated-image-picker-count {
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 700;
}

.generated-image-picker-add {
    min-height: 40px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: #ffffff;
    cursor: pointer;
    padding: 10px 18px;
    font-weight: 800;
}

.generated-image-picker-add:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (max-width: 900px) {
    .upload-grid.has-reference-picker,
    .batch-task-upload-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .generated-image-picker-modal {
        padding: 10px;
        align-items: stretch;
    }

    .generated-image-picker-dialog {
        max-height: calc(100vh - 20px);
        border-radius: 14px;
        padding: 14px;
    }

    .generated-image-picker-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .generated-image-picker-pagination {
        gap: 8px;
    }

    .generated-image-picker-page-btn {
        flex: 1 1 92px;
        padding: 6px 10px;
    }

    .generated-image-picker-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .generated-image-picker-add {
        width: 100%;
    }
}

/* Flatten image background task cards without changing their actions. */
#imageTasksList .image-task-card {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid #f1d7a4;
    border-radius: 10px;
    box-shadow: none;
}

#imageTasksList .image-task-card:hover {
    transform: none;
    border-color: #f6ad55;
    box-shadow: none;
}

#imageTasksList .image-task-card[data-status="completed"] .task-preview {
    min-height: 0;
    background: transparent;
}

#imageTasksList .image-task-card-results {
    padding: 8px 12px 4px;
}

#imageTasksList .image-task-card-results-grid {
    gap: 12px;
}

#imageTasksList .image-task-card-result-item {
    gap: 8px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#imageTasksList .image-task-card-result-image {
    width: 100%;
    height: 230px;
    min-height: 0;
    max-height: none;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
    object-fit: contain;
}

#imageTasksList .image-task-card-result-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

#imageTasksList .image-task-card-result-actions .btn-result-action {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: none !important;
}

#imageTasksList .image-task-card-result-actions .image-task-card-material-btn {
    border-color: #86efac !important;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
    color: #166534 !important;
}

#imageTasksList .image-task-card-result-actions .image-task-card-material-btn:hover {
    border-color: #4ade80 !important;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
    color: #14532d !important;
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.12);
}

#imageTasksList .image-task-card-result-actions .image-task-card-material-btn:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

#imageTasksList .image-task-card .task-progress-bar {
    height: 4px;
    border-radius: 0;
    background: #f5ead7;
    box-shadow: none;
}

#imageTasksList .image-task-card .task-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 9px 14px 7px;
    border-top: 1px solid #f3e3c5;
    background: transparent;
}

#imageTasksList .image-task-card .task-id {
    flex: 1 1 220px;
    margin-bottom: 0;
}

#imageTasksList .image-task-card .task-status,
#imageTasksList .image-task-card .task-time {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    #imageTasksList .image-task-card-result-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #imageTasksList .image-task-card-result-actions .image-task-card-reference-btn,
    #imageTasksList .image-task-card-result-actions .image-task-card-material-btn {
        grid-column: auto;
    }
}

#imageTasksList .image-task-card .image-task-model-bar {
    margin: 0 0 0 auto;
    max-width: min(100%, 360px);
}

#imageTasksList .image-task-card .task-actions {
    gap: 8px;
    padding: 7px 14px 12px;
    border-top: 0;
    background: transparent;
}

/* Keep transformed fixed drawers from contributing to mobile page width. */
@media (max-width: 768px) {
    html,
    body {
        overflow-x: clip !important;
    }

    .page-mode-switch {
        display: flex !important;
        grid-template-columns: none;
        justify-content: flex-start;
        gap: 8px;
        padding: 6px;
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }

    .page-mode-switch::-webkit-scrollbar {
        display: none;
    }

    .page-mode-btn {
        flex: 0 0 118px !important;
        width: 118px;
        min-width: 118px;
        min-height: 48px;
        white-space: nowrap;
        scroll-snap-align: start;
    }

    #originalPageView .quick-prompts-header label {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    #originalPageView .quick-prompts-header .prompt-library-open-btn {
        width: auto;
    }

}
