/* ============================================
   批量图片生成工具样式 - Batch Image Generator Styles
   ============================================ */

:root {
    --accent: #2563eb;
    --panel-bg: #ffffff;
    --app-bg: #f3f4f6;
    --border: #e2e8f0;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--app-bg);
    overflow: hidden;
}

/* 左侧面板 */
aside {
    width: 380px;
    background: var(--panel-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 10px 0 30px rgba(0,0,0,0.02);
}

.aside-header {
    padding: 24px;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -1px;
}

.scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.group {
    margin-bottom: 24px;
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.group-label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 16px;
    display: block;
    letter-spacing: 1px;
}

.ctrl-row {
    margin-bottom: 15px;
}

.ctrl-row label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: 500;
}

.ctrl-row label span {
    color: var(--accent);
    font-family: monospace;
}

textarea, select, input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

textarea:focus, select:focus, input[type="text"]:focus {
    border-color: var(--accent);
}

.btn-gen {
    background: #000;
    color: #fff;
    border: none;
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-gen:hover {
    background: #333;
    transform: translateY(-1px);
}

.btn-gen:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-sub {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 12px;
    margin-top: 8px;
    transition: all 0.2s;
}

.btn-sub:hover {
    background: #e2e8f0;
}

/* 右侧预览区 */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px;
}

.preview-container {
    flex: 1;
    overflow-y: auto;
    width: 100%;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 10px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    margin: 10px 0;
}

.empty-state .hint {
    font-size: 14px;
    color: #cbd5e1;
}

/* 图片卡片 */
.image-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.image-card-header {
    padding: 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-card-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
}

.status-waiting {
    color: #f59e0b;
}

.status-processing {
    color: #3b82f6;
}

.status-success {
    color: #10b981;
}

.status-fail {
    color: #ef4444;
}

.image-card-prompt {
    flex: 1;
    font-size: 12px;
    color: #64748b;
    margin: 0 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.btn-icon {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    color: #64748b;
}

.btn-icon:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

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

.image-card-body {
    position: relative;
    aspect-ratio: 1;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-card-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.9);
    z-index: 10;
}

.loader-small {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.image-card-footer {
    padding: 12px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.image-card-prompt-full {
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
    word-break: break-word;
}

.app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    width: 100%;
    position: relative;
}

/* 响应式 */
@media (max-width: 968px) {
    aside {
        width: 100%;
        max-width: 100%;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
}
