/* =============================================
   常见问题生成器 - frequently_asked_questions.css
   三栏布局：历史 | 配置 | 结果
   主题色：专业蓝 #1565c0 / #0d47a1
   ============================================= */

/* ========== 主容器 ========== */
.faq-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f0f5ff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.faq-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;
}

/* ========== 顶部工具栏 ========== */
.faq-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 12px;
    min-height: 36px;
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    color: #fff;
    flex-wrap: wrap;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.35);
    flex-shrink: 0;
}

.faq-toolbar .toolbar-group {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.faq-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: #1565c0;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.4;
}

.faq-toolbar .toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.faq-toolbar .toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.faq-toolbar .toolbar-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

/* 主操作按钮 */
.faq-toolbar .toolbar-btn-primary {
    background: linear-gradient(135deg, #ff6f00 0%, #e65100 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(255, 111, 0, 0.45);
}

.faq-toolbar .toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #ffa000 0%, #ff6f00 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 111, 0, 0.55);
}

/* 生成中流光动画 */
.faq-toolbar .toolbar-btn-primary.faq-btn-loading {
    background: linear-gradient(90deg, #ff6f00 0%, #ffb300 35%, #ff6f00 65%, #e65100 100%);
    background-size: 200% 100%;
    animation: faqBtnShimmer 1.4s ease-in-out infinite;
    cursor: not-allowed;
    box-shadow: 0 2px 10px rgba(255, 111, 0, 0.5);
}

@keyframes faqBtnShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 取消按钮 */
.faq-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;
}

.faq-toolbar .toolbar-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.28) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* 标题文字 */
.faq-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.5px;
    margin-right: 4px;
}

/* ========== 主内容三栏 ========== */
.faq-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f0f5ff;
}

/* ========== 左栏：历史记录 ========== */
.faq-history-panel {
    width: 190px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #dce8f8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(to bottom, #fafcff 0%, #f0f5ff 100%);
    border-bottom: 1px solid #dce8f8;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1565c0;
}

.history-count {
    font-size: 11px;
    color: #64b5f6;
    font-weight: 400;
}

.history-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;
}

.history-clear-btn:hover { background: #fde8e8; }

.history-search {
    padding: 7px;
    border-bottom: 1px solid #dce8f8;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #b3d1f5;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #1a3a5c;
    background: #fafcff;
}

.history-search input:focus {
    border-color: #1565c0;
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.1);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list::-webkit-scrollbar-thumb { background: #b3d1f5; border-radius: 2px; }
.history-list::-webkit-scrollbar-thumb:hover { background: #ff9800; }

.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;
}

.history-item-main { flex: 1; min-width: 0; }

.history-item:hover {
    background: #e8f0fe;
    border-color: #bbdefb;
}

.history-item.active {
    background: #dbe8fd;
    border-color: #90caf9;
}

.history-item-topic {
    font-size: 12px;
    font-weight: 600;
    color: #1565c0;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-word;
}

.history-item-meta {
    font-size: 10px;
    color: #64b5f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item-badge {
    background: #e3f2fd;
    color: #1565c0;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 10px;
    white-space: nowrap;
}

.history-item-del {
    background: none;
    border: none;
    color: #90caf9;
    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;
}

.history-item:hover .history-item-del { opacity: 1; }
.history-item:hover .history-item-del:hover { color: #e53935; background: #fce4e1; }

.history-empty {
    text-align: center;
    color: #90caf9;
    font-size: 12px;
    padding: 24px 8px;
    line-height: 1.7;
}

/* ========== 中栏：参数配置 ========== */
.faq-input-panel {
    width: 270px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #dce8f8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 12px 14px 10px;
    border-bottom: 1px solid #dce8f8;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #fafcff 0%, #f0f5ff 100%);
}

.panel-header h3 {
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 600;
    color: #1565c0;
}

.panel-tip {
    font-size: 11px;
    color: #64b5f6;
    display: block;
}

.faq-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}

.faq-input-body::-webkit-scrollbar { width: 4px; }
.faq-input-body::-webkit-scrollbar-track { background: transparent; }
.faq-input-body::-webkit-scrollbar-thumb { background: #b3d1f5; border-radius: 2px; }
.faq-input-body::-webkit-scrollbar-thumb:hover { background: #ff9800; }

/* 字段组 */
.faq-field-group {
    margin-bottom: 16px;
}

.faq-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #1a3a5c;
    margin-bottom: 7px;
}

/* 主题文本域 */
.faq-input-wrap {
    position: relative;
}

.faq-textarea {
    width: 100%;
    padding: 9px 30px 20px 12px;
    border: 1.5px solid #b3d1f5;
    border-radius: 6px;
    font-size: 13px;
    color: #1a3a5c;
    background: #fafcff;
    outline: none;
    resize: vertical;
    min-height: 72px;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    word-break: break-word;
}

.faq-textarea:focus {
    border-color: #1565c0;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
    background: #fff;
}

.faq-textarea::placeholder {
    color: #90caf9;
    font-size: 12px;
}

/* 输入抖动动画（输入为空时提示） */
@keyframes faqShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.faq-textarea.shake {
    animation: faqShake 0.4s ease;
    border-color: #e53935 !important;
}

.faq-char-counter {
    position: absolute;
    bottom: 5px;
    right: 8px;
    font-size: 10px;
    color: #90caf9;
    pointer-events: none;
    user-select: none;
}

.faq-char-counter.warning { color: #ff9800; }
.faq-char-counter.limit   { color: #e53935; }

/* 清空输入按钮 */
.faq-clear-btn {
    position: absolute;
    top: 7px;
    right: 7px;
    background: none;
    border: none;
    color: #b3d1f5;
    font-size: 15px;
    line-height: 20px;
    width: 20px;
    height: 20px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
}
.faq-clear-btn:hover {
    color: #e53935;
    background: rgba(229, 57, 53, 0.1);
}

/* 场景分类：2列网格 */
.faq-option-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.faq-option-item {
    padding: 7px 8px;
    border: 1.5px solid #b3d1f5;
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    color: #1a3a5c;
    transition: all 0.18s;
    user-select: none;
    background: #fafcff;
    text-align: center;
    line-height: 1.4;
}

.faq-option-item .option-icon {
    display: block;
    font-size: 15px;
    margin-bottom: 2px;
}

.faq-option-item:hover {
    border-color: #1565c0;
    color: #1565c0;
    background: #e8f0fe;
}

.faq-option-item.selected {
    border-color: #1565c0;
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(21, 101, 192, 0.3);
}

/* 生成数量：横排胶囊 */
.faq-count-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.faq-count-item {
    padding: 5px 12px;
    border: 1.5px solid #b3d1f5;
    border-radius: 16px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #1565c0;
    transition: all 0.18s;
    user-select: none;
    background: #fafcff;
}

.faq-count-item:hover {
    border-color: #1565c0;
    background: #e8f0fe;
}

.faq-count-item.selected {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    border-color: #1565c0;
    color: #fff;
    box-shadow: 0 2px 6px rgba(21, 101, 192, 0.3);
}

/* 答案详细度：三等分 */
.faq-detail-group {
    display: flex;
    gap: 6px;
}

.faq-detail-item {
    flex: 1;
    padding: 8px 6px;
    text-align: center;
    border: 1.5px solid #b3d1f5;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    color: #1a3a5c;
    transition: all 0.18s;
    user-select: none;
    background: #fafcff;
}

.faq-detail-item:hover {
    border-color: #1565c0;
    color: #1565c0;
    background: #e8f0fe;
}

.faq-detail-item.selected {
    border-color: #1565c0;
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(21, 101, 192, 0.3);
}

.faq-detail-item .detail-icon {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

/* 中栏内嵌生成按钮 */
.faq-generate-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(21, 101, 192, 0.35);
    margin-bottom: 14px;
}

.faq-generate-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.45);
    transform: translateY(-1px);
}

.faq-generate-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

/* 生成中流光动画（中栏按钮） */
.faq-generate-btn.faq-inline-loading {
    background: linear-gradient(90deg, #1565c0 0%, #42a5f5 35%, #1565c0 65%, #0d47a1 100%);
    background-size: 200% 100%;
    animation: faqBtnShimmer 1.4s ease-in-out infinite;
    opacity: 1;
    cursor: not-allowed;
    transform: none;
}

/* 使用提示卡片 */
.faq-tips-box {
    background: linear-gradient(135deg, #f0f8ff 0%, #e8f4fd 100%);
    border: 1px solid #b3d1f5;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    color: #1565c0;
    line-height: 1.7;
}

.faq-tips-box p  { margin: 0 0 4px; font-weight: 600; }
.faq-tips-box ul { margin: 0; padding-left: 16px; }
.faq-tips-box li { margin-bottom: 2px; }
.faq-tips-box ul li::marker { color: #1565c0; font-weight: 600; }

/* ========== 右栏：结果展示 ========== */
.faq-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fafcff;
    min-width: 0;
}

.faq-result-header {
    padding: 10px 16px;
    border-bottom: 1px solid #dce8f8;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #fafcff 0%, #f0f5ff 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.faq-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1565c0;
}

.result-meta-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #64b5f6;
}

.result-meta-topic {
    font-size: 12px;
    font-weight: 700;
    color: #1565c0;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-category-badge {
    background: #e3f2fd;
    color: #1565c0;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.result-count-badge {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.faq-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
}

.faq-result-body::-webkit-scrollbar { width: 4px; }
.faq-result-body::-webkit-scrollbar-track { background: transparent; }
.faq-result-body::-webkit-scrollbar-thumb { background: #b3d1f5; border-radius: 3px; }
.faq-result-body::-webkit-scrollbar-thumb:hover { background: #ff9800; }

/* 占位符 */
.result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #90caf9;
    text-align: center;
    padding: 40px;
    min-height: 180px;
}

.placeholder-icon  { font-size: 52px; margin-bottom: 14px; opacity: 0.65; animation: faqIconFloat 3.2s ease-in-out infinite; }

@keyframes faqIconFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}
.placeholder-title { font-size: 16px; font-weight: 600; color: #64b5f6; margin: 0 0 8px; }
.placeholder-desc  { font-size: 13px; color: #90caf9; margin: 3px 0; line-height: 1.6; }

.placeholder-shortcut {
    font-size: 12px;
    color: #b3d1f5;
    margin: 10px 0 0;
}

.placeholder-shortcut kbd {
    display: inline-block;
    padding: 1px 5px;
    background: #e8f0fe;
    border: 1px solid #b3d1f5;
    border-radius: 3px;
    font-size: 11px;
    color: #1565c0;
    font-family: inherit;
    line-height: 1.5;
}

/* 加载中 */
.result-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 180px;
}

.loading-dots { display: flex; gap: 8px; }

.loading-dots span {
    width: 10px;
    height: 10px;
    background: #1565c0;
    border-radius: 50%;
    animation: dotBounce 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40%           { transform: scale(1.1); opacity: 1;   }
}

.loading-text {
    font-size: 13px;
    color: #64b5f6;
    margin: 0;
    transition: opacity 0.4s;
}

/* ========== 结果内容 ========== */
.result-content {
    animation: faqFadeInUp 0.35s ease;
    min-height: 0;
    word-break: break-word;
}

@keyframes faqFadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* FAQ 列表 */
.result-content .faq-result-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 单条 FAQ */
.result-content .faq-result-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(21, 101, 192, 0.08);
    overflow: hidden;
    border-left: 4px solid #1565c0;
    transition: box-shadow 0.2s, border-left-color 0.2s;
}

.result-content .faq-result-item:hover {
    box-shadow: 0 3px 14px rgba(21, 101, 192, 0.18);
    border-left-color: #1976d2;
}

/* 问题行 */
.result-content .faq-q {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px 10px;
    background: linear-gradient(135deg, #e8f0fe 0%, #dce8f8 100%);
    font-size: 14px;
    font-weight: 700;
    color: #1a3a5c;
    border-bottom: 1px solid #dce8f8;
    word-break: break-word;
}

/* 问题编号徽章 */
.result-content .faq-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 1px;
    padding: 0 4px;
}

/* 答案区 */
.result-content .faq-a {
    padding: 12px 16px;
    font-size: 13px;
    color: #2d3a4a;
    line-height: 1.85;
    word-break: break-word;
}

/* ---- 答案内富文本样式 ---- */
.result-content .faq-a p { margin: 0 0 8px; }
.result-content .faq-a p:last-child { margin-bottom: 0; }

.result-content .faq-a ul,
.result-content .faq-a ol {
    margin: 6px 0;
    padding-left: 20px;
    color: #2d3a4a;
    line-height: 1.85;
}

.result-content .faq-a li { margin-bottom: 3px; }

.result-content .faq-a ul li::marker,
.result-content .faq-a ol li::marker {
    color: #1565c0;
    font-weight: 700;
}

.result-content .faq-a strong {
    color: #1565c0;
    font-weight: 700;
}

.result-content .faq-a em {
    color: #5D3A2A;
    font-style: italic;
}

.result-content .faq-a a {
    color: #1565c0;
    text-decoration: none;
    border-bottom: 1px solid rgba(21, 101, 192, 0.3);
    transition: border-color 0.15s, color 0.15s;
}

.result-content .faq-a a:hover {
    color: #0d47a1;
    border-bottom-color: #1565c0;
}

.result-content .faq-a code {
    background: #e8f0fe;
    color: #1565c0;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-family: "Consolas", "Courier New", monospace;
}

.result-content .faq-a pre {
    background: #1a3050;
    color: #cfe2ff;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-family: "Consolas", "Courier New", monospace;
    overflow-x: auto;
    margin: 8px 0;
    line-height: 1.6;
}

.result-content .faq-a blockquote {
    margin: 8px 0;
    padding: 8px 14px;
    border-left: 4px solid #1565c0;
    background: #f0f5ff;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #37474f;
    font-style: italic;
    line-height: 1.75;
}

/* ---- 顶层直接 ul/ol（AI 未包裹在 faq-a 时兜底） ---- */
.result-content ul li::marker,
.result-content ol li::marker {
    color: #1565c0;
    font-weight: 600;
}

/* 错误提示 */
.result-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    min-height: 180px;
}

.result-error .error-icon { font-size: 36px; margin-bottom: 10px; }
.result-error .error-msg  { font-size: 14px; color: #e53935; margin: 0 0 6px; font-weight: 600; }
.result-error .error-tip  { font-size: 12px; color: #90caf9; margin: 0; }

/* 错误重试按钮 */
.error-retry-btn {
    margin-top: 16px;
    padding: 8px 22px;
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 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(21, 101, 192, 0.3);
}

.error-retry-btn:hover {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.4);
}

.error-retry-btn:active {
    transform: translateY(0);
}

/* ========== 示例导入模态框 ========== */
.faq-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    z-index: 10000;
    display: none;
}

.faq-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
    width: 620px;
    max-width: 95vw;
    max-height: 90vh;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.faq-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    color: #fff;
    flex-shrink: 0;
}

.faq-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.faq-modal-close {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.faq-modal-close:hover { background: rgba(255, 255, 255, 0.35); }

.faq-modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.faq-modal-body::-webkit-scrollbar { width: 4px; }
.faq-modal-body::-webkit-scrollbar-track { background: transparent; }
.faq-modal-body::-webkit-scrollbar-thumb { background: #b3d1f5; border-radius: 3px; }
.faq-modal-body::-webkit-scrollbar-thumb:hover { background: #ff9800; }

/* 示例卡片网格 */
.example-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.example-card {
    border: 1.5px solid #b3d1f5;
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafcff;
}

.example-card:hover {
    border-color: #1565c0;
    background: #e8f0fe;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(21, 101, 192, 0.16);
}

.example-card-icon  { font-size: 22px; margin-bottom: 6px; }

.example-card-topic {
    font-size: 13px;
    font-weight: 700;
    color: #1565c0;
    margin-bottom: 4px;
    word-break: break-word;
}

.example-card-badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1565c0;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    margin-bottom: 5px;
}

.example-card-desc {
    font-size: 11px;
    color: #64b5f6;
    line-height: 1.5;
    word-break: break-word;
}

/* ========== 响应式布局 ========== */
@media (max-width: 960px) {
    .faq-container {
        height: auto;
        min-height: unset;
    }

    .faq-main-content {
        flex-direction: column;
        overflow: visible;
    }

    .faq-history-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #dce8f8;
        max-height: 200px;
    }

    .faq-input-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #dce8f8;
    }

    .faq-result-panel {
        min-height: 320px;
    }

    .example-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .faq-toolbar .toolbar-title { display: none; }
    .faq-option-grid { grid-template-columns: repeat(3, 1fr); }
    .faq-result-body { padding: 14px 16px; }
}

/* ========== Toast 通知 ========== */
.faq-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: rgba(21, 32, 56, 0.92);
    color: #e2e8f0;
    padding: 9px 24px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.28s ease, transform 0.28s ease;
    z-index: 99999;
    pointer-events: none;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

.faq-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* =============================================
   暗黑模式（body.dark）
   ============================================= */

/* 主容器 */
body.dark .faq-container {
    background: #0f172a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark .faq-main-content {
    background: #0f172a;
}

/* ---- 左栏：历史记录 ---- */
body.dark .faq-history-panel {
    background: #1e293b;
    border-right-color: #2d3f5a;
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, #1e293b 0%, #16243a 100%);
    border-bottom-color: #2d3f5a;
}

body.dark .history-panel-header h3 { color: #60a5fa; }
body.dark .history-count           { color: #475569; }

body.dark .history-clear-btn {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

body.dark .history-clear-btn:hover { background: rgba(239, 68, 68, 0.22); }

body.dark .history-search { border-bottom-color: #2d3f5a; }

body.dark .history-search input {
    background: #0f172a;
    border-color: #2d3f5a;
    color: #e2e8f0;
}

body.dark .history-search input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

body.dark .history-search input::placeholder { color: #334155; }

body.dark .history-list::-webkit-scrollbar-thumb       { background: #2d3f5a; }
body.dark .history-list::-webkit-scrollbar-thumb:hover { background: #ffa726; }

body.dark .history-item:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

body.dark .history-item.active {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(59, 130, 246, 0.4);
}

body.dark .history-item.active:hover {
    background: rgba(59, 130, 246, 0.16);
}

body.dark .history-item-topic  { color: #60a5fa; }
body.dark .history-item-meta   { color: #475569; }

body.dark .history-item-badge {
    background: rgba(59, 130, 246, 0.14);
    color: #60a5fa;
}

body.dark .history-item-del { color: #475569; }

body.dark .history-item:hover .history-item-del:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.14);
}

body.dark .history-empty { color: #334155; }

/* ---- 中栏：参数配置 ---- */
body.dark .faq-input-panel {
    background: #1e293b;
    border-right-color: #2d3f5a;
}

body.dark .panel-header {
    background: linear-gradient(to bottom, #1e293b 0%, #16243a 100%);
    border-bottom-color: #2d3f5a;
}

body.dark .panel-header h3 { color: #60a5fa; }
body.dark .panel-tip       { color: #475569; }

body.dark .faq-input-body::-webkit-scrollbar-thumb { background: #2d3f5a; }
body.dark .faq-input-body::-webkit-scrollbar-thumb:hover { background: #ffa726; }

body.dark .faq-label { color: #94a3b8; }

body.dark .faq-textarea {
    background: #0f172a;
    border-color: #2d3f5a;
    color: #e2e8f0;
}

body.dark .faq-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: #0f172a;
}

body.dark .faq-textarea::placeholder { color: #334155; }
body.dark .faq-char-counter          { color: #475569; }

body.dark .faq-option-item {
    background: #0f172a;
    border-color: #2d3f5a;
    color: #94a3b8;
}

body.dark .faq-option-item:hover {
    border-color: #3b82f6;
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
}

body.dark .faq-count-item {
    background: #0f172a;
    border-color: #2d3f5a;
    color: #60a5fa;
}

body.dark .faq-count-item:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

body.dark .faq-detail-item {
    background: #0f172a;
    border-color: #2d3f5a;
    color: #94a3b8;
}

body.dark .faq-detail-item:hover {
    border-color: #3b82f6;
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
}

body.dark .faq-tips-box {
    background: rgba(59, 130, 246, 0.07);
    border-color: #2d3f5a;
    color: #60a5fa;
}

body.dark .faq-tips-box ul li::marker { color: #3b82f6; }

/* ---- 右栏：结果展示 ---- */
body.dark .faq-result-panel {
    background: #131f2e;
}

body.dark .faq-result-header {
    background: linear-gradient(to bottom, #1e293b 0%, #16243a 100%);
    border-bottom-color: #2d3f5a;
}

body.dark .faq-result-header h3     { color: #60a5fa; }
body.dark .result-meta-topic         { color: #60a5fa; }

body.dark .result-category-badge {
    background: rgba(59, 130, 246, 0.14);
    color: #60a5fa;
}

body.dark .faq-result-body::-webkit-scrollbar-thumb       { background: #2d3f5a; }
body.dark .faq-result-body::-webkit-scrollbar-thumb:hover { background: #ffa726; }

body.dark .placeholder-title { color: #3b82f6; }
body.dark .placeholder-desc  { color: #334155; }

body.dark .loading-dots span { background: #3b82f6; }
body.dark .loading-text      { color: #3b82f6; }

/* FAQ 结果卡片 */
body.dark .result-content .faq-result-item {
    background: #1e293b;
    border-left-color: #3b82f6;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

body.dark .result-content .faq-result-item:hover {
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.45);
    border-left-color: #60a5fa;
}

body.dark .result-content .faq-q {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.14) 0%, rgba(30, 50, 80, 0.6) 100%);
    color: #e2e8f0;
    border-bottom-color: #2d3f5a;
}

body.dark .result-content .faq-a              { color: #cbd5e1; }
body.dark .result-content .faq-a ul,
body.dark .result-content .faq-a ol           { color: #cbd5e1; }

body.dark .result-content .faq-a ul li::marker,
body.dark .result-content .faq-a ol li::marker { color: #3b82f6; }

body.dark .result-content .faq-a strong { color: #60a5fa; }
body.dark .result-content .faq-a em     { color: #c8956c; font-style: italic; }

body.dark .result-content .faq-a a {
    color: #60a5fa;
    border-bottom-color: rgba(96, 165, 250, 0.3);
}

body.dark .result-content .faq-a a:hover {
    color: #93c5fd;
    border-bottom-color: #60a5fa;
}

body.dark .result-content .faq-a code {
    background: rgba(59, 130, 246, 0.14);
    color: #93c5fd;
}

body.dark .result-content .faq-a pre {
    background: #0a1628;
    color: #bfdbfe;
}

body.dark .result-content .faq-a blockquote {
    border-left-color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
    color: #94a3b8;
}

body.dark .result-content ul li::marker,
body.dark .result-content ol li::marker { color: #3b82f6; }

body.dark .result-error .error-tip { color: #475569; }

/* ---- 模态框 ---- */
body.dark .faq-modal-overlay {
    background: rgba(0, 0, 0, 0.65);
}

body.dark .faq-modal {
    background: #1e293b;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
}

body.dark .faq-modal-body::-webkit-scrollbar-thumb { background: #2d3f5a; }
body.dark .faq-modal-body::-webkit-scrollbar-thumb:hover { background: #ffa726; }

body.dark .example-card {
    background: #0f172a;
    border-color: #2d3f5a;
}

body.dark .example-card:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

body.dark .example-card-topic {
    color: #60a5fa;
}

body.dark .example-card-badge {
    background: rgba(59, 130, 246, 0.14);
    color: #60a5fa;
}

body.dark .example-card-desc { color: #475569; }

/* ---- 新增元素暗黑覆盖 ---- */
body.dark .result-count-badge {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
}

body.dark .faq-clear-btn { color: #334155; }
body.dark .faq-clear-btn:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

body.dark .placeholder-shortcut { color: #334155; }
body.dark .placeholder-shortcut kbd {
    background: #1e293b;
    border-color: #2d3f5a;
    color: #60a5fa;
}

body.dark .error-retry-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

body.dark .error-retry-btn:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

body.dark .faq-generate-btn.faq-inline-loading {
    background: linear-gradient(90deg, #1e3a5f 0%, #2563eb 35%, #1e3a5f 65%, #1e293b 100%);
    background-size: 200% 100%;
}

/* =============================================
   打印样式
   ============================================= */
@media print {
    .faq-toolbar,
    .faq-history-panel,
    .faq-input-panel,
    #faqResultPlaceholder,
    #faqResultLoading,
    #faqResultError,
    .faq-modal-overlay,
    .faq-modal,
    #faqToast {
        display: none !important;
    }

    .faq-container {
        height: auto !important;
        min-height: unset !important;
        box-shadow: none !important;
        background: transparent !important;
        position: static !important;
        border-radius: 0 !important;
    }

    .faq-main-content {
        overflow: visible !important;
    }

    .faq-result-panel {
        overflow: visible !important;
    }

    .faq-result-header {
        background: transparent !important;
        border-bottom: 1px solid #ccc !important;
        margin-bottom: 12px;
        padding: 0 0 8px !important;
    }

    .faq-result-body {
        overflow: visible !important;
        padding: 0 !important;
    }

    #faqResultContent {
        display: block !important;
    }

    .result-content .faq-result-list {
        gap: 10px !important;
    }

    .result-content .faq-result-item {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        border-left: 3px solid #1565c0 !important;
    }

    .result-content .faq-q {
        background: #f5f5f5 !important;
    }
}
