/* =============================================
   回复老板 - reply_to_boss.css
   职场深蓝专业主题，三栏布局
   暗黑模式全部以 body.dark 作为 CSS 父级选择器前缀
   ============================================= */

/* ========== 主容器 ========== */
.rtb-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f0f4ff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.rtb-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;
}

/* ========== 顶部工具栏（深蓝主题） ========== */
.rtb-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 50%, #1e3a8a 100%);
    color: #fff;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 12px rgba(30, 64, 175, 0.4);
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
}

.rtb-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: #1e40af;
    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, #fbbf24 0%, #f59e0b 100%);
    color: #1e3a8a;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.45);
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #fde68a 0%, #fbbf24 100%);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.55);
    color: #1e3a8a;
}

/* 取消按钮 */
.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 rtb-shake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-5px); }
    30%, 70% { transform: translateX(5px); }
}

.rtb-textarea.shake {
    animation: rtb-shake 0.5s ease-in-out;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

/* ========== 主内容区：三栏 ========== */
.rtb-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========== 左栏：历史记录 ========== */
.rtb-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 #2563eb;
    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: #2563eb;
    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: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 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: #eff6ff; }
.history-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }
.history-list::-webkit-scrollbar-thumb:hover { background: #2563eb; }

.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: rtb-hi-fadein 0.2s ease;
}

@keyframes rtb-hi-fadein {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: translateX(0); }
}

.history-item:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    transform: translateX(2px);
}

.history-item.active {
    background: #eff6ff;
    border-color: #2563eb;
    border-left-color: #1d4ed8;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.18);
}

.history-item::after {
    content: '';
    position: absolute;
    right: 0;
    top: 10%;
    height: 80%;
    width: 0;
    background: #fbbf24;
    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: #1d4ed8;
    margin-bottom: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-time {
    font-size: 10px;
    color: #94a3b8;
}

/* ========== 中栏：表单输入 ========== */
.rtb-input-panel {
    width: 340px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rtb-input-panel > .panel-header {
    border-left: 3px solid #2563eb;
}

/* ========== 右栏：结果展示 ========== */
.rtb-result-panel {
    flex: 1;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 320px;
}

.rtb-result-panel > .panel-header {
    border-left: 3px solid #1d4ed8;
}

/* ========== 通用面板头部 ========== */
.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: #1e40af;
    background: #eff6ff;
    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;
}

/* ========== 表单区域 ========== */
.rtb-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.rtb-input-body::-webkit-scrollbar { width: 4px; }
.rtb-input-body::-webkit-scrollbar-track { background: transparent; }
.rtb-input-body:hover::-webkit-scrollbar-track { background: #eff6ff; }
.rtb-input-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }
.rtb-input-body::-webkit-scrollbar-thumb:hover { background: #2563eb; }

.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; }

.rtb-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;
}

.rtb-textarea:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.rtb-textarea:hover:not(:focus) {
    border-color: #bfdbfe;
    background: #fff;
}

.rtb-textarea::placeholder { color: #b0b7c3; }

.char-count {
    text-align: right;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 3px;
    user-select: none;
}

.rtb-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;
}

.rtb-select:focus {
    border-color: #2563eb;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.rtb-select:hover:not(:focus) {
    border-color: #bfdbfe;
    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: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.18s;
    user-select: none;
}

.scene-tag:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.scene-tag.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.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;
}

/* ========== 结果内容区域 ========== */
.rtb-result-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
}

.rtb-result-body::-webkit-scrollbar { width: 5px; }
.rtb-result-body::-webkit-scrollbar-track { background: transparent; }
.rtb-result-body:hover::-webkit-scrollbar-track { background: #eff6ff; }
.rtb-result-body::-webkit-scrollbar-thumb { background: #bfdbfe; border-radius: 3px; }
.rtb-result-body::-webkit-scrollbar-thumb:hover { background: #2563eb; }

/* ========== 占位提示 ========== */
.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: rtb-float 3.5s ease-in-out infinite;
}

@keyframes rtb-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: rtb-bubble-bounce 1.2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.4));
}

@keyframes rtb-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: #2563eb;
    border-radius: 50%;
    animation: rtb-dot-pulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; background: #fbbf24; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; background: #3b82f6; }

@keyframes rtb-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: #1d4ed8;
    margin: 0;
    font-weight: 500;
}

/* ========== 加载进度条 ========== */
#rtbProgressBar {
    position: absolute;
    bottom: 0; left: 0;
    height: 3px;
    background: linear-gradient(90deg, #fde68a 0%, #fbbf24 50%, #f59e0b 100%);
    border-radius: 0 2px 2px 0;
    z-index: 10;
    display: none;
    pointer-events: none;
}

body.dark #rtbProgressBar {
    background: linear-gradient(90deg, #fde68a 0%, #fbbf24 50%, #f59e0b 100%);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.55);
}

/* 进度条完成态：绿→青渐变 + brightness 闪烁动效 */
#rtbProgressBar.complete {
    background: linear-gradient(90deg, #22c55e 0%, #06b6d4 100%) !important;
    animation: bt-progress-pulse 0.4s ease 2;
}

@keyframes bt-progress-pulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.5); }
}

body.dark #rtbProgressBar.complete {
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.6) !important;
}

/* ========== 结果内容 ========== */
.result-content {
    flex: 1;
    padding: 16px;
    animation: rtb-result-fadein 0.4s ease;
    min-height: 0;
}

.result-content blockquote {
    margin: 0;
    padding: 0;
}

@keyframes rtb-result-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ========== 回复卡片（职场消息气泡风格） ========== */
.reply-cards-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* 老板消息预览卡 */
.boss-message-preview {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #94a3b8;
    border-radius: 8px;
    margin-bottom: 4px;
}

.boss-avatar {
    font-size: 20px;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.boss-message-text {
    font-size: 12px;
    color: #64748b;
    line-height: 1.6;
    flex: 1;
    font-style: italic;
}

.boss-message-label {
    font-size: 10px;
    color: #94a3b8;
    margin-bottom: 3px;
    font-style: normal;
}

.reply-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #2563eb;
    border-radius: 10px;
    padding: 14px 16px;
    position: relative;
    transition: all 0.2s;
    animation: rtb-card-in 0.3s ease both;
    overflow: hidden;
    cursor: pointer;
}

/* 点击卡片复制反馈动效 */
.reply-card.copied {
    background: #eff6ff !important;
    border-color: #93c5fd !important;
    transition: background 0.12s ease, border-color 0.12s ease;
}

/* 职场引号水印 */
.reply-card::after {
    content: '\201D';
    position: absolute;
    bottom: -4px;
    right: 12px;
    font-size: 64px;
    font-family: Georgia, 'Times New Roman', serif;
    color: rgba(37, 99, 235, 0.05);
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.reply-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(37, 99, 235, 0.12);
    transform: translateX(3px);
    z-index: 1;
}

@keyframes rtb-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: #2563eb;
    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: 14px;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.7;
    flex: 1;
    word-break: break-word;
}

.reply-analysis {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 10px;
    background: #eff6ff;
    border-radius: 6px;
    border: 1px solid #bfdbfe;
    margin-top: 4px;
}

.analysis-icon {
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 1px;
}

.analysis-text {
    font-size: 12px;
    color: #1e40af;
    line-height: 1.6;
    flex: 1;
    font-style: italic;
}

.analysis-text::before {
    content: '分析：';
    font-style: normal;
    font-weight: 700;
    color: #1d4ed8;
}

.reply-main-text strong,
.analysis-text strong { font-weight: 700; }

.reply-main-text code,
.analysis-text code {
    background: #eff6ff;
    color: #1e40af;
    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: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    color: #2563eb;
    padding: 0;
}

.reply-card:hover .copy-reply-btn { opacity: 1; }
.copy-reply-btn:hover { background: #2563eb; color: #fff; border-color: #2563eb; }

/* 错误块 */
.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, #2563eb 0%, #1d4ed8 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(37, 99, 235, 0.35);
}

.result-error-retry:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
    transform: translateY(-1px);
}

/* ========== 示例模态框 ========== */
.rtb-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);
}

.rtb-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: rtb-modal-in 0.22s ease-out;
}

@keyframes rtb-modal-in {
    from { opacity: 0; transform: translate(-50%, calc(-50% - 16px)); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

.rtb-modal-content { display: flex; flex-direction: column; flex: 1; overflow: hidden; }

.rtb-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, #1e40af 0%, #1d4ed8 50%, #1e3a8a 100%);
    color: #fff;
}

.rtb-modal-header h3 { margin: 0; font-size: 15px; font-weight: 600; color: #fff; }

.rtb-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;
}

.rtb-modal-close:hover { background: rgba(255, 255, 255, 0.35); }

.rtb-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;
}

.rtb-modal-body::-webkit-scrollbar { width: 4px; }
.rtb-modal-body::-webkit-scrollbar-track { background: transparent; }
.rtb-modal-body:hover::-webkit-scrollbar-track { background: #eff6ff; }
.rtb-modal-body::-webkit-scrollbar-thumb { background: #bfdbfe; border-radius: 2px; }
.rtb-modal-body::-webkit-scrollbar-thumb:hover { background: #2563eb; }

.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, #2563eb, #fbbf24);
    opacity: 0;
    transition: opacity 0.2s;
}

.example-card:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

.example-card:hover::before { opacity: 1; }

.example-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.example-card-badge {
    font-size: 11px;
    font-weight: 500;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 1px 7px;
    border-radius: 8px;
}

.example-card-desc {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 10px;
    line-height: 1.5;
}

.example-card-import {
    font-size: 12px;
    padding: 5px 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.example-card-import:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

/* ========== 响应式布局 ========== */
@media (max-width: 900px) {
    .rtb-history-panel { display: none; }
    .rtb-input-panel { width: 280px; }
}

@media (max-width: 600px) {
    .rtb-main-content { flex-direction: column; }
    .rtb-input-panel { width: 100%; border-right: none; border-bottom: 1px solid #e2e8f0; max-height: 50vh; }
    .rtb-result-panel { min-width: unset; }
    .rtb-toolbar { gap: 4px; padding: 6px 10px; }
    .toolbar-btn { padding: 5px 8px; font-size: 11px; }
}

/* =============================================
   暗黑模式 - 所有规则使用 body.dark 前缀
   ============================================= */

body.dark .rtb-container {
    background: #0f172a;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

body.dark .rtb-toolbar {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #172554 100%);
    box-shadow: 0 2px 12px rgba(30, 58, 138, 0.5);
}

body.dark .toolbar-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #bfdbfe;
}

body.dark .toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

body.dark .toolbar-btn-primary {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1e3a8a;
}

body.dark .toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #fde68a 0%, #fbbf24 100%);
    color: #1e3a8a;
}

body.dark .toolbar-btn-cancel {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.4);
}

body.dark .rtb-history-panel {
    background: #1e293b;
    border-right-color: #334155;
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, #1e293b, #0f172a);
    border-bottom-color: #334155;
    border-left-color: #3b82f6;
}

body.dark .history-panel-header h3 { color: #94a3b8; }

body.dark .history-count { background: #3b82f6; }

body.dark .history-clear-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

body.dark .history-clear-btn:hover { background: rgba(239, 68, 68, 0.3); }

body.dark .history-search input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark .history-search input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    background: #1e293b;
}

body.dark .history-search input::placeholder { color: #475569; }

body.dark .history-list::-webkit-scrollbar-track { background: #1e293b; }
body.dark .history-list:hover::-webkit-scrollbar-track { background: #1e293b; }
body.dark .history-list::-webkit-scrollbar-thumb { background: #334155; }
body.dark .history-list::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

body.dark .history-empty { color: #475569; }

body.dark .history-item {
    background: #0f172a;
    border-color: #334155;
}

body.dark .history-item:hover {
    background: #1e293b;
    border-color: #475569;
}

body.dark .history-item.active {
    background: rgba(37, 99, 235, 0.15);
    border-color: #3b82f6;
}

body.dark .history-item-title { color: #e2e8f0; }
body.dark .history-item-meta { color: #60a5fa; }
body.dark .history-item-time { color: #64748b; }

body.dark .history-item-del {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

body.dark .history-item-del:hover { background: #dc2626; color: #fff; }

body.dark .rtb-input-panel {
    background: #1e293b;
    border-right-color: #334155;
}

body.dark .rtb-input-panel > .panel-header {
    border-left-color: #3b82f6;
}

body.dark .rtb-result-panel {
    background: #1e293b;
}

body.dark .rtb-result-panel > .panel-header {
    border-left-color: #2563eb;
}

body.dark .panel-header {
    background: linear-gradient(to bottom, #1e293b, #0f172a);
    border-bottom-color: #334155;
}

body.dark .panel-header h3 { color: #94a3b8; }
body.dark .panel-tip { color: #64748b; }

body.dark .result-meta-badge {
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.2);
}

body.dark .result-count-badge {
    color: #86efac;
    background: rgba(21, 128, 61, 0.2);
}

body.dark .result-time { color: #64748b; }

body.dark .rtb-input-body::-webkit-scrollbar-track { background: #1e293b; }
body.dark .rtb-input-body:hover::-webkit-scrollbar-track { background: #1e293b; }
body.dark .rtb-input-body::-webkit-scrollbar-thumb { background: #334155; }
body.dark .rtb-input-body::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

body.dark .form-group label { color: #cbd5e1; }
body.dark .required-mark { color: #fca5a5; }
body.dark .label-tip { color: #64748b; }

body.dark .rtb-textarea {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark .rtb-textarea:focus {
    border-color: #3b82f6;
    background: #1e293b;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

body.dark .rtb-textarea:hover:not(:focus) {
    border-color: #475569;
    background: #1e293b;
}

body.dark .rtb-textarea::placeholder { color: #475569; }

body.dark .char-count { color: #475569; }

body.dark .rtb-select {
    background-color: #0f172a;
    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='%2364748b'/%3E%3C/svg%3E");
    border-color: #334155;
    color: #e2e8f0;
}

body.dark .rtb-select:focus {
    border-color: #3b82f6;
    background-color: #1e293b;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

body.dark .rtb-select:hover:not(:focus) {
    border-color: #475569;
    background-color: #1e293b;
}

body.dark .rtb-select option { background: #1e293b; color: #e2e8f0; }

body.dark .scene-tag {
    background: rgba(37, 99, 235, 0.15);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.3);
}

body.dark .scene-tag:hover,
body.dark .scene-tag.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

body.dark .shortcut-hint { color: #475569; border-top-color: #334155; }

body.dark .rtb-result-body {
    background: #0f172a;
}

body.dark .rtb-result-body::-webkit-scrollbar-track { background: #0f172a; }
body.dark .rtb-result-body:hover::-webkit-scrollbar-track { background: #0f172a; }
body.dark .rtb-result-body::-webkit-scrollbar-thumb { background: rgba(37, 99, 235, 0.4); }
body.dark .rtb-result-body::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

body.dark .placeholder-title { color: #94a3b8; }
body.dark .placeholder-desc { color: #64748b; }

body.dark .loading-bubble { filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.4)); }
body.dark .loading-dots span { background: #3b82f6; }
body.dark .loading-dots span:nth-child(2) { background: #fbbf24; }
body.dark .loading-text { color: #60a5fa; }

body.dark .result-content { background: transparent; }

body.dark .boss-message-preview {
    background: #0f172a;
    border-color: #334155;
    border-left-color: #475569;
}

body.dark .boss-avatar { background: #334155; }
body.dark .boss-message-text { color: #64748b; }
body.dark .boss-message-label { color: #475569; }

body.dark .reply-card {
    background: #1e293b;
    border-color: #334155;
    border-left-color: #3b82f6;
}

body.dark .reply-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(59, 130, 246, 0.2);
}

body.dark .reply-card.copied {
    background: rgba(37, 99, 235, 0.22) !important;
    border-color: rgba(59, 130, 246, 0.55) !important;
}

body.dark .reply-card::after {
    color: rgba(59, 130, 246, 0.07);
}

body.dark .reply-index { background: #3b82f6; }

body.dark .reply-main-text { color: #e2e8f0; }

body.dark .reply-analysis {
    background: rgba(30, 64, 175, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
}

body.dark .analysis-text { color: #93c5fd; }
body.dark .analysis-text::before { color: #60a5fa; }

body.dark .reply-main-text code,
body.dark .analysis-text code {
    background: rgba(37, 99, 235, 0.2);
    color: #93c5fd;
}

body.dark .copy-reply-btn {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

body.dark .copy-reply-btn:hover { background: #2563eb; color: #fff; border-color: #2563eb; }

body.dark .result-error-icon { color: #fca5a5; }
body.dark .result-error-title { color: #fca5a5; }
body.dark .result-error-hint { color: #475569; }

body.dark .result-error-retry {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.4);
}

body.dark .result-error-retry:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.55);
    transform: translateY(-1px);
}

body.dark .rtb-modal {
    background: #1e293b;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

body.dark .rtb-modal-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #172554 100%);
}

body.dark .rtb-modal-body { background: #1e293b; }
body.dark .rtb-modal-body::-webkit-scrollbar-track { background: #1e293b; }
body.dark .rtb-modal-body:hover::-webkit-scrollbar-track { background: #1e293b; }
body.dark .rtb-modal-body::-webkit-scrollbar-thumb { background: #334155; }
body.dark .rtb-modal-body::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

body.dark .example-card {
    background: #0f172a;
    border-color: #334155;
}

body.dark .example-card:hover {
    background: rgba(37, 99, 235, 0.12);
    border-color: #3b82f6;
}

body.dark .example-card-title { color: #e2e8f0; }

body.dark .example-card-badge {
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
}

body.dark .example-card-desc { color: #64748b; }

body.dark .example-card-import {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

body.dark .example-card-import:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
