:root {
    --color-primary: #18181b;
    --color-primary-hover: #27272a;
    --color-secondary: #71717a;
    --sidebar-width: 200px;
    --thumbnail-size: 100px;
    --bottom-height: 200px;
    --panel-bg: rgba(255, 255, 255, 0.96);
    --panel-bg-dark: rgba(24, 24, 27, 0.96);
    --panel-border: rgba(228, 228, 231, 0.8);
    --panel-border-dark: rgba(39, 39, 42, 0.8);
    --text-primary: #18181b;
    --text-secondary: #71717a;
    --text-tertiary: #a1a1aa;
    --text-dark-primary: #fafafa;
    --text-dark-secondary: #a1a1aa;
    --text-dark-tertiary: #71717a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: default;
    user-select: none;
}

#app {
    width: 100%;
    height: 100%;
}

button {
    transition: all 0.2s ease;
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

input[type="file"] {
    display: none;
}

.panel {
    position: fixed;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
    z-index: 10;
    padding: 8px;
    backdrop-filter: blur(24px);
    transition: all 0.15s ease;
}

.dark .panel {
    background: var(--panel-bg-dark);
    border-color: var(--panel-border-dark);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
}

.canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas-image {
    max-width: unset;
    max-height: unset;
    position: absolute;
    user-select: none;
    -webkit-user-drag: none;
    transform-origin: top left;
    box-shadow: 0 0px 0px rgb(0 0 0 / 4%), 0 0px 12px rgb(0 0 0 / 10%);
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 150;
    backdrop-filter: blur(4px);
}

.loading-container {
    background: white;
    border-radius: 16px;
    padding: 32px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.dark .loading-container {
    background: #1c1c1e;
}

.loading-spinner-large {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--color-primary);
    animation: spin 0.8s linear infinite;
}

.dark .loading-spinner-large {
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: white;
}

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

.dark .loading-text {
    color: var(--text-dark-primary);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.mark-point {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #446cef;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 0 8px rgba(68, 79, 239, 0.6);
    transform: translate(-50%, -50%);
    z-index: 20;
    transition: all 0.2s ease;
}

.mark-point:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

.mark-point:active {
    cursor: grabbing;
}

.mark-point::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    background: transparent;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.mark-point-label {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
}

.dark .modal {
    background: #1c1c1e;
}

.thumbnail {
    width: var(--thumbnail-size);
    height: var(--thumbnail-size);
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    overflow: hidden;
    flex-shrink: 0;
}

.thumbnail:hover {
    opacity: 0.8;
}

.thumbnail.active {
    border-color: var(--color-primary);
    box-shadow: 0 0 8px var(--color-primary);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.thumbnail-container {
    position: relative;
    width: var(--thumbnail-size);
    height: var(--thumbnail-size);
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 250, 252, 0.8);
}

.dark .thumbnail-container {
    background: rgba(30, 30, 35, 0.8);
}

.thumbnail-container.active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(24, 24, 27, 0.15);
}

.dark .thumbnail-container.active {
    border-color: white;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.thumbnail-container:hover {
    /* transform: scale(1.05); */
    border-color: var(--text-secondary);
}

.thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
}

.thumbnail-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(156, 163, 175, 0.1);
}

.branch-indicator {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.dark .branch-indicator {
    border-color: rgba(30, 30, 35, 0.95);
}


/* 响应式调整 */
@media (max-width: 768px) {
    .panel {
        padding: 12px;
        font-size: 14px;
    }
    
    .thumbnail {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 12px 12px 0 0;
        max-height: 50vh;
        overflow-y: auto;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 128, 0.7);
}

.dark ::-webkit-scrollbar-thumb {
    background: rgba(107, 114, 128, 0.5);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.7);
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
}

.dark .shortcut-item {
    background: rgba(255, 255, 255, 0.04);
}

.shortcut-key {
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-weight: 500;
    padding: 4px 10px;
    background: white;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.dark .shortcut-key {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--panel-border-dark);
    color: var(--text-dark-secondary);
}

.shortcut-desc {
    color: var(--text-primary);
    font-size: 14px;
}

.dark .shortcut-desc {
    color: var(--text-dark-primary);
}

.crop-box {
    position: absolute;
    border: 2px solid #3b82f6;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    cursor: move;
    box-sizing: border-box;
    z-index: 15;
}

.crop-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 16;
    transition: all 0.15s ease;
}

.crop-handle:hover {
    transform: scale(1.3);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.dark .crop-handle {
    background: var(--color-primary);
    border-color: white;
}

.crop-handle-nw {
    top: -6px;
    left: -6px;
    cursor: nwse-resize;
}

.crop-handle-ne {
    top: -6px;
    right: -6px;
    cursor: nesw-resize;
}

.crop-handle-sw {
    bottom: -6px;
    left: -6px;
    cursor: nesw-resize;
}

.crop-handle-se {
    bottom: -6px;
    right: -6px;
    cursor: nwse-resize;
}

.crop-handle-n {
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.crop-handle-s {
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.crop-handle-w {
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.crop-handle-e {
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.crop-size-label {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    font-family: monospace;
}

.crop-toolbar {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}

.crop-toolbar-content {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 8px 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(24px);
}

.dark .crop-toolbar-content {
    background: var(--panel-bg-dark);
    border-color: var(--panel-border-dark);
}

.crop-select,
.crop-input {
    padding: 6px 12px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: white;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
    color: var(--text-primary);
}

.crop-select:focus,
.crop-input:focus {
    border-color: var(--color-primary);
}

.dark .crop-select,
.dark .crop-input {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--panel-border-dark);
    color: var(--text-dark-primary);
}

.dark .crop-select:focus,
.dark .crop-input:focus {
    border-color: white;
}

.crop-input {
    width: 90px;
    text-align: center;
}

.crop-final-size {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-weight: 500;
    min-width: 100px;
    text-align: center;
}

.dark .crop-final-size {
    color: var(--text-dark-secondary);
}

.crop-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
}

.crop-btn-confirm {
    background: var(--color-primary);
    color: white;
}

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

.dark .crop-btn-confirm {
    background: white;
    color: var(--color-primary);
}

.dark .crop-btn-confirm:hover {
    background: #f4f4f5;
}

.crop-btn-cancel {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
    border: 1px solid var(--panel-border);
}

.crop-btn-cancel:hover {
    background: rgba(0, 0, 0, 0.08);
}

.dark .crop-btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dark-primary);
    border-color: var(--panel-border-dark);
}

.dark .crop-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.12);
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    background: transparent;
    color: var(--text-primary);
}

.dark .icon-btn {
    color: var(--text-dark-primary);
}

.icon-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.icon-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.06);
}

.dark .icon-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
}

.icon-btn:active:not(:disabled) {
    background: rgba(0, 0, 0, 0.1);
}

.dark .icon-btn:active:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

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

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

.dark .icon-btn-primary {
    background: white;
    color: var(--color-primary);
}

.dark .icon-btn-primary:hover:not(:disabled) {
    background: #f4f4f5;
}

.icon-btn-danger-active {
    background: #3D9BFF40!important;
    color: #147DFF!important;
    border-color: #147DFF!important;
}

.dark .icon-btn-danger-active {
    background: #3D9BFF40!important;
    color: #147DFF!important;
    border-color: #147DFF!important;
}

.icon-btn-mini {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    background: transparent;
    color: var(--text-primary);
}

.dark .icon-btn-mini {
    color: var(--text-dark-primary);
}

.icon-btn-mini:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.icon-btn-mini:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.06);
}

.dark .icon-btn-mini:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
}

.divider {
    height: 1px;
    background: var(--panel-border);
    margin: 6px 0;
}

.dark .divider {
    background: var(--panel-border-dark);
}

.quick-prompt-btn {
    padding: 8px 16px;
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-prompt-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--text-secondary);
}

.quick-prompt-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.dark .quick-prompt-btn {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dark-primary);
    border-color: var(--panel-border-dark);
}

.dark .quick-prompt-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--text-dark-secondary);
}

.btn-primary {
    padding: 10px 20px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.btn-primary:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

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

.dark .btn-primary:hover:not(:disabled) {
    background: #f4f4f5;
}

.btn-secondary {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.08);
}

.dark .btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dark-primary);
    border-color: var(--panel-border-dark);
}

.dark .btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

.pwd-mask{
    -webkit-text-security: disc;
    text-security: disc;
}

.input-field {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    background: white;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.15s ease;
    word-break: break-all;
}

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

.dark .input-field {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--panel-border-dark);
    color: var(--text-dark-primary);
}

.dark .input-field:focus {
    border-color: white;
}

textarea.input-field {
    resize: vertical;
    font-family: inherit;
}

textarea.resize-none {
    resize: none;
}

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

.dark .modal-header {
    border-color: var(--panel-border-dark);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.dark .modal-title {
    color: var(--text-dark-primary);
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

.dark .modal-close-btn {
    color: var(--text-dark-secondary);
}

.dark .modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dark-primary);
}

.history-list-show{
    margin-left: -4px;
}

.bottom-bar-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
    transition: all 0.15s ease;
}

.bottom-bar-container.input-focus {
    background: white;
    border-color: var(--text-secondary);
}

.dark .bottom-bar-container {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--panel-border-dark);
    color: var(--text-dark-primary);
}

.dark .bottom-bar-container.input-focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-dark-secondary);
}

.bottom-bar-textarea {
    flex: 1;
    padding: 1px 8px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    min-height: 40px;
    max-height: 120px;
    font-family: inherit;
    width: 100%;
    background: none;
}

.dark .bottom-bar-textarea {
    color: var(--text-dark-primary);
}

.bottom-bar-input-toolbar{
    display: flex;
    flex-direction: row;
}

.bottom-bar-icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--panel-border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.bottom-bar-icon-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.dark .bottom-bar-icon-btn {
    border-color: var(--panel-border-dark);
    color: var(--text-dark-secondary);
}

.dark .bottom-bar-icon-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-dark-primary);
}

.bottom-bar-run-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: var(--color-primary);
    color: white;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.bottom-bar-run-btn:hover:not(:disabled) {
    background: var(--color-primary-hover);
}

.bottom-bar-run-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.dark .bottom-bar-run-btn {
    background: #848484;
    color: var(--color-primary);
}

.dark .bottom-bar-run-btn:hover:not(:disabled) {
    background: #f4f4f5;
}

.bottom-bar-prompts-row {
    overflow-x: scroll;
    pointer-events: all;
    padding-left: 16px;
}

.bottom-bar-prompts-row-container{
    padding: 2px 0;
    position: absolute;
    top: -40px;
    left: -4px;
    /* width: calc(100% + 16px); */
    width: 100%;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to right, transparent, black 20px, black calc(100% - 20px), transparent);
    mask-image: linear-gradient(to right, transparent, black 20px, black calc(100% - 20px), transparent);
}

.bottom-bar-prompts-row::-webkit-scrollbar {
    display: none;

}

.bottom-bar-prompt-btn {
    padding: 2px 12px;
    background: rgb(240, 240, 240);
    color: var(--text-primary);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.bottom-bar-prompt-btn:hover:not(:disabled) {
    background: rgb(245, 245, 245);
    border-color: var(--text-secondary);
}

.bottom-bar-prompt-btn:disabled {
    background: rgb(130, 130, 130);
    cursor: not-allowed;
}

.dark .bottom-bar-prompt-btn {
    background: rgb(20, 20, 20);
    color: var(--text-dark-primary);
    border-color: var(--panel-border-dark);
}

.dark .bottom-bar-prompt-btn:hover:not(:disabled) {
    background: rgb(30,30,30);
    border-color: var(--text-dark-secondary);
}

.prompt-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
}

.prompt-menu {
    position: fixed;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    z-index: 51;
    backdrop-filter: blur(24px);
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.dark .prompt-menu {
    background: var(--panel-bg-dark);
    border-color: var(--panel-border-dark);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.prompt-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--panel-border);
}

.dark .prompt-menu-header {
    border-color: var(--panel-border-dark);
}

.prompt-menu-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.dark .prompt-menu-title {
    color: var(--text-dark-primary);
}

.prompt-menu-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.prompt-menu-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

.dark .prompt-menu-close {
    color: var(--text-dark-secondary);
}

.dark .prompt-menu-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dark-primary);
}

.prompt-menu-list {
    overflow-y: auto;
    max-height: 340px;
    padding: 4px;
}

.prompt-menu-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.prompt-menu-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.dark .prompt-menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.prompt-menu-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.dark .prompt-menu-item-title {
    color: var(--text-dark-primary);
}

.prompt-menu-item-content {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark .prompt-menu-item-content {
    color: var(--text-dark-secondary);
}

.prompt-menu-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.dark .prompt-menu-empty {
    color: var(--text-dark-secondary);
}

.image-tag {
    padding: 0 4px;
    border-radius: 8px;
    cursor: pointer;
    border: 0.5px solid #919191;
    color: #363636;
    display: inline-flex;
    height: 24px;
    align-items: center;
    transition: opacity 0.2s ease-in-out;
}

.image-tag:hover {
    background: rgba(12, 12, 13, 0.04);
}

.dark .image-tag {
    border-color: #606060;
    color: var(--text-dark-primary);
}

.dark .image-tag:hover {
    background: rgba(255, 255, 255, 0.06);
}

.image-preview-popup {
    position: fixed;
    width: 120px;
    height: 120px;
    background: white;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 100;
    pointer-events: none;
    transform: translateX(-50%);
    overflow: hidden;
}

.dark .image-preview-popup {
    background: #1c1c1e;
    border-color: var(--panel-border-dark);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.image-preview-popup img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-container {
    margin-top: 16px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    overflow: hidden;
    max-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.02);
}

.dark .image-preview-container {
    border-color: var(--panel-border-dark);
    background: rgba(255, 255, 255, 0.02);
}

.image-preview {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
}