/* =============================================
   辞职信 - resignation_letter.css
   三栏布局，纸张信件预览风格
   主色调：深邃蓝 #1e40af + 天蓝 #0284c7
   ============================================= */

/* ========== 主容器 ========== */
.rl-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

/* 全屏模式 */
.rl-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;
}

/* ========== 顶部工具栏 ========== */
.rl-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #1e40af 0%, #0284c7 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.35);
    flex-shrink: 0;
}

.rl-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.5px;
    margin-right: 8px;
}

.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 8px rgba(0, 0, 0, 0.15);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* 主操作按钮（生成辞职信） */
.toolbar-btn-primary {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.4);
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.5);
    color: #fff;
}

/* ========== Shake 抖动动画（字段校验错误提示） ========== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-5px); }
    30%, 70% { transform: translateX(5px); }
}

.rl-input.shake,
.rl-select.shake,
.rl-textarea.shake {
    animation: shake 0.5s ease-in-out;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

/* ========== 主内容区：三栏布局 ========== */
.rl-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f1f5f9;
}

/* ========== 左栏：历史记录 ========== */
.rl-history-panel {
    width: 205px;
    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 0%, #f5f5f5 100%);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.history-count {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 400;
}

.history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.history-clear-btn:hover {
    background: #fde8e8;
}

.history-search {
    padding: 8px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    position: relative;
}

.history-search input {
    width: 100%;
    padding: 6px 26px 6px 10px;  /* 右侧为清除按钮留空 */
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
}

.history-search input:focus {
    border-color: #1e40af;
    box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.1);
}

.history-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #b0b7c3;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 3px;
    line-height: 1;
    transition: color 0.2s;
}

.history-search-clear:hover { color: #ef4444; }

.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: #1e40af; }

.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-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: hiFadeIn 0.2s ease;
}

@keyframes hiFadeIn {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: translateX(0); }
}

.history-item:hover {
    background: #f0f9ff;
    border-color: #bae6fd;
    transform: translateX(2px);
}

.history-item.active {
    background: #eff6ff;
    border-color: #93c5fd;
    box-shadow: 0 1px 3px rgba(30, 64, 175, 0.15);
}

.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-name {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 20px;
    margin-bottom: 2px;
}

.history-item-reason {
    font-size: 11px;
    color: #1e40af;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-time {
    font-size: 10px;
    color: #94a3b8;
}

/* ========== 中栏：表单输入 ========== */
.rl-input-panel {
    width: 380px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========== 右栏：结果预览 ========== */
.rl-result-panel {
    flex: 1;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 300px;
}

/* ========== 通用面板头部 ========== */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #fafafa 0%, #f5f5f5 100%);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    min-height: 44px;
}

.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;
    min-width: 0;
    flex-shrink: 1;
    overflow: hidden;
}

.result-meta-info {
    font-size: 11px;
    color: #1e40af;
    background: #eff6ff;
    padding: 2px 10px;
    border-radius: 10px;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
}

.result-char-count {
    font-size: 11px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
    transition: background 0.25s, color 0.25s;
}

/* 篇幅合适（300-700字）绿色反馈 */
.result-char-count.char-count-good {
    background: #ecfdf5;
    color: #059669;
}

.result-time {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ========== 表单区域 ========== */
.rl-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.rl-input-body::-webkit-scrollbar { width: 4px; }
.rl-input-body::-webkit-scrollbar-track { background: transparent; }
.rl-input-body:hover::-webkit-scrollbar-track { background: #eff6ff; }
.rl-input-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }
.rl-input-body::-webkit-scrollbar-thumb:hover { background: #1e40af; }

/* 分节标题 */
.section-label {
    font-size: 11px;
    font-weight: 700;
    color: #1e40af;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0 0 6px 0;
    margin: 6px 0 10px 0;
    border-bottom: 1px solid #dbeafe;
    user-select: none;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.required-mark {
    color: #ef4444;
    margin-left: 2px;
}

.label-tip {
    font-size: 11px;
    font-weight: 400;
    color: #9ca3af;
}

.rl-input,
.rl-select,
.rl-textarea {
    width: 100%;
    padding: 7px 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;
}

.rl-input:focus,
.rl-select:focus,
.rl-textarea:focus {
    border-color: #1e40af;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.08);
}

.rl-input:hover:not(:focus),
.rl-select:hover:not(:focus),
.rl-textarea:hover:not(:focus) {
    border-color: #93c5fd;
    background: #fff;
}

.rl-input::placeholder,
.rl-textarea::placeholder { color: #b0b7c3; }

.rl-textarea {
    resize: vertical;
    min-height: 90px;
    line-height: 1.6;
}

.rl-textarea::-webkit-scrollbar { width: 4px; }
.rl-textarea::-webkit-scrollbar-track { background: transparent; }
.rl-textarea:hover::-webkit-scrollbar-track { background: #eff6ff; }
.rl-textarea::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }
.rl-textarea::-webkit-scrollbar-thumb:hover { background: #1e40af; }

.rl-textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.rl-textarea-hint {
    font-size: 11px;
    color: #b0b7c3;
    user-select: none;
}

.detail-char-count {
    font-size: 11px;
    color: #b0b7c3;
    transition: color 0.2s;
}

.detail-char-count.warn   { color: #f97316; font-weight: 600; }
.detail-char-count.danger { color: #ef4444; font-weight: 600; }

.rl-select {
    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;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-group-half {
    flex: 1;
    min-width: 0;
}

/* ========== 结果区域 ========== */
.rl-result-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #f1f5f9;
}

.rl-result-body::-webkit-scrollbar { width: 6px; }
.rl-result-body::-webkit-scrollbar-track { background: transparent; }
.rl-result-body:hover::-webkit-scrollbar-track { background: #e8f0fe; }
.rl-result-body::-webkit-scrollbar-thumb { background: #c7d2e0; border-radius: 3px; }
.rl-result-body::-webkit-scrollbar-thumb:hover { background: #1e40af; }

/* 占位提示 */
.result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    color: #94a3b8;
    user-select: none;
}

.placeholder-icon {
    font-size: 52px;
    margin-bottom: 16px;
    opacity: 0.5;
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
    margin: 0 0 8px;
}

.placeholder-desc {
    font-size: 13px;
    color: #94a3b8;
    margin: 4px 0;
    line-height: 1.6;
}

.placeholder-tip {
    font-size: 12px;
    margin-top: 12px;
    background: #eff6ff;
    padding: 4px 14px;
    border-radius: 12px;
    color: #1e40af;
}

/* 加载动画 */
.result-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
}

.loading-quill {
    font-size: 44px;
    margin-bottom: 16px;
    animation: writingAnim 1.2s ease-in-out infinite alternate;
}

@keyframes writingAnim {
    from { transform: rotate(-10deg) translateX(-4px); }
    to   { transform: rotate(10deg) translateX(4px); }
}

.loading-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background: #1e40af;
    border-radius: 50%;
    display: inline-block;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40% { transform: scale(1.1); opacity: 1; }
}

.loading-text {
    font-size: 13px;
    color: #1e40af;
    margin: 0;
}

/* ========== 信件纸张展示区 ========== */
.letter-paper-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 30px;
    background: #eef2f7;
}

.letter-paper-wrap::-webkit-scrollbar { width: 6px; }
.letter-paper-wrap::-webkit-scrollbar-track { background: transparent; }
.letter-paper-wrap:hover::-webkit-scrollbar-track { background: #e8f0fe; }
.letter-paper-wrap::-webkit-scrollbar-thumb { background: #c7d2e0; border-radius: 3px; }
.letter-paper-wrap::-webkit-scrollbar-thumb:hover { background: #1e40af; }

/* 信件纸张 —— 核心特色：像一张真实的文件纸 */
.letter-paper {
    background: #fffffe;
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
    padding: 44px 52px 48px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.08);
    border-top: 4px solid #1e40af;
    border-radius: 0 0 4px 4px;
    position: relative;
    animation: paperSlideIn 0.35s ease-out;
    flex-shrink: 0;
}

@keyframes paperSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 信纸右上角折角装饰 */
.letter-paper::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 28px 28px 0;
    border-color: transparent #e2e8f0 transparent transparent;
}

/* 信纸左侧边距线（模拟真实公文纸） */
.letter-paper::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    left: 36px;   /* 位于左 padding(52px)之内，确保绪线在空白边距区 */
    width: 1px;
    background: rgba(239, 68, 68, 0.1);
    pointer-events: none;
}

/* 辞职信标题印章 */
.letter-stamp {
    text-align: center;
    font-size: 19px;
    font-weight: 700;
    color: #1e3a8a;
    letter-spacing: 10px;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px dashed #bfdbfe;
    font-family: "STSong", "SimSun", "宋体", serif;
    position: relative;
}

.letter-stamp::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #1e40af, transparent);
    border-radius: 2px;
}

/* 信件正文内容 */
.result-content {
    font-size: 14.5px;
    line-height: 2.2;
    color: #1f2937;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: "STSong", "SimSun", "宋体", serif;
    text-align: justify;
}

/* result-content 区域 Markdown 常用标签基础样式 */
.result-content strong { font-weight: 700; color: #1e3a8a; }
.result-content em { font-style: italic; color: #374151; }
.result-content h1,
.result-content h2 { font-size: 17px; font-weight: 700; color: #1e3a8a; margin: 16px 0 8px; }
.result-content h3 { font-size: 15px; font-weight: 700; color: #1e3a8a; margin: 14px 0 6px; }
.result-content h4 { font-size: 14px; font-weight: 700; color: #374151; margin: 10px 0 4px; }
.result-content h5 { font-size: 13px; font-weight: 600; color: #475569; margin: 8px 0 4px; }
.result-content pre {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 13px;
    overflow-x: auto;
    font-family: monospace;
    line-height: 1.6;
    white-space: pre;
}
.result-content code {
    background: #f1f5f9;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 13px;
    font-family: monospace;
    color: #1e40af;
}
/* 重置浏览器默认 blockquote margin（40px），防止缩进异常 */
.result-content blockquote {
    margin: 0 0 8px 0;
    padding: 4px 0 4px 12px;
    border-left: 3px solid #bfdbfe;
    color: #64748b;
    font-style: italic;
}
.result-content ul,
.result-content ol {
    margin: 4px 0 8px 1.5em;
    padding: 0;
    white-space: normal;
}
.result-content li {
    margin: 3px 0;
    line-height: 1.8;
}
.result-content a {
    color: #1d4ed8;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* 错误提示 */
.result-error-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-error-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 24px;
    text-align: center;
}

.result-error-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

.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-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 18px;
    background: linear-gradient(135deg, #1e40af 0%, #0284c7 100%);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(30,64,175,0.3);
}

.result-error-retry-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(30,64,175,0.4);
}

/* ========== 示例模态框 ========== */
.rl-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100000;
    backdrop-filter: blur(2px);
}

/* 覆盖层入场动画 */
.rl-modal-overlay.anim-in {
    animation: meOverlayFadeIn 0.22s ease forwards;
}

@keyframes meOverlayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.rl-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100001;
    width: 90%;
    max-width: 740px;
    max-height: 82vh;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 内容层入场动画（轻微上浮 + 淡入，弹性缓动） */
.rl-modal.anim-in {
    animation: meModalSlideIn 0.32s cubic-bezier(.34, 1.4, .64, 1) forwards;
}

@keyframes meModalSlideIn {
    from { opacity: 0; transform: translate(-50%, calc(-50% + 18px)); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

.rl-modal-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.rl-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%, #0284c7 100%);
    color: #fff;
}

.rl-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.rl-modal-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 28px; height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rl-modal-close:hover { background: rgba(255,255,255,0.3); }

.rl-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
    align-content: start;
}

.rl-modal-body::-webkit-scrollbar { width: 4px; }
.rl-modal-body::-webkit-scrollbar-track { background: transparent; }
.rl-modal-body:hover::-webkit-scrollbar-track { background: #eff6ff; }
.rl-modal-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }
.rl-modal-body::-webkit-scrollbar-thumb:hover { background: #1e40af; }

/* 示例卡片 */
.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, #1e40af 0%, #0284c7 100%);
    opacity: 0;
    transition: opacity 0.2s;
}

.example-card:hover {
    border-color: #93c5fd;
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.1);
}

.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: #eff6ff;
    color: #1e40af;
    padding: 1px 6px;
    border-radius: 10px;
    white-space: nowrap;
}

.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;
}

.example-card-import {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    margin-bottom: 0;
    font-size: 11px;
    font-weight: 600;
    color: #1e40af;
    background: #eff6ff;
    border: none;
    border-radius: 4px;
    padding: 3px 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-card-import:hover {
    background: #1e40af;
    color: #fff;
}

/* ========== 打印样式 ========== */
@media print {
    body > *:not(.rl-container),
    .rl-toolbar,
    .rl-history-panel,
    .rl-input-panel,
    #resultPlaceholder,
    #resultLoading,
    #resultErrorWrap {
        display: none !important;
    }

    .rl-container,
    .rl-container.fullscreen {
        position: static !important;
        height: auto;
        box-shadow: none;
        background: #fff;
    }

    .rl-main-content { display: block; }

    .rl-result-panel {
        width: 100%;
        background: #fff;
    }

    .rl-result-body {
        overflow: visible;
        background: #fff;
    }

    .letter-paper-wrap {
        overflow: visible;
        background: #fff;
        padding: 0;
    }

    .letter-paper {
        box-shadow: none;
        border-top: 2px solid #1e40af;
        max-width: 100%;
        padding: 20px 40px;
    }

    .letter-paper::before { display: none; }
    .panel-header { display: none; }
}

/* ========== 响应式布局 ========== */
@media (max-width: 1100px) {
    .rl-input-panel { width: 330px; }
    .panel-tip { display: none; }
}

@media (max-width: 800px) {
    .rl-main-content {
        flex-direction: column;
        overflow-y: auto;
    }
    .rl-history-panel {
        width: 100%;
        max-height: 160px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    .rl-input-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        max-height: 420px;
    }
    .rl-result-panel {
        width: 100%;
        min-height: 320px;
    }
    .form-row { flex-direction: column; }
    .letter-paper { padding: 24px 20px; }
    .rl-modal-body { grid-template-columns: 1fr; }
}

/* ========== 暗黑模式 ========== */
body.dark .rl-container {
    background: #0f172a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark .rl-main-content { background: #0f172a; }

/* 工具栏在暗黑模式下保持渐变色，自然适配 */

body.dark .rl-history-panel {
    background: #1e293b;
    border-color: #334155;
}

body.dark .history-panel-header {
    background: #243244;
    border-color: #334155;
}

body.dark .history-panel-header h3 { color: #cbd5e1; }
body.dark .history-count { color: #64748b; }

body.dark .history-search input {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

body.dark .history-search input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.15);
}

body.dark .history-search input::placeholder { color: #64748b; }

body.dark .history-item {
    background: #243244;
    border-color: #334155;
}

body.dark .history-item:hover {
    background: #1e3a5f;
    border-color: #3b82f6;
}

body.dark .history-item.active {
    background: #1e3a5f;
    border-color: #60a5fa;
}

body.dark .history-item-name { color: #e2e8f0; }
body.dark .history-item-reason { color: #93c5fd; }
body.dark .history-item-time { color: #64748b; }
body.dark .history-empty { color: #64748b; }

body.dark .rl-input-panel {
    background: #1e293b;
    border-color: #334155;
}

body.dark .rl-result-panel { background: #0f172a; }

body.dark .panel-header {
    background: #243244;
    border-color: #334155;
}

body.dark .panel-header h3 { color: #cbd5e1; }
body.dark .panel-tip { color: #475569; }

body.dark .result-meta-info {
    background: #1e3a5f;
    color: #93c5fd;
}

body.dark .result-char-count {
    background: #334155;
    color: #94a3b8;
}

body.dark .section-label {
    color: #60a5fa;
    border-color: #334155;
}

body.dark .form-group label { color: #cbd5e1; }
body.dark .label-tip { color: #64748b; }

body.dark .rl-input,
body.dark .rl-select,
body.dark .rl-textarea {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

body.dark .rl-input:focus,
body.dark .rl-select:focus,
body.dark .rl-textarea:focus {
    border-color: #60a5fa;
    background: #3d4f6b;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

body.dark .rl-input:hover:not(:focus),
body.dark .rl-select:hover:not(:focus),
body.dark .rl-textarea:hover:not(:focus) {
    border-color: #3b82f6;
    background: #2d3f55;
}

body.dark .rl-input::placeholder,
body.dark .rl-textarea::placeholder { color: #4b5563; }

/* 表单辅助文字暗黑模式 */
body.dark .rl-textarea-hint { color: #4b5563; }
body.dark .label-tip { color: #4b5563; }
body.dark .detail-char-count { color: #4b5563; }
body.dark .detail-char-count.warn  { color: #fb923c; }
body.dark .detail-char-count.danger { color: #f87171; }

body.dark .rl-select {
    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");
}

body.dark .rl-select option {
    background: #1e293b;
    color: #e2e8f0;
}

body.dark .rl-result-body { background: #0f172a; }

body.dark .result-placeholder { color: #475569; }
body.dark .placeholder-title { color: #64748b; }
body.dark .placeholder-desc { color: #4b5563; }

body.dark .placeholder-tip {
    background: #1e3a5f;
    color: #93c5fd;
}

body.dark .loading-dots span { background: #60a5fa; }
body.dark .loading-text { color: #60a5fa; }

body.dark .letter-paper-wrap { background: #0f172a; }

body.dark .letter-paper {
    background: #1e293b;
    border-top-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 10px 30px rgba(0,0,0,0.25);
}

body.dark .letter-paper::before {
    border-color: transparent #334155 transparent transparent;
}

/* 信纸左边距线暗黑模式适配 */
body.dark .letter-paper::after {
    background: rgba(248, 113, 113, 0.07);
}

body.dark .letter-stamp {
    color: #93c5fd;
    border-bottom-color: #334155;
}

body.dark .letter-stamp::after {
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
}

body.dark .result-content { color: #e2e8f0; }
body.dark .result-content strong { color: #93c5fd; }
body.dark .result-content h1,
body.dark .result-content h2 { color: #93c5fd; }
body.dark .result-content h3 { color: #93c5fd; }
body.dark .result-content h4 { color: #cbd5e1; }
body.dark .result-content h5 { color: #94a3b8; }
body.dark .result-content pre { background: #334155; border-color: #475569; color: #e2e8f0; }
body.dark .result-content code { background: #1e3a5f; color: #93c5fd; }
body.dark .result-content blockquote { border-left-color: #334155; color: #94a3b8; }
body.dark .result-content ul,
body.dark .result-content ol { color: #e2e8f0; }
body.dark .result-content a { color: #60a5fa; }

body.dark .result-char-count {
    background: #334155;
    color: #94a3b8;
}

body.dark .result-char-count.char-count-good {
    background: #022c22;
    color: #34d399;
}

body.dark .result-error-title { color: #f87171; }
body.dark .result-error-hint { color: #64748b; }
body.dark .result-error-retry-btn {
    background: linear-gradient(135deg, #1e3a8a 0%, #0369a1 100%);
    box-shadow: 0 2px 6px rgba(30,64,175,0.4);
}

body.dark .rl-modal { background: #1e293b; }

body.dark .rl-modal-body {
    background: #1e293b;
    scrollbar-color: #334155 transparent;
}

body.dark .example-card {
    background: #243244;
    border-color: #334155;
}

body.dark .example-card:hover {
    background: #1e3a5f;
    border-color: #3b82f6;
}

body.dark .example-card-title { color: #e2e8f0; }
body.dark .example-card-badge { background: #1e3a5f; color: #93c5fd; }
body.dark .example-card-desc { color: #94a3b8; }
body.dark .example-card-import { background: #1e3a5f; color: #93c5fd; }
body.dark .example-card-import:hover { background: #3b82f6; color: #fff; }

body.dark .history-clear-btn {
    background: #3d1f1f;
    color: #f87171;
}

body.dark .history-clear-btn:hover { background: #4d2020; }

body.dark .history-search-clear { color: #64748b; }
body.dark .history-search-clear:hover { color: #f87171; }
