/**
 * AI设计 - 场景设计子页样式（仅本子页使用，命名空间 ai-design-*）
 * 布局：左 4 卡片 + 中间视图与操作栏 + 右 3 卡片；字体 Microsoft YaHei
 */

/* ========== 场景设计页根：占满内容区、无滚动条、一屏适配 ========== */
#ai-design-content-scene.ai-design-content-page.active {
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 16px;
    box-sizing: border-box;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.ai-design-scene-layout {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    gap: 16px;
    flex: 1;
}

/* ========== 左侧 / 右侧卡片列（可收缩以适配一屏） ========== */
.ai-design-scene-left,
.ai-design-scene-right {
    flex-shrink: 0;
    width: 200px;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.ai-design-scene-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* 左侧底部占位（保持与右侧操作区视觉平衡） */
.ai-design-scene-left-placeholder {
    width: 100%;
    max-width: 200px;
    min-height: 40px;
    flex-shrink: 0;
}

/* 右侧：3 卡片下方为提示词、保存、模型、生成场景 */
.ai-design-scene-right-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 200px;
    margin-top: auto;
}

.ai-design-scene-right-actions .ai-design-scene-prompt-btn,
.ai-design-scene-right-actions .ai-design-scene-save-btn {
    width: 100%;
}

.ai-design-scene-right-actions .ai-design-scene-model-wrap {
    flex: none;
    width: 100%;
}

.ai-design-scene-right-actions .ai-design-scene-model-select {
    width: 100%;
}

.ai-design-scene-right-actions .ai-design-scene-generate-btn {
    width: 100%;
}

/* 卡片通用（等高分配空间，适配一屏无滚动） */
.ai-design-scene-card {
    width: 100%;
    max-width: 200px;
    flex: 1 1 0;
    min-height: 48px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-primary, #333333);
    background-color: var(--bg-tertiary, #1a1a1a);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.ai-design-scene-card:hover {
    border-color: var(--border-secondary, #404040);
    background-color: var(--bg-hover, #333333);
}

.ai-design-scene-card-img {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary, #242424);
    position: relative;
}

.ai-design-scene-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ai-design-scene-card-img.ai-design-scene-card-img-placeholder {
    background-color: var(--bg-tertiary, #2a2a2a);
}

.ai-design-scene-card-img.ai-design-scene-card-img-placeholder img {
    opacity: 0;
}

.ai-design-scene-card-img.ai-design-scene-card-img-placeholder::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='1.5'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Cpath d='M3 9h18M9 21V9'/%3E%3C/svg%3E") center no-repeat;
    opacity: 0.5;
}

.ai-design-scene-card-title {
    padding: 10px 8px;
    font-size: 12px;
    font-weight: normal;
    color: var(--text-primary, #e0e0e0);
    text-align: center;
    border-top: 1px solid var(--border-primary, #333333);
    flex-shrink: 0;
}

/* 右侧按钮：提示词、保存到项目面板 */
.ai-design-scene-prompt-btn,
.ai-design-scene-save-btn {
    padding: 8px 16px;
    font-size: 12px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    color: var(--text-primary, #e0e0e0);
    background-color: var(--bg-tertiary, #1a1a1a);
    border: 1px solid var(--border-primary, #333333);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.ai-design-scene-prompt-btn:hover,
.ai-design-scene-save-btn:hover {
    border-color: var(--border-secondary, #404040);
    background-color: var(--bg-hover, #333333);
}

/* ========== 中间列：视图 + 操作栏（收缩适配一屏） ========== */
.ai-design-scene-center {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

.ai-design-scene-view-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-primary, #333333);
    background-color: var(--bg-secondary, #242424);
}

.ai-design-scene-view {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    position: relative;
    aspect-ratio: 16 / 9;
}

.ai-design-scene-view-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.ai-design-scene-view-img-placeholder {
    object-fit: cover;
    background-color: var(--bg-tertiary, #2a2a2a);
    opacity: 0.8;
}

/* 视图下方一行：底框包围，与主视图宽度对齐 */
.ai-design-scene-attr-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
    padding: 4px 6px;
    border: 1px solid var(--border-primary, #333333);
    border-radius: 8px;
    background-color: var(--bg-secondary, #242424);
}

.ai-design-scene-name-wrap {
    flex: 1;
    min-width: 120px;
    max-width: 200px;
}

.ai-design-scene-name-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    color: var(--text-primary, #e0e0e0);
    background-color: var(--bg-tertiary, #1a1a1a);
    border: 1px solid var(--border-primary, #333333);
    border-radius: 6px;
    box-sizing: border-box;
}

.ai-design-scene-name-input::placeholder {
    color: var(--text-muted, #666666);
}

.ai-design-scene-name-input:focus {
    outline: none;
    border-color: var(--text-accent, #4a9eff);
}

.ai-design-scene-attr-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
    justify-content: flex-start;
}

/* 光源/光影强度/色调/镜头类型/构图/景深/细节密度/氛围情绪/渲染风格：深色主题，与右侧提示词/保存按钮一致 */
.ai-design-scene-attr-btn {
    padding: 8px 14px;
    font-size: 12px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    color: var(--text-primary, #e0e0e0);
    background-color: var(--bg-tertiary, #1a1a1a);
    border: 1px solid var(--border-primary, #333333);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.ai-design-scene-attr-btn:hover {
    border-color: var(--border-secondary, #404040);
    background-color: var(--bg-hover, #333333);
}

/* 模型下拉 */
.ai-design-scene-model-wrap {
    min-width: 0;
}

.ai-design-scene-model-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    color: var(--text-primary, #e0e0e0);
    background-color: var(--bg-tertiary, #1a1a1a);
    border: 1px solid var(--border-primary, #333333);
    border-radius: 6px;
    cursor: pointer;
    box-sizing: border-box;
}

.ai-design-scene-model-select:focus {
    outline: none;
    border-color: var(--text-accent, #4a9eff);
}

.ai-design-scene-generate-btn {
    padding: 14px 24px;
    font-size: 15px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.ai-design-scene-generate-btn:hover {
    opacity: 0.9;
}
