/* ============================================================
   拒绝高手 - 专属样式
   主题色：珊瑚红 #ef4444 / 暖橙 #f97316 / 护盾蓝 #3b82f6
   ============================================================ */

/* -------------------- 基础容器 -------------------- */
.re-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    min-height: 520px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
}

.re-container.re-fullscreen {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    min-height: unset;
    border-radius: 0;
    border: none;
    z-index: 9999;
}

/* -------------------- 工具栏 -------------------- */
.re-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #fff5f5 0%, #fff 60%, #fef9f0 100%);
    border-bottom: 2px solid #fecaca;
    min-height: 52px;
    flex-shrink: 0;
}

.re-toolbar-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.re-toolbar-group + .re-toolbar-group {
    margin-left: 6px;
    padding-left: 10px;
    border-left: 1px solid #fecaca;
}

.re-toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: #ef4444;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.re-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    outline: none;
}

.re-toolbar-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #ef4444;
}

.re-toolbar-btn:active {
    transform: translateY(1px);
}

.re-toolbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.re-btn-primary {
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #fff !important;
    border-color: transparent !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.re-btn-primary:hover {
    background: linear-gradient(135deg, #dc2626, #ea580c) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

.re-btn-primary.re-btn-generating {
    background: linear-gradient(135deg, #94a3b8, #64748b) !important;
    box-shadow: none;
    cursor: wait;
}

.re-btn-cancel {
    background: #fff7ed;
    color: #ea580c !important;
    border-color: #fed7aa !important;
}

.re-btn-cancel:hover {
    background: #ffedd5 !important;
    color: #c2410c !important;
}

/* -------------------- 主内容区 -------------------- */
.re-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* -------------------- 左栏：历史记录 -------------------- */
.re-history-panel {
    width: 220px;
    min-width: 180px;
    max-width: 240px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
    background: #fdfdfd;
    flex-shrink: 0;
}

.re-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fff5f5, #fef2f2);
    border-bottom: 1px solid #fecaca;
    flex-shrink: 0;
}

.re-history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 4px;
}

.re-history-count {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 400;
    margin-left: 3px;
}

.re-clear-btn {
    background: none;
    border: 1px solid #fecaca;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 4px;
    transition: all 0.2s;
}

.re-clear-btn:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

.re-history-search {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.re-history-search input {
    width: 100%;
    padding: 5px 10px;
    font-size: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    outline: none;
    background: #fff;
    color: #374151;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.re-history-search input:focus {
    border-color: #fca5a5;
}

.re-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

.re-history-list::-webkit-scrollbar { width: 4px; }
.re-history-list::-webkit-scrollbar-thumb { background: #fca5a5; border-radius: 2px; }
.re-history-list::-webkit-scrollbar-track:hover { background: #fef2f2; }

.re-history-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.15s;
}

.re-history-item:hover {
    background: #fff5f5;
}

.re-history-item.active {
    background: #fef2f2;
    border-left: 3px solid #ef4444;
    padding-left: 11px;
}

.re-history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.re-history-item-meta {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.re-history-time {
    font-size: 10px;
    color: #cbd5e1;
    font-variant-numeric: tabular-nums;
}

.re-history-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    padding: 32px 16px;
    line-height: 1.7;
}

/* -------------------- 中栏：参数配置 -------------------- */
.re-input-panel {
    width: 320px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
}

.re-panel-header {
    padding: 12px 16px 10px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.re-panel-header h3 {
    margin: 0 0 3px;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
}

.re-panel-tip {
    font-size: 11px;
    color: #94a3b8;
}

.re-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
}

.re-input-body::-webkit-scrollbar { width: 4px; }
.re-input-body::-webkit-scrollbar-thumb { background: #fca5a5; border-radius: 2px; }
.re-input-body::-webkit-scrollbar-track:hover { background: #fef2f2; }

.re-field-group {
    margin-bottom: 14px;
}

.re-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 7px;
}

/* 场景网格 */
.re-scene-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.re-scene-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 8px;
    font-size: 11px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s;
    color: #475569;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.re-scene-btn:hover {
    background: #fff5f5;
    border-color: #fca5a5;
    color: #ef4444;
}

.re-scene-btn.active {
    background: linear-gradient(135deg, #fef2f2, #fff5f5);
    border-color: #ef4444;
    color: #ef4444;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.15);
}

.re-scene-btn .scene-icon {
    font-size: 13px;
    flex-shrink: 0;
}

/* 输入域 */
.re-textarea-wrap {
    position: relative;
}

.re-textarea {
    width: 100%;
    padding: 9px 11px;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    resize: none;
    background: #fafafa;
    color: #374151;
    line-height: 1.6;
    box-sizing: border-box;
    transition: border-color 0.2s, background 0.2s;
}

.re-textarea:focus {
    border-color: #fca5a5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

.re-char-counter {
    position: absolute;
    bottom: 8px;
    right: 34px;
    font-size: 10px;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s, font-weight 0.2s;
}

/* 字符计数预警 */
.re-char-counter.warn  { color: #f97316; font-weight: 600; }
.re-char-counter.danger { color: #ef4444; font-weight: 700; }

.re-clear-input-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    background: #e2e8f0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.re-clear-input-btn:hover {
    background: #fca5a5;
    color: #fff;
}

/* 风格/语气/长度选项 */
.re-style-group,
.re-tone-group,
.re-length-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.re-option-btn {
    padding: 5px 12px;
    font-size: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s;
    color: #475569;
    font-weight: 500;
}

.re-option-btn:hover {
    background: #fff5f5;
    border-color: #fca5a5;
    color: #ef4444;
}

.re-option-btn.active {
    background: linear-gradient(135deg, #ef4444, #f97316);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}

/* 生成按钮 */
.re-generate-btn {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 3px 12px rgba(239, 68, 68, 0.3);
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.re-generate-btn:hover {
    background: linear-gradient(135deg, #dc2626, #ea580c);
    box-shadow: 0 5px 18px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

.re-generate-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.re-generate-btn:disabled {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    box-shadow: none;
    cursor: wait;
    transform: none;
}

/* 使用说明 */
.re-tips-box {
    margin-top: 14px;
    padding: 10px 12px;
    background: #fff9f0;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    font-size: 12px;
}

.re-tips-box p {
    margin: 0 0 6px;
    font-weight: 600;
    color: #ea580c;
}

.re-tips-box ul {
    margin: 0;
    padding-left: 16px;
}

.re-tips-box li {
    color: #78350f;
    line-height: 1.7;
}

/* -------------------- 右栏：结果 -------------------- */
.re-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
}

.re-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.re-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
}

.re-result-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.re-regen-btn {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid #fca5a5;
    border-radius: 5px;
    background: #fff5f5;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.re-regen-btn:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

.re-result-meta {
    font-size: 11px;
    color: #94a3b8;
    padding: 3px 8px;
    background: #f8fafc;
    border-radius: 4px;
}

.re-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    position: relative;
}

.re-result-body::-webkit-scrollbar { width: 4px; }
.re-result-body::-webkit-scrollbar-thumb { background: #fca5a5; border-radius: 2px; }
.re-result-body::-webkit-scrollbar-track:hover { background: #fef2f2; }

/* 占位符 */
.re-result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    min-height: 280px;
    text-align: center;
    color: #94a3b8;
}

.re-placeholder-icon {
    font-size: 52px;
    margin-bottom: 16px;
    opacity: 0.4;
    animation: re-float 3s ease-in-out infinite;
}

.re-placeholder-title {
    font-size: 16px;
    font-weight: 700;
    color: #64748b;
    margin: 0 0 8px;
}

.re-placeholder-desc {
    font-size: 13px;
    color: #94a3b8;
    margin: 3px 0;
}

.re-placeholder-shortcut {
    margin-top: 14px;
    font-size: 12px;
    color: #cbd5e1;
}

.re-placeholder-shortcut kbd {
    padding: 2px 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    font-family: monospace;
    font-size: 11px;
    color: #64748b;
}

/* 加载中 */
.re-result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    min-height: 280px;
    text-align: center;
}

.re-loading-shield {
    font-size: 48px;
    animation: re-shield-pulse 1.5s ease-in-out infinite;
}

@keyframes re-shield-pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.15); opacity: 1; }
}

@keyframes re-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-7px) scale(1.06); }
}

.re-loading-dots {
    display: flex;
    gap: 6px;
    margin: 14px 0 10px;
}

.re-loading-dots span {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: re-dot-bounce 1.2s infinite;
}

.re-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.re-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes re-dot-bounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40% { transform: scale(1.1); opacity: 1; }
}

.re-loading-text {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* 结果内容 */
.re-result-content {
    animation: re-fade-in 0.4s ease;
}

@keyframes re-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 话术卡片 */
.re-result-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.re-reply-card {
    background: #fff;
    border: 1px solid #fecaca;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.08);
    transition: box-shadow 0.2s, transform 0.2s;
}

.re-reply-card:hover {
    box-shadow: 0 4px 18px rgba(239, 68, 68, 0.14);
    transform: translateY(-2px);
}

.re-reply-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fff5f5, #fef2f2);
    border-bottom: 1px solid #fecaca;
}

.re-reply-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #ef4444;
}

.re-reply-badge-icon {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
    font-weight: 700;
}

.re-reply-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.re-reply-tag {
    padding: 2px 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    font-size: 10px;
    color: #ef4444;
    font-weight: 500;
}

.re-reply-text {
    padding: 14px 16px;
    font-size: 14px;
    color: #374151;
    line-height: 1.75;
    word-break: break-word;
    white-space: normal;
}

/* 富文本基础标签样式（AI返回内容渲染） */
.re-reply-text h3, .re-reply-text h4 {
    font-size: 14px;
    font-weight: 700;
    color: #ef4444;
    margin: 10px 0 5px;
}
.re-reply-text h4 { font-size: 13px; color: #f97316; }
.re-reply-text ul, .re-reply-text ol {
    padding-left: 18px;
    margin: 6px 0;
}
.re-reply-text ul li::marker {
    color: #ff9800;
    font-weight: 600;
}
.re-reply-text ol li::marker {
    color: #ff9800;
    font-weight: 600;
}
.re-reply-text li { margin-bottom: 3px; line-height: 1.65; }
.re-reply-text strong { color: #ef4444; font-weight: 600; }
.re-reply-text em { color: #f97316; font-style: italic; }
.re-reply-text blockquote {
    margin: 8px 0;
    padding: 8px 12px;
    border-left: 3px solid #fca5a5;
    background: #fff5f5;
    color: #64748b;
    font-size: 13px;
    border-radius: 0 6px 6px 0;
}
.re-reply-text hr {
    border: none;
    border-top: 1px dashed #fecaca;
    margin: 10px 0;
}
.re-reply-text a { color: #ef4444; text-decoration: underline; }
.re-reply-text a:hover { color: #dc2626; text-decoration: underline; }

.re-reply-analysis {
    padding: 10px 16px 14px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}

.re-reply-analysis-title {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 5px;
}

.re-reply-analysis-text {
    font-size: 12px;
    color: #64748b;
    line-height: 1.6;
    word-break: break-word;
}

.re-reply-actions {
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    border-top: 1px solid #fef2f2;
}

.re-reply-action-btn {
    padding: 4px 10px;
    font-size: 11px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.re-reply-action-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #ef4444;
}

/* 错误提示 */
.re-result-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 280px;
    text-align: center;
    gap: 10px;
}

.re-error-icon { font-size: 32px; }

.re-error-msg {
    font-size: 14px;
    color: #64748b;
}

.re-error-retry-btn {
    padding: 7px 18px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.re-error-retry-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* -------------------- Toast 通知 -------------------- */
.re-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: rgba(30, 41, 59, 0.92);
    color: #fff;
    padding: 10px 22px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    z-index: 99999;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}

.re-toast.re-toast-show {
    transform: translateX(-50%) translateY(0);
}

/* -------------------- 模态框 -------------------- */
.re-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9998;
    backdrop-filter: blur(3px);
}

.re-modal-overlay.active { display: block; }

.re-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 680px;
    max-height: 80vh;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    overflow: hidden;
    transition: transform 0.25s, opacity 0.25s;
    opacity: 0;
}

.re-modal.active {
    display: flex;
    flex-direction: column;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.re-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fff5f5, #fff);
    border-bottom: 1px solid #fecaca;
    flex-shrink: 0;
}

.re-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #374151;
}

.re-modal-close {
    width: 28px;
    height: 28px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.re-modal-close:hover {
    background: #fef2f2;
    color: #ef4444;
}

.re-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.re-modal-body::-webkit-scrollbar { width: 4px; }
.re-modal-body::-webkit-scrollbar-thumb { background: #fca5a5; border-radius: 2px; }
.re-modal-body::-webkit-scrollbar-track:hover { background: #fef2f2; }

.re-example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.re-example-item {
    padding: 13px 15px;
    background: #fafafa;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s;
}

.re-example-item:hover {
    background: #fff5f5;
    border-color: #fca5a5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
}

.re-example-item-title {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.re-example-item-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.re-example-item-tags {
    display: flex;
    gap: 5px;
    margin-top: 7px;
    flex-wrap: wrap;
}

.re-example-tag {
    padding: 2px 7px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 10px;
    color: #ef4444;
}

/* ============================================================
   暗黑模式
   ============================================================ */
body.dark .re-container {
    background: #1a1e2e;
    border-color: #2d3552;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

body.dark .re-toolbar {
    background: linear-gradient(135deg, #1e2436, #1a1e2e 60%, #1e2030);
    border-bottom-color: #3d2828;
}

body.dark .re-toolbar-title { color: #f87171; }

body.dark .re-toolbar-btn {
    background: #252b3d;
    border-color: #3d4461;
    color: #94a3b8;
}

body.dark .re-toolbar-btn:hover {
    background: #2e1a1a;
    border-color: #f87171;
    color: #f87171;
}

body.dark .re-toolbar-group + .re-toolbar-group {
    border-left-color: #3d2828;
}

body.dark .re-btn-primary {
    background: linear-gradient(135deg, #dc2626, #ea580c);
    color: #fff !important;
}

body.dark .re-btn-cancel {
    background: #2e1f1a;
    color: #fb923c !important;
    border-color: #7c2d12 !important;
}

body.dark .re-history-panel {
    background: #1a1e2e;
    border-right-color: #2d3552;
}

body.dark .re-history-header {
    background: linear-gradient(to bottom, #1e2030, #1a1e2e);
    border-bottom-color: #3d2828;
}

body.dark .re-history-header h3 { color: #f87171; }

body.dark .re-clear-btn {
    border-color: #3d2828;
    color: #f87171;
}

body.dark .re-clear-btn:hover {
    background: #2e1a1a;
    border-color: #f87171;
}

body.dark .re-history-search input {
    background: #252b3d;
    border-color: #3d4461;
    color: #e2e8f0;
}

body.dark .re-history-search input:focus { border-color: #f87171; }

body.dark .re-history-item {
    border-bottom-color: #252b3d;
}

body.dark .re-history-item:hover { background: #2e1a1a; }

body.dark .re-history-item.active {
    background: #2e1a1a;
    border-left-color: #ef4444;
}

body.dark .re-history-item-title { color: #e2e8f0; }

body.dark .re-history-empty { color: #4b5563; }

body.dark .re-history-time { color: #374151; }

body.dark .re-input-panel {
    background: #1e2436;
    border-right-color: #2d3552;
}

body.dark .re-panel-header {
    border-bottom-color: #2d3552;
}

body.dark .re-panel-header h3 { color: #e2e8f0; }

body.dark .re-panel-tip { color: #4b5563; }

body.dark .re-input-body::-webkit-scrollbar-track:hover { background: #2e1a1a; }

body.dark .re-label { color: #cbd5e1; }

body.dark .re-scene-btn {
    background: #252b3d;
    border-color: #3d4461;
    color: #94a3b8;
}

body.dark .re-scene-btn:hover {
    background: #2e1a1a;
    border-color: #f87171;
    color: #f87171;
}

body.dark .re-scene-btn.active {
    background: linear-gradient(135deg, #2e1a1a, #311813);
    border-color: #ef4444;
    color: #f87171;
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.25);
}

body.dark .re-textarea {
    background: #252b3d;
    border-color: #3d4461;
    color: #e2e8f0;
}

body.dark .re-textarea:focus {
    border-color: #f87171;
    background: #2d3552;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

body.dark .re-char-counter { color: #4b5563; }
body.dark .re-char-counter.warn { color: #fb923c; }
body.dark .re-char-counter.danger { color: #f87171; }

body.dark .re-clear-input-btn {
    background: #3d4461;
    color: #94a3b8;
}
body.dark .re-clear-input-btn:hover {
    background: #f87171;
    color: #fff;
}

body.dark .re-option-btn {
    background: #252b3d;
    border-color: #3d4461;
    color: #94a3b8;
}

body.dark .re-option-btn:hover {
    background: #2e1a1a;
    border-color: #f87171;
    color: #f87171;
}

body.dark .re-option-btn.active {
    background: linear-gradient(135deg, #dc2626, #ea580c);
    border-color: transparent;
    color: #fff;
}

body.dark .re-tips-box {
    background: #2a1e10;
    border-color: #7c2d12;
}

body.dark .re-tips-box p { color: #fb923c; }
body.dark .re-tips-box li { color: #fcd34d; }

body.dark .re-result-panel { background: #1e2436; }

body.dark .re-result-header {
    border-bottom-color: #2d3552;
}

body.dark .re-result-header h3 { color: #e2e8f0; }

body.dark .re-regen-btn {
    background: #2e1a1a;
    border-color: #f87171;
    color: #f87171;
}

body.dark .re-result-meta {
    background: #252b3d;
    color: #94a3b8;
}

body.dark .re-error-icon { color: #f87171; }
body.dark .re-error-msg { color: #94a3b8; }

body.dark .re-placeholder-icon { opacity: 0.3; }
body.dark .re-placeholder-title { color: #94a3b8; }
body.dark .re-placeholder-desc { color: #64748b; }

body.dark .re-placeholder-shortcut kbd {
    background: #252b3d;
    border-color: #3d4461;
    color: #94a3b8;
}

body.dark .re-loading-text { color: #94a3b8; }

body.dark .re-reply-card {
    background: #252b3d;
    border-color: #3d2828;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark .re-reply-card:hover {
    box-shadow: 0 4px 18px rgba(239, 68, 68, 0.2);
}

body.dark .re-reply-card-header {
    background: linear-gradient(135deg, #2e1a1a, #311813);
    border-bottom-color: #3d2828;
}

body.dark .re-reply-badge { color: #f87171; }

body.dark .re-reply-tag {
    background: #2e1a1a;
    border-color: #3d2828;
    color: #f87171;
}

body.dark .re-reply-text { color: #cbd5e1; }

body.dark .re-reply-analysis {
    background: #1e2436;
    border-top-color: #2d3552;
}

body.dark .re-reply-analysis-title { color: #94a3b8; }
body.dark .re-reply-analysis-text { color: #64748b; }

body.dark .re-reply-actions { border-top-color: #2d3552; }

body.dark .re-reply-action-btn {
    background: #252b3d;
    border-color: #3d4461;
    color: #94a3b8;
}

body.dark .re-reply-action-btn:hover {
    background: #2e1a1a;
    border-color: #f87171;
    color: #f87171;
}

body.dark .re-modal {
    background: #1e2436;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

body.dark .re-modal-header {
    background: linear-gradient(135deg, #2e1a1a, #1e2436);
    border-bottom-color: #3d2828;
}

body.dark .re-modal-header h3 { color: #e2e8f0; }

body.dark .re-modal-close {
    background: #2d3552;
    color: #94a3b8;
}

body.dark .re-modal-close:hover {
    background: #2e1a1a;
    color: #f87171;
}

body.dark .re-example-item {
    background: #252b3d;
    border-color: #3d4461;
}

body.dark .re-example-item:hover {
    background: #2e1a1a;
    border-color: #f87171;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

body.dark .re-example-item-title { color: #e2e8f0; }
body.dark .re-example-item-desc { color: #94a3b8; }

body.dark .re-example-tag {
    background: #2e1a1a;
    border-color: #3d2828;
    color: #f87171;
}

body.dark .re-toast {
    background: rgba(15, 23, 42, 0.95);
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 900px) {
    .re-history-panel { width: 190px; min-width: 160px; }
    .re-input-panel { width: 280px; min-width: 240px; }
}

@media (max-width: 700px) {
    .re-main-content { flex-direction: column; overflow-y: auto; }
    .re-history-panel {
        width: 100%;
        max-width: 100%;
        max-height: 160px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    .re-input-panel {
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        max-height: 400px;
    }
    .re-toolbar { flex-wrap: wrap; }
    .re-scene-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   em 标签深色模式适配
   ============================================================ */
body.dark .re-reply-text em {
    color: #A1887F;
}

body.dark .re-reply-text strong {
    color: #f87171;
}

body.dark .re-reply-text h3 { color: #f87171; }
body.dark .re-reply-text h4 { color: #fb923c; }

body.dark .re-reply-text blockquote {
    background: #2e1a1a;
    border-left-color: #f87171;
    color: #94a3b8;
}

body.dark .re-reply-text hr {
    border-top-color: #3d2828;
}

body.dark .re-reply-text a { color: #f87171; }
body.dark .re-reply-text a:hover { color: #fca5a5; }

/* ============================================================
   打印样式
   ============================================================ */
@media print {
    .re-toolbar,
    .re-history-panel,
    .re-input-panel,
    .re-toast,
    .re-modal,
    .re-modal-overlay,
    #reGenerateBtn,
    #reGenerateBtnInline,
    #reCancelBtn,
    #reCopyBtn,
    #reClearContentBtn,
    #reExampleBtn,
    #reThemeBtn,
    #reFullscreenBtn,
    #reRegenBtn,
    .re-reply-actions {
        display: none !important;
    }

    .re-container {
        position: static !important;
        height: auto !important;
        box-shadow: none !important;
        border: none !important;
    }

    .re-main-content {
        flex-direction: column !important;
    }

    .re-result-panel {
        width: 100% !important;
    }

    .re-result-body {
        overflow: visible !important;
        height: auto !important;
    }

    .re-result-content {
        display: block !important;
    }

    .re-reply-card {
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #e2e8f0 !important;
    }
}
