/* =============================================
   头脑风暴工具 - brainstorming.css
   三栏布局：历史 | 配置 | 创意结果
   主题色：创意紫 #7b1fa2 / #6a1b9a
   ============================================= */

/* ========== 主容器 ========== */
.bs-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f8f0ff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(123, 31, 162, 0.12);
    transition: all 0.3s ease;
}

.bs-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    min-height: unset;
}

/* ========== 顶部工具栏 ========== */
.bs-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 12px;
    min-height: 36px;
    background: linear-gradient(135deg, #7b1fa2 0%, #4a148c 100%);
    color: #fff;
    flex-wrap: wrap;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(74, 20, 140, 0.4);
    flex-shrink: 0;
}

.bs-toolbar .toolbar-group {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.bs-toolbar .toolbar-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.90);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #7b1fa2;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.4;
}

.bs-toolbar .toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.bs-toolbar .toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.bs-toolbar .toolbar-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

/* 主操作按钮 */
.bs-toolbar .toolbar-btn-primary {
    background: linear-gradient(135deg, #ff6d00 0%, #e65100 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(230, 81, 0, 0.45);
}

.bs-toolbar .toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #ff9100 0%, #ff6d00 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 109, 0, 0.55);
}

/* 生成中流光动画 */
.bs-toolbar .toolbar-btn-primary.bs-btn-loading {
    background: linear-gradient(90deg, #ff6d00 0%, #ffab40 35%, #ff6d00 65%, #e65100 100%);
    background-size: 200% 100%;
    animation: bsBtnShimmer 1.4s ease-in-out infinite;
    cursor: not-allowed;
    box-shadow: 0 2px 10px rgba(255, 109, 0, 0.5);
}

@keyframes bsBtnShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 取消按钮 */
.bs-toolbar .toolbar-btn-cancel {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

.bs-toolbar .toolbar-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.28) !important;
    color: #fff !important;
}

/* 标题文字 */
.bs-toolbar .toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.5px;
}

/* ========== 主内容三栏 ========== */
.bs-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f8f0ff;
}

/* ========== 左栏：历史记录 ========== */
.bs-history-panel {
    width: 190px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e8d5f5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bs-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(to bottom, #fdf8ff 0%, #f8f0ff 100%);
    border-bottom: 1px solid #e8d5f5;
    flex-shrink: 0;
}

.bs-history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #7b1fa2;
}

.bs-history-count {
    font-size: 11px;
    color: #ce93d8;
    font-weight: 400;
}

.bs-clear-btn {
    background: #fff0f0;
    border: none;
    color: #e53935;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.bs-clear-btn:hover { background: #fde8e8; }

.bs-history-search {
    padding: 7px;
    border-bottom: 1px solid #e8d5f5;
    flex-shrink: 0;
}

.bs-history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #ce93d8;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #3e1a5a;
    background: #fdf8ff;
}

.bs-history-search input:focus {
    border-color: #7b1fa2;
    box-shadow: 0 0 0 2px rgba(123, 31, 162, 0.1);
}

.bs-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
}

.bs-history-list::-webkit-scrollbar { width: 4px; }
.bs-history-list::-webkit-scrollbar-track { background: transparent; }
.bs-history-list::-webkit-scrollbar-thumb { background: #ce93d8; border-radius: 2px; }
.bs-history-list::-webkit-scrollbar-thumb:hover { background: #9c27b0; }

.bs-history-item {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.18s;
    margin-bottom: 3px;
    border: 1px solid transparent;
}

.bs-history-item-main { flex: 1; min-width: 0; }

.bs-history-item:hover {
    background: #f3e5f5;
    border-color: #e1bee7;
}

.bs-history-item.active {
    background: #ede0f5;
    border-color: #ce93d8;
}

.bs-history-item-topic {
    font-size: 12px;
    font-weight: 600;
    color: #6a1b9a;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bs-history-item-meta {
    font-size: 10px;
    color: #ba68c8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 3px;
}

.bs-history-item-badge {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

.bs-history-item-del {
    background: none;
    border: none;
    color: #ce93d8;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.15s;
    flex-shrink: 0;
    opacity: 0;
    margin-top: 1px;
    line-height: 1;
}

.bs-history-item:hover .bs-history-item-del { opacity: 1; }
.bs-history-item:hover .bs-history-item-del:hover { color: #e53935; background: #fce4e1; }

.bs-history-empty {
    text-align: center;
    color: #ce93d8;
    font-size: 12px;
    padding: 24px 8px;
    line-height: 1.7;
}

/* ========== 中栏：参数配置 ========== */
.bs-input-panel {
    width: 270px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e8d5f5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bs-panel-header {
    padding: 12px 14px 10px;
    border-bottom: 1px solid #e8d5f5;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #fdf8ff 0%, #f8f0ff 100%);
}

.bs-panel-header h3 {
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 600;
    color: #7b1fa2;
}

.bs-panel-tip {
    font-size: 11px;
    color: #ba68c8;
    display: block;
}

.bs-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}

.bs-input-body::-webkit-scrollbar { width: 4px; }
.bs-input-body::-webkit-scrollbar-track { background: transparent; }
.bs-input-body::-webkit-scrollbar-thumb { background: #ce93d8; border-radius: 2px; }
.bs-input-body::-webkit-scrollbar-thumb:hover { background: #9c27b0; }

/* 字段组 */
.bs-field-group {
    margin-bottom: 16px;
}

.bs-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #3e1a5a;
    margin-bottom: 7px;
}

/* 主题文本域 */
.bs-input-wrap {
    position: relative;
}

.bs-textarea {
    width: 100%;
    padding: 9px 30px 22px 12px;
    border: 1.5px solid #ce93d8;
    border-radius: 6px;
    font-size: 13px;
    color: #3e1a5a;
    background: #fdf8ff;
    outline: none;
    resize: vertical;
    min-height: 80px;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    word-break: break-word;
    line-height: 1.6;
}

.bs-textarea:focus {
    border-color: #7b1fa2;
    box-shadow: 0 0 0 3px rgba(123, 31, 162, 0.1);
    background: #fff;
}

.bs-textarea::placeholder {
    color: #ce93d8;
    font-size: 12px;
}

@keyframes bsShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.bs-textarea.shake {
    animation: bsShake 0.4s ease;
    border-color: #e53935 !important;
}

.bs-char-counter {
    position: absolute;
    bottom: 5px;
    right: 8px;
    font-size: 10px;
    color: #ce93d8;
    pointer-events: none;
    user-select: none;
}

.bs-char-counter.warning { color: #ff9800; }
.bs-char-counter.limit   { color: #e53935; }

.bs-clear-input-btn {
    position: absolute;
    top: 7px;
    right: 7px;
    background: none;
    border: none;
    color: #ce93d8;
    font-size: 15px;
    line-height: 20px;
    width: 20px;
    height: 20px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
}

.bs-clear-input-btn:hover {
    color: #e53935;
    background: rgba(229, 57, 53, 0.1);
}

/* 思维方法：单列列表（带描述） */
.bs-method-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bs-method-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1.5px solid #e1bee7;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #3e1a5a;
    transition: all 0.18s;
    user-select: none;
    background: #fdf8ff;
}

.bs-method-item:hover {
    border-color: #7b1fa2;
    background: #f3e5f5;
}

.bs-method-item.selected {
    border-color: #7b1fa2;
    background: linear-gradient(135deg, #7b1fa2 0%, #4a148c 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(74, 20, 140, 0.3);
}

.bs-method-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.bs-method-label-wrap {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.bs-method-name {
    font-weight: 600;
    font-size: 12px;
    line-height: 1.3;
}

.bs-method-desc {
    font-size: 10px;
    opacity: 0.72;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bs-method-item.selected .bs-method-desc { opacity: 0.82; }

/* 创意数量：横排胶囊 */
.bs-count-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.bs-count-item {
    padding: 5px 14px;
    border: 1.5px solid #ce93d8;
    border-radius: 16px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #7b1fa2;
    transition: all 0.18s;
    user-select: none;
    background: #fdf8ff;
}

.bs-count-item:hover {
    border-color: #7b1fa2;
    background: #f3e5f5;
}

.bs-count-item.selected {
    background: linear-gradient(135deg, #7b1fa2 0%, #4a148c 100%);
    border-color: #7b1fa2;
    color: #fff;
    box-shadow: 0 2px 6px rgba(74, 20, 140, 0.3);
}

/* 详细程度：三等分 */
.bs-depth-group {
    display: flex;
    gap: 6px;
}

.bs-depth-item {
    flex: 1;
    padding: 8px 6px;
    text-align: center;
    border: 1.5px solid #ce93d8;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    color: #3e1a5a;
    transition: all 0.18s;
    user-select: none;
    background: #fdf8ff;
}

.bs-depth-item:hover {
    border-color: #7b1fa2;
    color: #7b1fa2;
    background: #f3e5f5;
}

.bs-depth-item.selected {
    border-color: #7b1fa2;
    background: linear-gradient(135deg, #7b1fa2 0%, #4a148c 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(74, 20, 140, 0.3);
}

.bs-depth-icon {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

/* 中栏内嵌生成按钮 */
.bs-generate-btn {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, #7b1fa2 0%, #4a148c 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(74, 20, 140, 0.4);
    margin-bottom: 14px;
    letter-spacing: 0.5px;
}

.bs-generate-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #9c27b0 0%, #6a1b9a 100%);
    box-shadow: 0 4px 14px rgba(74, 20, 140, 0.5);
    transform: translateY(-1px);
}

.bs-generate-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.bs-generate-btn.bs-inline-loading {
    background: linear-gradient(90deg, #7b1fa2 0%, #ce93d8 35%, #7b1fa2 65%, #4a148c 100%);
    background-size: 200% 100%;
    animation: bsBtnShimmer 1.4s ease-in-out infinite;
    opacity: 1;
    cursor: not-allowed;
    transform: none;
}

/* 使用提示 */
.bs-tips-box {
    background: linear-gradient(135deg, #fdf4ff 0%, #f8eaff 100%);
    border: 1px solid #e1bee7;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    color: #7b1fa2;
    line-height: 1.7;
}

.bs-tips-box p  { margin: 0 0 4px; font-weight: 600; }
.bs-tips-box ul { margin: 0; padding-left: 16px; }
.bs-tips-box li { margin-bottom: 2px; }
.bs-tips-box ul li::marker { color: #9c27b0; font-weight: 600; }

/* ========== 右栏：创意结果 ========== */
.bs-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fdf8ff;
    min-width: 0;
}

.bs-result-header {
    padding: 10px 16px;
    border-bottom: 1px solid #e8d5f5;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #fdf8ff 0%, #f8f0ff 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bs-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #7b1fa2;
}

.bs-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    flex-wrap: wrap;
}

.bs-result-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.bs-regen-btn {
    padding: 3px 10px;
    background: linear-gradient(135deg, #f3e5f5 0%, #ede0f5 100%);
    border: 1px solid #ce93d8;
    border-radius: 12px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: #7b1fa2;
    transition: all 0.2s;
    white-space: nowrap;
}

.bs-regen-btn:hover {
    background: linear-gradient(135deg, #7b1fa2 0%, #4a148c 100%);
    color: #fff;
    border-color: #7b1fa2;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(123, 31, 162, 0.28);
}

.bs-regen-btn:active { transform: translateY(0); }

.bs-result-topic {
    font-size: 12px;
    font-weight: 700;
    color: #6a1b9a;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bs-result-method-badge {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.bs-result-count-badge {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.bs-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
}

.bs-result-body::-webkit-scrollbar { width: 4px; }
.bs-result-body::-webkit-scrollbar-track { background: transparent; }
.bs-result-body::-webkit-scrollbar-thumb { background: #ce93d8; border-radius: 3px; }
.bs-result-body::-webkit-scrollbar-thumb:hover { background: #9c27b0; }

/* 占位符 */
.bs-result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ce93d8;
    text-align: center;
    padding: 40px;
    min-height: 200px;
}

.bs-placeholder-icon {
    font-size: 58px;
    margin-bottom: 16px;
    opacity: 0.7;
    animation: bsIconPulse 3s ease-in-out infinite;
}

@keyframes bsIconPulse {
    0%, 100% { transform: scale(1) rotate(-3deg); }
    50%       { transform: scale(1.08) rotate(3deg); }
}

.bs-placeholder-title {
    font-size: 17px;
    font-weight: 700;
    color: #ab47bc;
    margin: 0 0 8px;
}

.bs-placeholder-desc {
    font-size: 13px;
    color: #ce93d8;
    margin: 3px 0;
    line-height: 1.6;
}

.bs-placeholder-shortcut {
    font-size: 12px;
    color: #e1bee7;
    margin: 10px 0 0;
}

.bs-placeholder-shortcut kbd {
    display: inline-block;
    padding: 1px 5px;
    background: #f3e5f5;
    border: 1px solid #ce93d8;
    border-radius: 3px;
    font-size: 11px;
    color: #7b1fa2;
    font-family: inherit;
    line-height: 1.5;
}

/* 加载中 */
.bs-result-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 200px;
}

.bs-loading-brain {
    font-size: 48px;
    animation: bsBrainSpin 2s ease-in-out infinite;
}

@keyframes bsBrainSpin {
    0%   { transform: rotate(-8deg) scale(1); }
    25%  { transform: rotate(8deg)  scale(1.05); }
    50%  { transform: rotate(-5deg) scale(1); }
    75%  { transform: rotate(5deg)  scale(1.05); }
    100% { transform: rotate(-8deg) scale(1); }
}

.bs-loading-dots { display: flex; gap: 8px; }

.bs-loading-dots span {
    width: 9px;
    height: 9px;
    background: #7b1fa2;
    border-radius: 50%;
    animation: bsDotBounce 1.2s ease-in-out infinite;
}

.bs-loading-dots span:nth-child(2) { animation-delay: 0.2s; background: #9c27b0; }
.bs-loading-dots span:nth-child(3) { animation-delay: 0.4s; background: #ba68c8; }

@keyframes bsDotBounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40%            { transform: scale(1.15); opacity: 1; }
}

.bs-loading-text {
    font-size: 13px;
    color: #ab47bc;
    margin: 0;
    transition: opacity 0.4s;
}

/* ========== 创意卡片结果区 ========== */
.bs-result-content {
    min-height: 0;
    word-break: break-word;
}

@keyframes bsCardIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 创意列表容器 */
.bs-result-content .bs-result-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

/* 创意卡片 */
.bs-result-content .bs-idea-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(123, 31, 162, 0.08);
    overflow: hidden;
    border-top: 4px solid #7b1fa2;
    transition: box-shadow 0.22s, transform 0.22s;
    position: relative;
    animation: bsCardIn 0.32s ease both;
}

/* 创意卡片交错入场延迟 */
.bs-result-content .bs-idea-card:nth-child(1)  { animation-delay: 0.02s; }
.bs-result-content .bs-idea-card:nth-child(2)  { animation-delay: 0.07s; }
.bs-result-content .bs-idea-card:nth-child(3)  { animation-delay: 0.12s; }
.bs-result-content .bs-idea-card:nth-child(4)  { animation-delay: 0.17s; }
.bs-result-content .bs-idea-card:nth-child(5)  { animation-delay: 0.22s; }
.bs-result-content .bs-idea-card:nth-child(6)  { animation-delay: 0.27s; }
.bs-result-content .bs-idea-card:nth-child(7)  { animation-delay: 0.32s; }
.bs-result-content .bs-idea-card:nth-child(8)  { animation-delay: 0.36s; }
.bs-result-content .bs-idea-card:nth-child(9)  { animation-delay: 0.40s; }
.bs-result-content .bs-idea-card:nth-child(10) { animation-delay: 0.44s; }
.bs-result-content .bs-idea-card:nth-child(11) { animation-delay: 0.47s; }
.bs-result-content .bs-idea-card:nth-child(12) { animation-delay: 0.50s; }
.bs-result-content .bs-idea-card:nth-child(n+13) { animation-delay: 0.52s; }

.bs-result-content .bs-idea-card:hover {
    box-shadow: 0 6px 20px rgba(123, 31, 162, 0.18);
    transform: translateY(-2px);
}

/* 单条创意复制按钮（卡片悬浮时显示） */
.bs-idea-copy-btn {
    margin-left: auto;
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #ce93d8;
    padding: 2px 6px;
    line-height: 1.5;
    transition: all 0.15s;
    opacity: 0;
    flex-shrink: 0;
}
.bs-result-content .bs-idea-card:hover .bs-idea-copy-btn { opacity: 1; }
.bs-idea-copy-btn:hover {
    background: #f3e5f5;
    border-color: #ce93d8;
    color: #7b1fa2;
    transform: scale(1.08);
}

/* 彩虹卡片色序 */
.bs-result-content .bs-idea-card:nth-child(7n+1) { border-top-color: #7b1fa2; }
.bs-result-content .bs-idea-card:nth-child(7n+2) { border-top-color: #1565c0; }
.bs-result-content .bs-idea-card:nth-child(7n+3) { border-top-color: #00695c; }
.bs-result-content .bs-idea-card:nth-child(7n+4) { border-top-color: #e65100; }
.bs-result-content .bs-idea-card:nth-child(7n+5) { border-top-color: #c62828; }
.bs-result-content .bs-idea-card:nth-child(7n+6) { border-top-color: #0277bd; }
.bs-result-content .bs-idea-card:nth-child(7n+0) { border-top-color: #4e342e; }

/* 卡片头部 */
.bs-result-content .bs-idea-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px 9px;
    background: linear-gradient(135deg, #f8f0ff 0%, #ede0f5 100%);
    border-bottom: 1px solid #e8d5f5;
}

/* 序号徽章 */
.bs-result-content .bs-idea-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #7b1fa2 0%, #4a148c 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
    padding: 0 4px;
}

.bs-result-content .bs-idea-card:nth-child(7n+2) .bs-idea-num { background: linear-gradient(135deg, #1565c0, #0d47a1); }
.bs-result-content .bs-idea-card:nth-child(7n+3) .bs-idea-num { background: linear-gradient(135deg, #00695c, #004d40); }
.bs-result-content .bs-idea-card:nth-child(7n+4) .bs-idea-num { background: linear-gradient(135deg, #e65100, #bf360c); }
.bs-result-content .bs-idea-card:nth-child(7n+5) .bs-idea-num { background: linear-gradient(135deg, #c62828, #b71c1c); }
.bs-result-content .bs-idea-card:nth-child(7n+6) .bs-idea-num { background: linear-gradient(135deg, #0277bd, #01579b); }
.bs-result-content .bs-idea-card:nth-child(7n+0) .bs-idea-num { background: linear-gradient(135deg, #4e342e, #3e2723); }

/* 创意标题 */
.bs-result-content .bs-idea-title {
    font-size: 13px;
    font-weight: 700;
    color: #3e1a5a;
    line-height: 1.4;
    word-break: break-word;
}

/* 创意内容 */
.bs-result-content .bs-idea-body {
    padding: 11px 14px;
    font-size: 13px;
    color: #3d2a4a;
    line-height: 1.85;
    word-break: break-word;
}

.bs-result-content .bs-idea-body p { margin: 0 0 7px; }
.bs-result-content .bs-idea-body p:last-child { margin-bottom: 0; }

.bs-result-content .bs-idea-body ul,
.bs-result-content .bs-idea-body ol {
    margin: 5px 0;
    padding-left: 18px;
    line-height: 1.85;
}

.bs-result-content .bs-idea-body li { margin-bottom: 3px; }

.bs-result-content .bs-idea-body ul li::marker,
.bs-result-content .bs-idea-body ol li::marker {
    color: #c0392b;
    font-weight: 600;
}

.bs-result-content .bs-idea-body strong {
    color: #8b1a1a;
    font-weight: 700;
}

.bs-result-content .bs-idea-body em {
    color: #8e24aa;
    font-style: italic;
}

.bs-result-content .bs-idea-body a {
    color: #c0392b;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.bs-result-content .bs-idea-body a:hover {
    color: #922b21;
    text-decoration-color: #922b21;
}

.bs-result-content .bs-idea-body code {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-family: "Consolas", "Courier New", monospace;
}

/* 错误提示 */
.bs-result-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    min-height: 200px;
}

.bs-result-error .error-icon { font-size: 36px; margin-bottom: 10px; }
.bs-result-error .error-msg  { font-size: 14px; color: #e53935; margin: 0 0 6px; font-weight: 600; }
.bs-result-error .error-tip  { font-size: 12px; color: #ba68c8; margin: 0; }

.error-retry-btn {
    margin-top: 16px;
    padding: 8px 22px;
    background: linear-gradient(135deg, #7b1fa2 0%, #4a148c 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(74, 20, 140, 0.35);
}

.error-retry-btn:hover {
    background: linear-gradient(135deg, #9c27b0 0%, #6a1b9a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 20, 140, 0.45);
}

/* ========== 示例模态框 ========== */
.bs-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    z-index: 10000;
    display: none;
}

.bs-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(74, 20, 140, 0.22);
    width: 640px;
    max-width: 95vw;
    max-height: 90vh;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.bs-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #7b1fa2 0%, #4a148c 100%);
    color: #fff;
    flex-shrink: 0;
}

.bs-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.bs-modal-close {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.bs-modal-close:hover { background: rgba(255, 255, 255, 0.32); }

.bs-modal-body {
    overflow-y: auto;
    padding: 18px;
}

.bs-modal-body::-webkit-scrollbar { width: 4px; }
.bs-modal-body::-webkit-scrollbar-track { background: transparent; }
.bs-modal-body::-webkit-scrollbar-thumb { background: #ce93d8; border-radius: 2px; }

.bs-example-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.bs-example-card {
    padding: 14px;
    border: 1.5px solid #e1bee7;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fdf8ff;
    position: relative;
    overflow: hidden;
}

.bs-example-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #7b1fa2, #e040fb);
    opacity: 0;
    transition: opacity 0.2s;
}

.bs-example-card:hover {
    border-color: #ce93d8;
    background: #f8f0ff;
    box-shadow: 0 4px 14px rgba(123, 31, 162, 0.14);
    transform: translateY(-2px);
}

.bs-example-card:hover::before { opacity: 1; }

.bs-example-icon {
    font-size: 24px;
    margin-bottom: 7px;
}

.bs-example-topic {
    font-size: 13px;
    font-weight: 700;
    color: #3e1a5a;
    margin-bottom: 5px;
    line-height: 1.4;
    word-break: break-word;
}

.bs-example-badge {
    display: inline-block;
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    margin-bottom: 5px;
}

.bs-example-desc {
    font-size: 11px;
    color: #ba68c8;
    line-height: 1.5;
}

/* 示例列表加载/错误状态 */
.bs-example-loading,
.bs-example-load-err {
    grid-column: 1 / -1;
    text-align: center;
    padding: 36px 16px;
    font-size: 13px;
    color: #ba68c8;
    line-height: 1.9;
}
.bs-example-load-err { color: #e57373; }

/* ========== Toast ========== */
.bs-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(74, 20, 140, 0.88);
    color: #fff;
    padding: 10px 22px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(74, 20, 140, 0.35);
    z-index: 20000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    white-space: nowrap;
}

.bs-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== 暗黑模式 ========== */
body.dark .bs-container {
    background: #1a0d24;
}

body.dark .bs-toolbar {
    background: linear-gradient(135deg, #4a148c 0%, #311b5a 100%);
}

body.dark .bs-main-content {
    background: #1a0d24;
}

/* 左栏 */
body.dark .bs-history-panel {
    background: #1e1130;
    border-right-color: #3d2060;
}

body.dark .bs-history-header {
    background: linear-gradient(to bottom, #241438 0%, #1e1130 100%);
    border-bottom-color: #3d2060;
}

body.dark .bs-history-header h3 { color: #ce93d8; }

body.dark .bs-history-search { border-bottom-color: #3d2060; }

body.dark .bs-history-search input {
    background: #17092a;
    border-color: #5c3380;
    color: #e0baf8;
}

body.dark .bs-history-search input:focus {
    border-color: #ce93d8;
    box-shadow: 0 0 0 2px rgba(206, 147, 216, 0.15);
}

body.dark .bs-history-item:hover {
    background: #2d1a40;
    border-color: #5c3380;
}

body.dark .bs-history-item.active {
    background: #3a2050;
    border-color: #7b40a0;
}

body.dark .bs-history-item-topic { color: #ce93d8; }

body.dark .bs-history-item-meta { color: #9c68b8; }

body.dark .bs-history-item-badge {
    background: #2d1a40;
    color: #ce93d8;
}

body.dark .bs-history-empty { color: #7a4a98; }

body.dark .bs-history-item:hover .bs-history-item-del:hover {
    color: #ef9a9a;
    background: rgba(229, 57, 53, 0.15);
}

body.dark .bs-history-list::-webkit-scrollbar-thumb { background: #5c3380; }
body.dark .bs-history-list::-webkit-scrollbar-thumb:hover { background: #9c27b0; }

/* 中栏 */
body.dark .bs-input-panel {
    background: #1e1130;
    border-right-color: #3d2060;
}

body.dark .bs-panel-header {
    background: linear-gradient(to bottom, #241438 0%, #1e1130 100%);
    border-bottom-color: #3d2060;
}

body.dark .bs-panel-header h3 { color: #ce93d8; }
body.dark .bs-panel-tip       { color: #9c68b8; }

body.dark .bs-label { color: #c9a8e8; }

body.dark .bs-textarea {
    background: #17092a;
    border-color: #5c3380;
    color: #e0baf8;
}

body.dark .bs-textarea:focus {
    border-color: #ba68c8;
    background: #1e1130;
    box-shadow: 0 0 0 3px rgba(186, 104, 200, 0.15);
}

body.dark .bs-textarea::placeholder { color: #6a3d8a; }

body.dark .bs-char-counter { color: #7a4a98; }

body.dark .bs-method-item {
    background: #17092a;
    border-color: #4a2070;
    color: #c9a8e8;
}

body.dark .bs-method-item:hover {
    background: #2d1a40;
    border-color: #9c27b0;
}

body.dark .bs-method-item.selected {
    background: linear-gradient(135deg, #6a1b9a 0%, #4a148c 100%);
    border-color: #9c27b0;
    color: #fff;
}

body.dark .bs-count-item {
    background: #17092a;
    border-color: #5c3380;
    color: #ce93d8;
}

body.dark .bs-count-item:hover {
    background: #2d1a40;
    border-color: #ce93d8;
}

body.dark .bs-count-item.selected {
    background: linear-gradient(135deg, #6a1b9a 0%, #4a148c 100%);
    border-color: #9c27b0;
    color: #fff;
}

body.dark .bs-depth-item {
    background: #17092a;
    border-color: #5c3380;
    color: #c9a8e8;
}

body.dark .bs-depth-item:hover {
    background: #2d1a40;
    border-color: #ce93d8;
    color: #ce93d8;
}

body.dark .bs-depth-item.selected {
    background: linear-gradient(135deg, #6a1b9a 0%, #4a148c 100%);
    border-color: #9c27b0;
    color: #fff;
}

body.dark .bs-generate-btn {
    background: linear-gradient(135deg, #6a1b9a 0%, #4a148c 100%);
}

body.dark .bs-generate-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #8e24aa 0%, #6a1b9a 100%);
}

body.dark .bs-tips-box {
    background: linear-gradient(135deg, #1e1130 0%, #1a0d24 100%);
    border-color: #4a2070;
    color: #ba68c8;
}

body.dark .bs-input-body::-webkit-scrollbar-thumb { background: #5c3380; }
body.dark .bs-input-body::-webkit-scrollbar-thumb:hover { background: #9c27b0; }

/* 右栏 */
body.dark .bs-result-panel {
    background: #1a0d24;
}

body.dark .bs-result-header {
    background: linear-gradient(to bottom, #1e1130 0%, #1a0d24 100%);
    border-bottom-color: #3d2060;
}

body.dark .bs-result-header h3 { color: #ce93d8; }

body.dark .bs-result-topic { color: #e040fb; }

body.dark .bs-result-method-badge {
    background: #2d1a40;
    color: #ce93d8;
}

body.dark .bs-result-count-badge {
    background: #1b3a22;
    color: #66bb6a;
}

body.dark .bs-placeholder-title { color: #9c27b0; }
body.dark .bs-placeholder-desc  { color: #7a4a98; }

body.dark .bs-placeholder-shortcut kbd {
    background: #2d1a40;
    border-color: #5c3380;
    color: #ce93d8;
}

body.dark .bs-loading-text { color: #ce93d8; }

body.dark .bs-result-content .bs-idea-card {
    background: #1e1130;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark .bs-result-content .bs-idea-header {
    background: linear-gradient(135deg, #241438 0%, #1e1130 100%);
    border-bottom-color: #3d2060;
}

body.dark .bs-result-content .bs-idea-title { color: #e0baf8; }

body.dark .bs-result-content .bs-idea-body { color: #c9a8e8; }

body.dark .bs-result-content .bs-idea-body strong { color: #f1948a; }

body.dark .bs-result-content .bs-idea-body code {
    background: #2d1a40;
    color: #e040fb;
}

body.dark .bs-result-content .bs-idea-body a {
    color: #f1948a;
    text-decoration-color: #f1948a;
}

body.dark .bs-result-content .bs-idea-body a:hover {
    color: #e74c3c;
}

body.dark .bs-idea-copy-btn:hover {
    background: #2d1a40;
    border-color: #5c3380;
    color: #ce93d8;
}

body.dark .bs-result-error .error-tip { color: #9c68b8; }

body.dark .bs-result-body::-webkit-scrollbar-thumb { background: #5c3380; }
body.dark .bs-result-body::-webkit-scrollbar-thumb:hover { background: #9c27b0; }

body.dark .bs-regen-btn {
    background: linear-gradient(135deg, #2d1a40 0%, #1e1130 100%);
    border-color: #7b40a0;
    color: #ce93d8;
}

body.dark .bs-regen-btn:hover {
    background: linear-gradient(135deg, #6a1b9a 0%, #4a148c 100%);
    color: #fff;
    border-color: #9c27b0;
}

/* 模态框暗黑 */
body.dark .bs-modal {
    background: #1e1130;
}

body.dark .bs-example-card {
    background: #17092a;
    border-color: #4a2070;
}

body.dark .bs-example-card:hover {
    background: #2d1a40;
    border-color: #9c27b0;
}

body.dark .bs-example-topic { color: #e0baf8; }

body.dark .bs-example-badge {
    background: #2d1a40;
    color: #ce93d8;
}

body.dark .bs-example-desc { color: #9c68b8; }

body.dark .bs-modal-body::-webkit-scrollbar-thumb { background: #5c3380; }
body.dark .bs-modal-body::-webkit-scrollbar-thumb:hover { background: #9c27b0; }

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .bs-history-panel { display: none; }

    .bs-result-content .bs-result-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .bs-input-panel {
        width: 220px;
    }

    .bs-method-desc { display: none; }
}

@media print {
    .bs-toolbar,
    .bs-history-panel,
    .bs-input-panel,
    .bs-result-header { display: none !important; }

    #bsResultPlaceholder,
    #bsResultLoading,
    #bsResultError { display: none !important; }

    .bs-container,
    .bs-main-content,
    .bs-result-panel {
        height: auto !important;
        overflow: visible !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: #fff !important;
        width: 100% !important;
    }

    .bs-result-body {
        padding: 10px 0 !important;
        overflow: visible !important;
    }

    .bs-result-content .bs-result-list {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .bs-result-content .bs-idea-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #d8b8e8 !important;
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}
