/* ========== CSS 变量 ========== */
:root {
    --bs-primary: #7c3aed;
    --bs-primary-hover: #6d28d9;
    --bs-primary-light: #ede9fe;
    --bs-primary-rgb: 124, 58, 237;
    --bs-toolbar-bg: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    --bs-toolbar-shadow: rgba(124, 58, 237, 0.35);
    --bs-btn-bg: #ffffff;
    --bs-btn-text: #6d28d9;
    --bs-section-bg: #ffffff;
    --bs-border: #e2e8f0;
    --bs-text: #1e293b;
    --bs-text-secondary: #64748b;
    --bs-config-bg: #fafafa;
    --bs-result-bg: #faf5ff;
    --bs-history-bg: #ffffff;
    --bs-input-bg: #ffffff;
    --bs-input-border: #d1d5db;
    --bs-input-focus: #7c3aed;
    --bs-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --bs-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --bs-radius: 8px;
}

/* ========== 暗黑模式变量 ========== */
.bs-dark {
    --bs-primary: #a78bfa;
    --bs-primary-hover: #8b5cf6;
    --bs-primary-light: #2d1b69;
    --bs-primary-rgb: 167, 139, 250;
    --bs-toolbar-bg: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    --bs-toolbar-shadow: rgba(30, 27, 75, 0.5);
    --bs-btn-bg: #334155;
    --bs-btn-text: #a78bfa;
    --bs-section-bg: #1e293b;
    --bs-border: #334155;
    --bs-text: #f1f5f9;
    --bs-text-secondary: #94a3b8;
    --bs-config-bg: #0f172a;
    --bs-result-bg: #130a2a;
    --bs-history-bg: #1e293b;
    --bs-input-bg: #1e293b;
    --bs-input-border: #475569;
    --bs-input-focus: #a78bfa;
    --bs-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    --bs-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* ========== 容器 ========== */
.bs-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f8fafc;
    border-radius: var(--bs-radius);
    overflow: hidden;
    box-shadow: var(--bs-shadow);
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

.bs-dark.bs-container,
.bs-dark .bs-container {
    background: #0f172a;
}

.bs-container.bs-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 工具栏 ========== */
.bs-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: var(--bs-toolbar-bg);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 10px var(--bs-toolbar-shadow);
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.toolbar-btn {
    padding: 6px 11px;
    background: var(--bs-btn-bg);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--bs-btn-text);
    transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.18s;
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ========== 主内容区 ========== */
.bs-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: var(--bs-config-bg);
    transition: background 0.3s ease;
}

/* ========== 左侧历史面板 ========== */
.bs-history-panel {
    width: 210px;
    background: var(--bs-history-bg);
    border-right: 1px solid var(--bs-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
    border-bottom: 1px solid var(--bs-border);
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.bs-dark .history-header {
    background: linear-gradient(to bottom, #1e293b, #162032);
}

.history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--bs-text-secondary);
}

.history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 4px;
    transition: background 0.2s;
    white-space: nowrap;
}

.history-clear-btn:hover {
    background: #fde8e8;
}

.bs-dark .history-clear-btn {
    background: rgba(239, 68, 68, 0.15);
}

.history-search {
    padding: 8px 10px;
    border-bottom: 1px solid var(--bs-border);
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--bs-input-border);
    border-radius: 5px;
    font-size: 12px;
    outline: none;
    background: var(--bs-input-bg);
    color: var(--bs-text);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.history-search input:focus {
    border-color: var(--bs-input-focus);
    box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.15);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.history-empty {
    text-align: center;
    color: var(--bs-text-secondary);
    font-size: 12px;
    padding: 20px 10px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    margin-bottom: 4px;
    background: var(--bs-config-bg);
    border: 1px solid var(--bs-border);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, transform 0.18s;
    animation: fadeInSlide 0.2s ease;
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateX(-6px); }
    to { opacity: 1; transform: translateX(0); }
}

.history-item:hover {
    background: var(--bs-primary-light);
    border-color: var(--bs-primary);
    transform: translateX(2px);
}

.history-item-main {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.history-style-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.history-item-info {
    flex: 1;
    min-width: 0;
}

.history-item-topic {
    font-size: 12px;
    font-weight: 500;
    color: var(--bs-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-meta {
    font-size: 10px;
    color: var(--bs-text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-delete-btn {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    border-radius: 3px;
    padding: 0;
    line-height: 1;
    text-align: center;
    transition: background 0.15s, color 0.15s;
    margin-left: 4px;
}

.history-delete-btn:hover {
    background: #fde8e8;
    color: #ef4444;
}

/* ========== 中间配置面板 ========== */
.bs-config-panel {
    width: 380px;
    flex-shrink: 0;
    background: var(--bs-section-bg);
    border-right: 1px solid var(--bs-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 14px;
    gap: 14px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.config-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--bs-text);
}

.optional-badge {
    background: #f0fdf4;
    color: #16a34a;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 400;
    border: 1px solid #bbf7d0;
    margin-left: 4px;
}

.bs-dark .optional-badge {
    background: rgba(22, 163, 74, 0.2);
    border-color: rgba(187, 247, 208, 0.3);
}

.char-count {
    font-size: 11px;
    color: var(--bs-text-secondary);
    font-weight: 400;
    transition: color 0.2s;
}

.char-count.warn { color: #ef4444; }
.char-count.orange { color: #f97316; }
.char-count.ok { color: #16a34a; }

/* ========== 导入示例栏 ========== */
.bs-example-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 7px;
}

.bs-example-label {
    font-size: 11.5px;
    color: var(--bs-text-secondary);
    flex-shrink: 0;
}

.bs-example-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: var(--bs-primary-light);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.3);
    border-radius: 12px;
    font-size: 11.5px;
    color: var(--bs-primary);
    cursor: pointer;
    user-select: none;
    transition: background 0.18s, border-color 0.18s, transform 0.18s;
    white-space: nowrap;
}

.bs-example-chip:hover {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #ffffff;
    transform: translateY(-1px);
}

.bs-example-chip.ael-active {
    background: var(--bs-primary-hover);
    border-color: var(--bs-primary-hover);
    color: #ffffff;
    transform: scale(0.95);
}

.bs-dark .bs-example-chip {
    background: rgba(var(--bs-primary-rgb), 0.15);
    border-color: rgba(var(--bs-primary-rgb), 0.3);
    color: var(--bs-primary);
}

.bs-dark .bs-example-chip:hover,
.bs-dark .bs-example-chip.ael-active {
    background: var(--bs-primary);
    color: #ffffff;
}

/* ========== textarea 相对容器（用于定位复制按钮） ========== */
.textarea-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 复制输入内容按钮（规范：有内容时显示，图标+文字） */
.copy-input-btn {
    align-self: flex-end;
    margin-top: 5px;
    padding: 4px 11px;
    background: var(--bs-primary-light);
    border: 1px solid var(--bs-primary);
    border-radius: 5px;
    color: var(--bs-primary);
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
    white-space: nowrap;
    user-select: none;
}

.copy-input-btn:hover {
    background: var(--bs-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(var(--bs-primary-rgb), 0.3);
}

.copy-input-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ========== 文本输入框 ========== */
.bs-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--bs-input-border);
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    background: var(--bs-input-bg);
    color: var(--bs-text);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.3s;
    font-family: inherit;
}

.bs-textarea:focus {
    border-color: var(--bs-input-focus);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.12);
}

.topic-textarea {
    min-height: 80px;
}

.context-textarea {
    min-height: 72px;
}

/* ========== 思维框架卡片 ========== */
.style-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.style-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 9px 4px 8px;
    background: var(--bs-config-bg);
    border: 2px solid var(--bs-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    user-select: none;
}

.style-card:hover {
    border-color: var(--bs-primary);
    background: var(--bs-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(var(--bs-primary-rgb), 0.2);
}

.style-card.active {
    border-color: var(--bs-primary);
    background: var(--bs-primary-light);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.15), 0 2px 8px rgba(var(--bs-primary-rgb), 0.25);
}

.style-icon {
    font-size: 18px;
    line-height: 1;
}

.style-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--bs-text);
    white-space: nowrap;
}

.style-desc {
    font-size: 9.5px;
    color: var(--bs-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ========== 数量控制 ========== */
.count-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.count-btn {
    width: 30px;
    height: 30px;
    border: 1.5px solid var(--bs-input-border);
    border-radius: 6px;
    background: var(--bs-input-bg);
    color: var(--bs-text);
    font-size: 18px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s;
    line-height: 1;
    padding: 0;
}

.count-btn:hover {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
    background: var(--bs-primary-light);
    transform: scale(1.08);
}

/* 边界值时禁用状态，提升可发现性 */
.count-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    border-color: var(--bs-border);
    color: var(--bs-text-secondary);
    background: var(--bs-input-bg);
}

.count-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--bs-primary);
    min-width: 32px;
    text-align: center;
}

/* dyc-num-pop 弹跳动画（规范要求：大数字变化时触发） */
@keyframes dyc-num-pop {
    from { transform: scale(0.86); }
    50%  { transform: scale(1.07); }
    to   { transform: scale(1); }
}

.count-value.pop {
    animation: dyc-num-pop 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

.count-unit {
    font-size: 12px;
    color: var(--bs-text-secondary);
}

/* ========== 生成按钮区 ========== */
.generate-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.generate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 13px 20px;
    background: var(--bs-toolbar-bg);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.2s;
    box-shadow: 0 4px 14px var(--bs-toolbar-shadow);
    width: 100%;
    position: relative;
    letter-spacing: 0.3px;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--bs-toolbar-shadow);
}

.generate-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--bs-toolbar-shadow);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-icon-wrap {
    font-size: 17px;
}

.btn-spinner {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.kbd-hint {
    font-size: 10px;
    opacity: 0.75;
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    flex-shrink: 0;
}

.kbd-hint kbd {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    padding: 0 4px;
    font-size: 10px;
    font-family: inherit;
}

.cancel-btn {
    padding: 9px 16px;
    background: transparent;
    border: 1.5px solid #ef4444;
    color: #ef4444;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
    width: 100%;
}

.cancel-btn:hover {
    background: #fef2f2;
    border-color: #dc2626;
    color: #dc2626;
}

.bs-dark .cancel-btn:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* ========== 提示栏 ========== */
.hint-bar {
    font-size: 11.5px;
    color: var(--bs-text-secondary);
    background: var(--bs-config-bg);
    border: 1px solid var(--bs-border);
    border-radius: 6px;
    padding: 9px 12px;
    line-height: 1.5;
    transition: background 0.3s, border-color 0.3s;
}

/* ========== 右侧结果面板 ========== */
.bs-result-panel {
    flex: 1;
    min-width: 0;
    background: var(--bs-result-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background 0.3s ease;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #f5f3ff, #ede9fe);
    border-bottom: 1px solid #ddd6fe;
    flex-shrink: 0;
    gap: 10px;
    flex-wrap: wrap;
    transition: background 0.3s ease;
}

.bs-dark .result-header {
    background: linear-gradient(to bottom, #1e1b4b, #1a1533);
    border-bottom-color: #312e81;
}

.result-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--bs-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.result-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.idea-badge {
    background: var(--bs-primary);
    color: white;
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.result-btn {
    padding: 4px 10px;
    background: white;
    border: 1px solid #ddd6fe;
    border-radius: 5px;
    font-size: 11.5px;
    color: #5b21b6;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s;
}

.result-btn:hover {
    background: var(--bs-primary-light);
    border-color: var(--bs-primary);
    color: var(--bs-primary);
    transform: translateY(-1px);
}

.bs-dark .result-btn {
    background: #334155;
    border-color: #4c1d95;
    color: #a78bfa;
}

.bs-dark .result-btn:hover {
    background: #2d1b69;
}

.result-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    margin: 5px;
}

/* ========== 空占位符 ========== */
.empty-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    flex: 1;
}

.empty-icon {
    font-size: 52px;
    margin-bottom: 14px;
    opacity: 0.5;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.empty-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--bs-text-secondary);
    margin-bottom: 6px;
}

.empty-hint {
    font-size: 12.5px;
    color: var(--bs-text-secondary);
    opacity: 0.7;
}

/* ========== 结果摘要 ========== */
.result-summary {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    border-left: 4px solid var(--bs-primary);
    border-radius: 0 8px 8px 0;
    padding: 11px 15px;
    font-size: 13px;
    color: #4c1d95;
    font-style: italic;
    line-height: 1.6;
    transition: background 0.3s;
}

.bs-dark .result-summary {
    background: linear-gradient(135deg, #2d1b69, #1e1b4b);
    color: #c4b5fd;
    border-left-color: #7c3aed;
}

/* ========== 分类卡片 ========== */
.category-card {
    background: var(--bs-section-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--bs-shadow);
    transition: box-shadow 0.2s, background 0.3s;
    animation: cardFadeIn 0.3s ease both;
}

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.category-card:nth-child(1) { animation-delay: 0.05s; }
.category-card:nth-child(2) { animation-delay: 0.1s; }
.category-card:nth-child(3) { animation-delay: 0.15s; }
.category-card:nth-child(4) { animation-delay: 0.2s; }
.category-card:nth-child(5) { animation-delay: 0.25s; }
.category-card:nth-child(6) { animation-delay: 0.3s; }

.category-card:hover {
    box-shadow: var(--bs-shadow-md);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: color-mix(in srgb, var(--cat-color, #667eea) 12%, white);
    border-bottom: 2px solid var(--cat-color, #667eea);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.bs-dark .category-header {
    background: color-mix(in srgb, var(--cat-color, #667eea) 20%, #1e293b);
}

.category-header:hover {
    background: color-mix(in srgb, var(--cat-color, #667eea) 20%, white);
}

.bs-dark .category-header:hover {
    background: color-mix(in srgb, var(--cat-color, #667eea) 28%, #1e293b);
}

.cat-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.cat-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--cat-color, #667eea);
    flex: 1;
}

.cat-count {
    font-size: 11px;
    background: color-mix(in srgb, var(--cat-color, #667eea) 15%, white);
    color: var(--cat-color, #667eea);
    border: 1px solid color-mix(in srgb, var(--cat-color, #667eea) 30%, transparent);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.cat-toggle {
    color: var(--cat-color, #667eea);
    font-size: 14px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.category-card.collapsed .cat-toggle {
    transform: rotate(-90deg);
}

.category-body {
    display: flex;
    flex-direction: column;
    padding: 5px;
    gap: 2px;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    max-height: 2000px;
    overflow: hidden;
}

.category-card.collapsed .category-body {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* ========== 想法条目 ========== */
.idea-item {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    border: 1px solid transparent;
    background: var(--bs-config-bg);
}

.idea-item:hover {
    background: color-mix(in srgb, var(--cat-color, #667eea) 8%, white);
    border-color: color-mix(in srgb, var(--cat-color, #667eea) 25%, transparent);
    transform: translateX(3px);
}

.bs-dark .idea-item:hover {
    background: color-mix(in srgb, var(--cat-color, #667eea) 15%, #1e293b);
}

.idea-num {
    min-width: 18px;
    height: 18px;
    background: color-mix(in srgb, var(--cat-color, #667eea) 15%, white);
    color: var(--cat-color, #667eea);
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.bs-dark .idea-num {
    background: color-mix(in srgb, var(--cat-color, #667eea) 25%, #1e293b);
}

.idea-text {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--bs-text);
    word-break: break-word;
}

.idea-copy {
    opacity: 0;
    font-size: 11px;
    transition: opacity 0.15s;
    flex-shrink: 0;
    margin-top: 1px;
}

.idea-item:hover .idea-copy {
    opacity: 0.7;
}

/* ========== Toast通知 ========== */
.bs-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 22px;
    border-radius: 24px;
    font-size: 13.5px;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    max-width: 80vw;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    z-index: 99999;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.bs-toast.toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
    cursor: pointer;
}

.bs-toast.toast-success { background: linear-gradient(135deg, #059669, #047857); }
.bs-toast.toast-error   { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.bs-toast.toast-warning { background: linear-gradient(135deg, #d97706, #b45309); }
.bs-toast.toast-info    { background: linear-gradient(135deg, #7c3aed, #5b21b6); }

/* ========== 生成中：配置面板遮罩 ========== */
.bs-config-panel.config-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.2s;
}

/* 生成中框架卡片禁用态 */
.style-card.disabled-card {
    pointer-events: none;
    opacity: 0.55;
}

/* ========== 历史记录当前条目高亮 ========== */
.history-item.current {
    background: var(--bs-primary-light);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.2);
}

.history-item.current .history-item-topic {
    color: var(--bs-primary);
    font-weight: 600;
}

/* ========== legacyCopy 辅助元素（规范：禁止内联样式，改用CSS类） ========== */
.copy-helper {
    position: fixed;
    top: -9999px;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

/* ========== 工具类 ========== */
.hidden {
    display: none !important;
}

/* ========== 滚动条美化 ========== */
.bs-config-panel::-webkit-scrollbar,
.result-body::-webkit-scrollbar,
.history-list::-webkit-scrollbar {
    width: 5px;
}

.bs-config-panel::-webkit-scrollbar-track,
.result-body::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.bs-config-panel::-webkit-scrollbar-thumb,
.result-body::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb {
    background: rgba(var(--bs-primary-rgb), 0.25);
    border-radius: 3px;
}

.bs-config-panel::-webkit-scrollbar-thumb:hover,
.result-body::-webkit-scrollbar-thumb:hover,
.history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--bs-primary-rgb), 0.5);
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .bs-history-panel {
        width: 160px;
    }
    .bs-config-panel {
        width: 320px;
    }
    .style-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 680px) {
    .bs-main-content {
        flex-direction: column;
    }
    .bs-history-panel {
        width: 100%;
        max-height: 160px;
        border-right: none;
        border-bottom: 1px solid var(--bs-border);
    }
    .bs-config-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--bs-border);
        max-height: 55vh;
    }
    .style-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    .bs-container {
        height: auto;
        min-height: unset;
    }
    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
