/* Tabs */
.bg-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--sr-color-border);
}
.sr-style-section
{
    max-width:680px !important;
    overflow:hidden;
}
.inspiration-hero{
    width:680px;
}
.bg-tab {
    padding: 8px 20px;
    cursor: pointer;
    font-size: 14px;
    color: var(--sr-color-text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    user-select: none;
}
.bg-tab:hover {
    color: var(--sr-color-primary);
}
.bg-tab.active {
    color: var(--sr-color-primary);
    border-bottom-color: var(--sr-color-primary);
    font-weight: 600;
}
/* 类别列表 */
.category-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.cat-item {
    padding: 4px 14px;
    border: 1.5px solid var(--sr-color-border);
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    color: var(--sr-color-text);
    background: #fff;
    transition: all 0.2s;
    user-select: none;
}
.cat-item:hover {
    border-color: var(--sr-color-primary);
}
.cat-item.active {
    border-color: var(--sr-color-primary);
    background: var(--sr-color-primary);
    color: #fff;
}
/* 分类芯片 */
.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chip-item {
    padding: 5px 14px;
    border: 1.5px solid var(--sr-color-border);
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    color: var(--sr-color-text);
    background: #fff;
    transition: all 0.2s;
    user-select: none;
    white-space: nowrap;
}
.chip-item:hover {
    border-color: var(--sr-color-primary);
}
.chip-item.active {
    border-color: var(--sr-color-primary);
    background: var(--sr-color-primary);
    color: #fff;
}
/* 背景网格 */
.bg-list-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    max-height: calc(50vh);
    overflow-y: auto;
}
.bg-list-grid::-webkit-scrollbar {
    width: 4px;
}
.bg-list-grid::-webkit-scrollbar-track {
    background: transparent;
}
.bg-list-grid::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}
.bg-list-grid::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
.bg-list-item {
    border-radius: 8px;
    height:123px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
}
.bg-list-item:hover {
    border-color: var(--sr-color-primary);
}
.bg-list-item.active {
    border-color: var(--sr-color-primary);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
}
.bg-list-item img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}
.bg-list-item .bg-name {
    font-size: 12px;
    text-align: center;
    padding: 5px 4px;
    color: var(--sr-color-text);
    background: #f9fafb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bg-loading-tip {
    font-size: 12px;
    color: var(--sr-color-text-muted);
    text-align: center;
    padding: 20px 0;
    grid-column: 1 / -1;
}
/* 自定义选项卡 */
.custom-section {
    margin-bottom: 12px;
    max-height: calc(50vh - 80px);
}
.custom-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--sr-color-text);
    margin: 0 0 6px;
}
.custom-input {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--sr-color-border);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: var(--sr-color-text);
    box-sizing: border-box;
    outline: none;
    background: #fafbfc;
    transition: border-color 0.2s;
}
.custom-input:focus {
    border-color: var(--sr-color-primary);
    background: #fff;
}
.custom-input::placeholder {
    color: var(--sr-color-text-muted);
}
.custom-textarea {
    min-height: 80px;
    resize: vertical;
}
.bg-ref-upload-box {
    width: 100%;
    max-height: 130px;
    aspect-ratio: 1 / 1;
    border: 2px dashed var(--sr-color-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s;
    background: #fafbfc;
    position: relative;
    box-sizing: border-box;
}
.bg-ref-upload-box:hover {
    border-color: var(--sr-color-primary);
    background: #f5f3ff;
}
.bg-ref-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--sr-color-text-muted);
    font-size: 12px;
    user-select: none;
}
.bg-ref-upload-placeholder svg {
    width: 28px;
    height: 28px;
}
.bg-ref-upload-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}
/* 选项卡内容容器 */
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}
/* 加载扫光动画 */
.shimmer-container {
    position: relative;
    display: block;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    line-height: 0;
}
.shimmer-container img {
    display: block;
    width: 100%;
    border-radius: 12px;
}
.shimmer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(99, 102, 241, 0.12);
    border-radius: 12px;
    overflow: hidden;
    z-index: 2;
    pointer-events: none;
}
.shimmer-overlay::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(99, 102, 241, 0.22) 45%,
        rgba(99, 102, 241, 0.30) 50%,
        rgba(99, 102, 241, 0.22) 55%,
        transparent 100%);
    animation: shimmer-sweep 1.8s ease-in-out infinite;
}
@keyframes shimmer-sweep {
    0% { top: -100%; }
    100% { top: 160%; }
}
.ai-loading-text {
    text-align: center;
    font-size: 14px;
    color: var(--sr-color-text-secondary);
    margin-top: 14px;
}
/* 加载进度条 */
.loading-progress-wrapper {
    padding: 0 20px;
    margin-top: 20px;
    text-align: center;
}
.loading-progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}
.loading-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #818cf8);
    border-radius: 10px;
    transition: width 0.3s ease;
}
.loading-progress-text {
    font-size: 13px;
    color: var(--sr-color-text-secondary);
    margin-top: 8px;
}
/* 加载遮罩 */
.hero-img-wrapper { position: relative; border-radius: 12px; overflow: hidden; line-height: 0; }
.hero-img-wrapper > img { display: block; width: 100%; border-radius: 12px; }
.hero-loading-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: none; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; z-index: 10; }
.hero-loading-overlay .loading-text { color: #fff; font-size: 15px; margin-bottom: 18px; text-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.hero-loading-overlay .loading-bar { width: 65%; max-width: 320px; height: 8px; background: rgba(255,255,255,0.3); border-radius: 4px; overflow: hidden; }
.hero-loading-overlay .loading-bar-fill { height: 100%; background: #fff; border-radius: 4px; transition: width 0.3s ease; width: 0%; }
/* 当前页面设计面板宽度 */
#designPanel {
    width: 720px !important;
}
/* 右侧预览区域宽度 */
.inspiration-hero-placeholder,
.compare-container {
    max-width: 660px !important;
}

/* ========== 移动端响应式（宽度 ≤ 639px） ========== */
@media (max-width: 639px) {
    /* design-panel 宽度强制覆盖为 100%（使用 ID 选择器匹配优先级） */
    #designPanel {
        width: 100% !important;
        padding: 28px 4px;
    }

    /* design-panel-body 高度由内容自然撑开 */
    .design-panel-body {
        overflow-y: visible;
        flex: none;
    }

    /* inspiration-area 默认隐藏 */
    .inspiration-area {
        display: none;
    }

    /* 滑块对比图：顶部对齐，避免图片显示不全 */
    .compare-container img {
        object-position: 0 0 !important;
    }

    /* 背景/场景列表项高度 */
    .bg-list-item {
        height: 83px;
    }

    /* 背景/场景列表网格最大高度 */
    .bg-list-grid {
        max-height: calc(35vh);
    }

    /* 灵感展示区：全宽且缩小内边距 */
    .inspiration-hero {
        width: 100%;
        padding: 2px;
    }
}
