/* Tabs */
.bg-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--sr-color-border);
}
.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;
}
/* 背景网格 */
.bg-list-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.bg-list-item {
    border-radius: 8px;
    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: 11px;
    text-align: center;
    padding: 4px 2px;
    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;
}
.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%; }

@media (max-width: 639px) {
  .inspiration-area {
    display: none;
  }
  .inspiration-header {
    display: none;
  }
  .inspiration-hero {
    max-height: none;
  }
}
