@charset "UTF-8";
/*
 * HoloPix AI Image Generator - Dark Theme
 * Extended Styles
 */

:root {
    --bs-body-bg: #121212;
    --bs-body-color: #e0e0e0;
    --bs-primary: #0d6efd;
    --bs-secondary: #6c757d;
    --bs-dark: #212529;
    --bs-card-bg: #1e1e1e;
    --bs-border-color: #333;
}

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden; /* Prevent global scrollbar */
}

body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* --- 1. 卡片与容器 --- */
.card {
    background-color: var(--bs-card-bg);
    border-color: var(--bs-border-color);
}

.card-header {
    border-bottom-color: var(--bs-border-color);
    background-color: rgba(255, 255, 255, 0.02);
}

/* --- 2. 表单元素 --- */
.form-control, .form-select {
    background-color: #2b2b2b;
    border-color: #444;
    color: #fff;
}

.form-control:focus, .form-select:focus {
    background-color: #2b2b2b;
    border-color: var(--bs-primary);
    color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-range::-webkit-slider-runnable-track {
    background-color: #444;
}

/* --- 3. 按钮样式 --- */
.btn-primary {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    border: none;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.4);
}

/* --- 4. 侧边栏 (移动端) --- */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        width: 85%;
        max-width: 320px;
        z-index: 1050;
        transition: left 0.3s ease-in-out;
        background-color: #1e1e1e;
        overflow-y: auto;
    }

    .sidebar.show {
        left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* --- 5. 结果区域 --- */
#resultArea {
    background-color: #0b0b0b;
    background-image:
        linear-gradient(30deg, #151515 12%, transparent 12.5%, transparent 87%, #151515 87.5%, #151515),
        linear-gradient(150deg, #151515 12%, transparent 12.5%, transparent 87%, #151515 87.5%, #151515),
        linear-gradient(30deg, #151515 12%, transparent 12.5%, transparent 87%, #151515 87.5%, #151515),
        linear-gradient(150deg, #151515 12%, transparent 12.5%, transparent 87%, #151515 87.5%, #151515),
        linear-gradient(60deg, #1a1a1a 25%, transparent 25.5%, transparent 75%, #1a1a1a 75%, #1a1a1a),
        linear-gradient(60deg, #1a1a1a 25%, transparent 25.5%, transparent 75%, #1a1a1a 75%, #1a1a1a);
    background-size: 40px 70px;
    background-position: 0 0, 0 0, 20px 35px, 20px 35px, 0 0, 20px 35px;

    /* 另一种更加科技感的背景 */
    background-color: #111;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* 结果区域增强 - 玻璃拟态卡片容器 */
.result-container {
    padding: 1rem;
}

/* 自定义卡片样式 */
.custom-card {
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s;
}

.custom-card:hover {
    transform: translateY(-2px);
}

/* 选中状态边框 */
input[type="radio"]:checked + label img {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.5);
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* 状态徽章 */
.status-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.status-generating {
    background: rgba(13, 110, 253, 0.2);
    color: #6ea8fe;
}

.status-success {
    background: rgba(25, 135, 84, 0.2);
    color: #75b798;
}

.status-failed {
    background: rgba(220, 53, 69, 0.2);
    color: #ea868f;
}

.loading-placeholder {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
}

/* --- 6. 自定义滚动条 --- */
/* Webkit 浏览器 (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* --- 7. 通用工具类 --- */
.cursor-pointer {
    cursor: pointer;
}

.hover-bg:hover {
    background-color: var(--bs-tertiary-bg);
}

/* --- 8. 结果流样式 (Result Feed) --- */
#resultArea {
    background-color: #0b0b0b !important;
    background-image: radial-gradient(circle at 50% 50%, #1a1a1a 1px, transparent 1px);
    background-size: 24px 24px;
}

.result-card {
    background: #181818;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    transition: all 0.2s ease;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.result-card:hover {
    border-color: #3a3a3a;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    transform: translateY(-1px);
}

.result-card-header {
    padding: 12px 16px;
    background: rgba(255,255,255,0.015);
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.result-prompt-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #e0e0e0;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-prompt-text:hover {
    -webkit-line-clamp: unset;
    cursor: help;
}

.result-meta-badges {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.badge-soft {
    background: rgba(255,255,255,0.1);
    color: #aaa;
    font-weight: 500;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
}

.result-image-grid {
    display: grid;
    gap: 1px;
    background: #2a2a2a; /* Grid gap color */
}

.result-image-grid.cols-1 { grid-template-columns: 1fr; }
.result-image-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.result-image-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }

.result-image-wrapper {
    position: relative;
    overflow: hidden;
    background: #000;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-image-wrapper img {
    width: 100%;
    height: auto;
    max-height: 80vh; /* Prevent it from being too tall on large screens */
    object-fit: contain;
    display: block;
}

/* --- 10. 图生图参考图样式 --- */
.result-source-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #444;
    transition: transform 0.2s;
    background-color: #222;
}

.result-source-image:hover {
    transform: scale(1.05);
    border-color: var(--bs-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.result-source-link {
    display: block;
    text-decoration: none;
}

/* For 1:1 or specific ratios, we might want cover if it matches the container */
.result-image-wrapper.fit-cover img {
    object-fit: cover;
}

.result-image-wrapper:hover img {
    transform: scale(1.02);
}

.result-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 12px;
    gap: 8px;
}

.result-image-wrapper:hover .result-image-overlay {
    opacity: 1;
}

.btn-icon-glass {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-icon-glass:hover {
    background: rgba(255,255,255,0.3);
    color: white;
    transform: translateY(-2px);
}

/* --- 9. 布局优化 (Layout Optimization) --- */
@media (min-width: 768px) {
    /* 桌面端布局：左右独立滚动 */
    .workspace {
        overflow: hidden !important; /* 防止主容器滚动 */
        height: 100%; /* 确保填满父容器 */
    }

    .config-panel {
        width: 380px; /* 左侧面板固定宽度 */
        min-width: 320px;
        flex-shrink: 0; /* 防止被压缩 */
        height: 100%; /* 填满高度 */
        overflow-y: auto; /* 独立滚动 */
        padding-right: 4px; /* 避免滚动条贴边 */
    }

    #resultArea {
        height: 100%; /* 填满高度 */
        overflow-y: auto; /* 独立滚动 */
    }
}

@media (max-width: 767.98px) {
    /* 移动端布局 */
    .workspace {
        overflow-y: auto !important; /* 移动端允许整体滚动 */
        height: auto !important; /* 解除高度限制 */
    }

    .config-panel {
        max-height: none; /* 让其自然撑开 */
        overflow: visible;
        width: 100%;
        margin-bottom: 20px;
        flex-shrink: 0;
    }

    #resultArea {
        height: auto;
        min-height: 300px;
        overflow: visible;
    }
}
