/* =============================================
   神回复生成器 - brilliant_replies.css
   暖橙对话气泡主题，三栏布局
   暗黑模式全部以 body.dark 作为 CSS 父级选择器前缀
   ============================================= */

/* ========== 主容器 ========== */
.br-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #fff8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.br-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;
}

/* ========== 顶部工具栏（暖橙主题） ========== */
.br-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 50%, #c2410c 100%);
    color: #fff;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 12px rgba(249, 115, 22, 0.4);
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.br-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.8px;
    margin-right: 8px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.toolbar-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #c2410c;
    transition: all 0.2s;
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.toolbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 主操作按钮（生成神回复）- 鲜亮黄绿色，与橙色工具栏形成对比 */
.toolbar-btn-primary {
    background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%);
    color: #7c2d12;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #fde047 0%, #facc15 100%);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.55);
    color: #7c2d12;
}

/* 取消按钮 */
.toolbar-btn-cancel {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.toolbar-btn-cancel:hover:not(:disabled) {
    background: #ef4444;
    color: #fff;
}

/* ========== 抖动动画 ========== */
@keyframes br-shake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-5px); }
    30%, 70% { transform: translateX(5px); }
}

.br-textarea.shake {
    animation: br-shake 0.5s ease-in-out;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

/* ========== 主内容区：三栏 ========== */
.br-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========== 左栏：历史记录 ========== */
.br-history-panel {
    width: 200px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
    border-bottom: 1px solid #e2e8f0;
    border-left: 3px solid #f97316;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.history-count {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: #f97316;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 5px;
    vertical-align: middle;
    line-height: 1.6;
    letter-spacing: 0.3px;
}

.history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 3px;
    transition: background 0.2s;
}

.history-clear-btn:hover { background: #fde8e8; }

.history-search {
    padding: 8px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
    background: #fafafa;
}

.history-search input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
    background: #fff;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list:hover::-webkit-scrollbar-track { background: #fff3e0; }
.history-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }
.history-list::-webkit-scrollbar-thumb:hover { background: #f97316; }

.history-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    padding: 24px 8px;
    user-select: none;
}

.history-item {
    display: flex;
    flex-direction: column;
    padding: 9px 11px;
    margin: 3px 0;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: br-hi-fadein 0.2s ease;
}

@keyframes br-hi-fadein {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: translateX(0); }
}

.history-item:hover {
    background: #fff7ed;
    border-color: #fed7aa;
    transform: translateX(2px);
}

.history-item.active {
    background: #fff7ed;
    border-color: #f97316;
    border-left-color: #ea580c;
    box-shadow: 0 1px 3px rgba(249, 115, 22, 0.18);
}

.history-item::after {
    content: '';
    position: absolute;
    right: 0;
    top: 10%;
    height: 80%;
    width: 0;
    background: #facc15;
    border-radius: 2px 0 0 2px;
    transition: width 0.2s ease;
    pointer-events: none;
}
.history-item:hover::after { width: 3px; }

.history-item-del {
    position: absolute;
    top: 4px; right: 4px;
    width: 18px; height: 18px;
    background: #fde8e8;
    color: #ef4444;
    border: none;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.history-item:hover .history-item-del { opacity: 1; }
.history-item-del:hover { background: #ef4444; color: #fff; }

.history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 22px;
    margin-bottom: 2px;
}

.history-item-meta {
    font-size: 10px;
    color: #ea580c;
    margin-bottom: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-time {
    font-size: 10px;
    color: #94a3b8;
}

/* ========== 中栏：表单输入 ========== */
.br-input-panel {
    width: 340px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.br-input-panel > .panel-header {
    border-left: 3px solid #f97316;
}

/* ========== 右栏：结果展示 ========== */
.br-result-panel {
    flex: 1;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 320px;
}

.br-result-panel > .panel-header {
    border-left: 3px solid #ea580c;
}

/* ========== 通用面板头部 ========== */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    padding: 12px 16px;
    min-height: 44px;
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.panel-tip {
    font-size: 11px;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 1;
    overflow: hidden;
}

.result-meta-badge {
    font-size: 11px;
    color: #c2410c;
    background: #fff7ed;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-count-badge {
    font-size: 11px;
    color: #15803d;
    background: #f0fdf4;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.result-time {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ========== 表单区域 ========== */
.br-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.br-input-body::-webkit-scrollbar { width: 4px; }
.br-input-body::-webkit-scrollbar-track { background: transparent; }
.br-input-body:hover::-webkit-scrollbar-track { background: #fff3e0; }
.br-input-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }
.br-input-body::-webkit-scrollbar-thumb:hover { background: #f97316; }

.form-group { margin-bottom: 14px; }

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}

.required-mark { color: #ef4444; margin-left: 2px; }
.label-tip { font-size: 11px; font-weight: 400; color: #9ca3af; }

.br-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 13px;
    color: #374151;
    background: #fafafa;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    max-height: 160px;
    line-height: 1.6;
}

.br-textarea:focus {
    border-color: #f97316;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.br-textarea:hover:not(:focus) {
    border-color: #fed7aa;
    background: #fff;
}

.br-textarea::placeholder { color: #b0b7c3; }

.char-count {
    text-align: right;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 3px;
    user-select: none;
}

.br-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 13px;
    color: #374151;
    background: #fafafa;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239ca3af'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.br-select:focus {
    border-color: #f97316;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.br-select:hover:not(:focus) {
    border-color: #fed7aa;
    background-color: #fff;
}

.form-row { display: flex; gap: 10px; }
.form-group-half { flex: 1; min-width: 0; }

/* 快速场景标签 */
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.scene-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.18s;
    user-select: none;
}

.scene-tag:hover {
    background: #f97316;
    color: #fff;
    border-color: #f97316;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.35);
}

.scene-tag.active {
    background: #f97316;
    color: #fff;
    border-color: #f97316;
}

.shortcut-hint {
    font-size: 11px;
    color: #b0b7c3;
    text-align: center;
    padding: 8px 0 8px;
    border-top: 1px dashed #e5e7eb;
    margin-top: 10px;
    user-select: none;
}

/* ========== 结果内容区域 ========== */
.br-result-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fafafa;
}

.br-result-body::-webkit-scrollbar { width: 5px; }
.br-result-body::-webkit-scrollbar-track { background: transparent; }
.br-result-body:hover::-webkit-scrollbar-track { background: #fff3e0; }
.br-result-body::-webkit-scrollbar-thumb { background: #fed7aa; border-radius: 3px; }
.br-result-body::-webkit-scrollbar-thumb:hover { background: #f97316; }

/* ========== 占位提示 ========== */
.result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    user-select: none;
}

.placeholder-icon {
    font-size: 52px;
    margin-bottom: 16px;
    opacity: 0.45;
    animation: br-float 3.5s ease-in-out infinite;
}

@keyframes br-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.placeholder-title {
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    margin: 0 0 8px;
}

.placeholder-desc {
    font-size: 13px;
    color: #94a3b8;
    margin: 4px 0;
    line-height: 1.6;
}

/* ========== 加载动画 ========== */
.result-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.loading-bubble {
    font-size: 42px;
    margin-bottom: 14px;
    animation: br-bubble-bounce 1.2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.5));
}

@keyframes br-bubble-bounce {
    0%, 100% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.15) translateY(-6px); }
}

.loading-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.loading-dots span {
    width: 9px; height: 9px;
    background: #f97316;
    border-radius: 50%;
    animation: br-dot-pulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; background: #facc15; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; background: #ef4444; }

@keyframes br-dot-pulse {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40% { transform: scale(1.1); opacity: 1; }
}

.loading-text {
    font-size: 13px;
    color: #ea580c;
    margin: 0;
    font-weight: 500;
}

/* ========== 结果内容 ========== */
.result-content {
    flex: 1;
    padding: 16px;
    animation: br-result-fadein 0.4s ease;
    min-height: 0;
}

/* 重置浏览器默认 blockquote margin，防止 AI 输出内容缩进异常 */
.result-content blockquote {
    margin: 0;
    padding: 0;
}

@keyframes br-result-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ========== 神回复卡片（对话气泡风格） ========== */
.reply-cards-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.reply-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #f97316;
    border-radius: 10px;
    padding: 14px 16px;
    position: relative;
    transition: all 0.2s;
    animation: br-card-in 0.3s ease both;
    overflow: hidden;
}

/* 气泡装饰引号水印 */
.reply-card::after {
    content: '\201D';
    position: absolute;
    bottom: -4px;
    right: 12px;
    font-size: 64px;
    font-family: Georgia, 'Times New Roman', serif;
    color: rgba(249, 115, 22, 0.06);
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.reply-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.09), 0 0 0 1px rgba(249, 115, 22, 0.12);
    transform: translateX(3px);
    z-index: 1;
}

@keyframes br-card-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.reply-card:nth-child(1)  { animation-delay: 0.05s; }
.reply-card:nth-child(2)  { animation-delay: 0.10s; }
.reply-card:nth-child(3)  { animation-delay: 0.15s; }
.reply-card:nth-child(4)  { animation-delay: 0.20s; }
.reply-card:nth-child(5)  { animation-delay: 0.25s; }
.reply-card:nth-child(6)  { animation-delay: 0.30s; }
.reply-card:nth-child(7)  { animation-delay: 0.35s; }
.reply-card:nth-child(8)  { animation-delay: 0.40s; }
.reply-card:nth-child(n+9) { animation-delay: 0.45s; }

.reply-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.reply-index {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #f97316;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    padding: 0 5px;
    line-height: 1;
}

.reply-main-text {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.65;
    flex: 1;
    word-break: break-word;
}

.reply-wit {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 10px;
    background: #fff7ed;
    border-radius: 6px;
    border: 1px solid #fed7aa;
    margin-top: 4px;
}

.wit-icon {
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 1px;
}

.wit-text {
    font-size: 12px;
    color: #9a3412;
    line-height: 1.6;
    flex: 1;
    font-style: italic;
}

.wit-text::before {
    content: '妙处：';
    font-style: normal;
    font-weight: 700;
    color: #ea580c;
}

/* 回复卡片行内标记样式 */
.reply-main-text strong,
.wit-text strong { font-weight: 700; }

.reply-main-text code,
.wit-text code {
    background: #fff7ed;
    color: #c2410c;
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.88em;
    font-style: normal;
}

.copy-reply-btn {
    position: absolute;
    top: 10px; right: 10px;
    width: 24px; height: 24px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    color: #f97316;
    padding: 0;
}

.reply-card:hover .copy-reply-btn { opacity: 1; }
.copy-reply-btn:hover { background: #f97316; color: #fff; border-color: #f97316; }

/* 错误块 */
.result-content.result-content--error {
    border-left: none;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.result-error-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    flex: 1;
}

.result-error-icon { font-size: 40px; margin-bottom: 14px; color: #f87171; }
.result-error-title { font-size: 14px; font-weight: 600; color: #dc2626; margin: 0 0 8px; }
.result-error-hint { font-size: 12px; color: #9ca3af; margin: 0 0 16px; }

.result-error-retry {
    padding: 8px 22px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.35);
}

.result-error-retry:hover {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.45);
    transform: translateY(-1px);
}

/* ========== 示例模态框 ========== */
.br-modal-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    backdrop-filter: blur(2px);
}

.br-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100001;
    width: 90%; max-width: 700px;
    max-height: 80vh;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: br-modal-in 0.22s ease-out;
}

@keyframes br-modal-in {
    from { opacity: 0; transform: translate(-50%, calc(-50% - 16px)); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

.br-modal-content { display: flex; flex-direction: column; flex: 1; overflow: hidden; }

.br-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 50%, #c2410c 100%);
    color: #fff;
}

.br-modal-header h3 { margin: 0; font-size: 15px; font-weight: 600; color: #fff; }

.br-modal-close {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    width: 28px; height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}

.br-modal-close:hover { background: rgba(255, 255, 255, 0.35); }

.br-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    align-content: start;
}

.br-modal-body::-webkit-scrollbar { width: 4px; }
.br-modal-body::-webkit-scrollbar-track { background: transparent; }
.br-modal-body:hover::-webkit-scrollbar-track { background: #fff3e0; }
.br-modal-body::-webkit-scrollbar-thumb { background: #fed7aa; border-radius: 2px; }
.br-modal-body::-webkit-scrollbar-thumb:hover { background: #f97316; }

/* 示例卡片 */
.example-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
    position: relative;
    overflow: hidden;
}

.example-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(135deg, #f97316, #facc15);
    opacity: 0;
    transition: opacity 0.2s;
}

.example-card:hover {
    border-color: #fed7aa;
    background: #fff7ed;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.12);
}

.example-card:hover::before { opacity: 1; }

.example-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.example-card-badge {
    font-size: 10px;
    font-weight: 500;
    background: #fff7ed;
    color: #c2410c;
    padding: 1px 6px;
    border-radius: 10px;
    white-space: nowrap;
    border: 1px solid #fed7aa;
}

.example-card-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 10px;
}

.example-card-import {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #c2410c;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 4px;
    padding: 3px 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-card-import:hover { background: #f97316; color: #fff; border-color: #f97316; }

/* 移动端：复制按钮常显 */
@media (max-width: 768px) {
    .copy-reply-btn { opacity: 1 !important; }
}

/* ========== 响应式布局 ========== */
@media (max-width: 1024px) {
    .br-input-panel { width: 280px; }
    .panel-tip { display: none; }
}

@media (max-width: 768px) {
    .br-main-content { flex-direction: column; overflow-y: auto; }
    .br-history-panel { width: 100%; max-height: 150px; border-right: none; border-bottom: 1px solid #e2e8f0; }
    .br-input-panel { width: 100%; border-right: none; border-bottom: 1px solid #e2e8f0; max-height: 400px; }
    .br-result-panel { width: 100%; min-height: 300px; }
    .form-row { flex-direction: column; }
    .br-modal-body { grid-template-columns: 1fr; }
}

/* ========== 暗黑模式（全部以 body.dark 为父级前缀） ========== */
body.dark .br-container {
    background: #0f172a;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

body.dark .br-toolbar {
    background: linear-gradient(135deg, #7c2d12 0%, #9a3412 50%, #c2410c 100%);
    border-bottom-color: rgba(251, 191, 36, 0.2);
    box-shadow: 0 2px 12px rgba(124, 45, 18, 0.5);
}

body.dark .br-toolbar .toolbar-title { color: #fde68a; text-shadow: 0 1px 3px rgba(0,0,0,0.4); }

body.dark .toolbar-btn {
    background: rgba(15, 23, 42, 0.85);
    color: #fde68a;
    border: 1px solid rgba(251, 191, 36, 0.25);
}

body.dark .toolbar-btn:hover:not(:disabled) {
    background: rgba(30, 41, 59, 0.95);
    color: #fef3c7;
    border-color: rgba(251, 191, 36, 0.45);
}

body.dark .toolbar-btn-primary {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #fef9c3;
    border: none;
    box-shadow: 0 2px 8px rgba(180, 83, 9, 0.45);
}

body.dark .toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(180, 83, 9, 0.55);
}

body.dark .toolbar-btn-cancel {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

body.dark .toolbar-btn-cancel:hover:not(:disabled) {
    background: #dc2626;
    color: #fff;
}

body.dark .br-history-panel {
    background: #1e293b;
    border-right-color: #334155;
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, #1e293b, #182032);
    border-bottom-color: #334155;
    border-left-color: #c2410c;
}

body.dark .history-panel-header h3 { color: #94a3b8; }

body.dark .history-count { background: #d97706; }

body.dark .history-clear-btn { background: #3f1f1f; color: #f87171; }
body.dark .history-clear-btn:hover { background: #5a1f1f; }

body.dark .history-search input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark .history-search input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
    background: #1e293b;
}

body.dark .history-search input::placeholder { color: #475569; }

body.dark .history-list { background: #1e293b; }

body.dark .history-empty { color: #475569; }

body.dark .history-item {
    background: #172035;
    border-color: #334155;
}

body.dark .history-item:hover {
    background: #1c2c45;
    border-color: #c2410c;
}

body.dark .history-item.active {
    background: #1c2c45;
    border-color: #f97316;
    border-left-color: #ea580c;
    box-shadow: 0 1px 3px rgba(249, 115, 22, 0.2);
}

body.dark .history-item-title { color: #e2e8f0; }
body.dark .history-item-meta { color: #fb923c; }
body.dark .history-item-time { color: #475569; }

body.dark .history-item-del {
    background: #3f1f1f;
    color: #f87171;
}

body.dark .history-item-del:hover { background: #dc2626; color: #fff; }

body.dark .br-input-panel {
    background: #1e293b;
    border-right-color: #334155;
}

body.dark .panel-header {
    background: linear-gradient(to bottom, #1e293b, #182032);
    border-bottom-color: #334155;
}

body.dark .panel-header h3 { color: #94a3b8; }

body.dark .panel-tip { color: #475569; }

body.dark .br-input-body::-webkit-scrollbar-thumb { background: #374151; }
body.dark .br-input-body::-webkit-scrollbar-thumb:hover { background: #f97316; }

body.dark .form-group label { color: #94a3b8; }
body.dark .label-tip { color: #475569; }

body.dark .br-textarea {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark .br-textarea:focus {
    border-color: #f97316;
    background: #1e293b;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

body.dark .br-textarea:hover:not(:focus) {
    border-color: #7c2d12;
    background: #182032;
}

body.dark .br-textarea::placeholder { color: #475569; }

body.dark .br-select {
    background-color: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23475569'/%3E%3C/svg%3E");
}

body.dark .br-select:focus {
    border-color: #f97316;
    background-color: #1e293b;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

body.dark .br-select:hover:not(:focus) {
    border-color: #7c2d12;
    background-color: #182032;
}

body.dark .br-select option { background: #1e293b; color: #e2e8f0; }

body.dark .scene-tag {
    background: #1c2c45;
    color: #fb923c;
    border-color: #7c2d12;
}

body.dark .scene-tag:hover,
body.dark .scene-tag.active {
    background: #c2410c;
    color: #fff;
    border-color: #c2410c;
}

body.dark .shortcut-hint { color: #475569; border-top-color: #334155; }

body.dark .br-result-panel { background: #1e293b; }

body.dark .br-result-body { background: #182032; }

body.dark .br-result-body::-webkit-scrollbar-thumb { background: #7c2d12; }
body.dark .br-result-body::-webkit-scrollbar-thumb:hover { background: #f97316; }

body.dark .placeholder-title { color: #94a3b8; }
body.dark .placeholder-desc { color: #4b5563; }

body.dark .loading-text { color: #fb923c; }

body.dark .result-meta-badge { color: #fb923c; background: #1c2c45; }
body.dark .result-count-badge { color: #4ade80; background: #162030; }
body.dark .result-time { color: #475569; }

body.dark .result-content { background: #182032; }

body.dark .reply-card {
    background: #1e293b;
    border-color: #334155;
    border-left-color: #ea580c;
}

body.dark .reply-card:hover {
    background: #1c2c45;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark .reply-main-text { color: #f1f5f9; }

body.dark .reply-wit {
    background: #1c2030;
    border-color: #7c2d12;
}

body.dark .wit-text { color: #fbbf24; }
body.dark .wit-text::before { color: #fb923c; }

body.dark .reply-main-text code,
body.dark .wit-text code {
    background: #1c2c45;
    color: #fb923c;
}

body.dark .copy-reply-btn {
    background: #1c2c45;
    border-color: #7c2d12;
    color: #fb923c;
}

body.dark .copy-reply-btn:hover { background: #c2410c; color: #fff; border-color: #c2410c; }

body.dark .result-error-title { color: #f87171; }
body.dark .result-error-hint { color: #475569; }
body.dark .result-error-retry {
    background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
    color: #fef3c7;
    box-shadow: 0 2px 8px rgba(180, 83, 9, 0.35);
}
body.dark .result-error-retry:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.5);
    transform: translateY(-1px);
}

body.dark .char-count { color: #475569; }

body.dark .br-input-panel > .panel-header {
    border-left-color: #c2410c;
}

body.dark .br-result-panel > .panel-header {
    border-left-color: #b45309;
}

body.dark .br-modal { background: #1e293b; }

body.dark .br-modal-header {
    background: linear-gradient(135deg, #7c2d12 0%, #9a3412 50%, #c2410c 100%);
}

body.dark .br-modal-body { background: #1e293b; }

body.dark .example-card {
    background: #182032;
    border-color: #334155;
}

body.dark .example-card:hover {
    background: #1c2c45;
    border-color: #c2410c;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.15);
}

body.dark .example-card-title { color: #e2e8f0; }

body.dark .example-card-badge {
    background: #1c2c45;
    color: #fb923c;
    border-color: #7c2d12;
}

body.dark .example-card-desc { color: #64748b; }

body.dark .example-card-import {
    background: #1c2c45;
    color: #fb923c;
    border-color: #7c2d12;
}

body.dark .example-card-import:hover { background: #c2410c; color: #fff; border-color: #c2410c; }
