/* ========================================
   内容加Emoji 工具样式
   主题色：活力橙黄渐变，体现emoji活泼特色
   ======================================== */

/* ========== 主容器 ========== */
.cae-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #fffbf5;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(255, 160, 0, 0.1);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.cae-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.cae-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
    color: #5a3800;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(247, 151, 30, 0.35);
    flex-shrink: 0;
}

.toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: #5a3800;
    margin-right: 6px;
    letter-spacing: 0.3px;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-group--right {
    margin-left: auto;
}

.toolbar-btn {
    padding: 6px 11px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #5a3800;
    transition: all 0.25s;
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.toolbar-btn-primary {
    background: #ff6b00;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(255, 107, 0, 0.4);
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: #e05a00;
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.45);
}

/* ========== 主内容区三栏 ========== */
.cae-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #fffbf5;
}

/* ========== 左栏：历史记录 ========== */
.cae-history-panel {
    width: 210px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #ffe0a0;
    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, #fff9ee, #fff4e0);
    border-bottom: 1px solid #ffe0a0;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #7a4f00;
}

.history-count {
    display: inline-block;
    margin-left: 5px;
    font-size: 11px;
    color: #f7971e;
    font-weight: 600;
    background: #fff3d0;
    padding: 1px 5px;
    border-radius: 8px;
}

.history-clear-btn {
    background: #fff0d5;
    border: none;
    color: #e06000;
    font-size: 13px;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 4px;
    transition: all 0.2s;
}

.history-clear-btn:hover {
    background: #ffdaa0;
}

.history-search {
    padding: 8px;
    border-bottom: 1px solid #ffe0a0;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ffd080;
    border-radius: 5px;
    font-size: 12px;
    outline: none;
    background: #fffbf5;
    color: #5a3800;
    transition: all 0.2s;
    box-sizing: border-box;
}

.history-search input:focus {
    border-color: #f7971e;
    box-shadow: 0 0 0 2px rgba(247, 151, 30, 0.15);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.history-empty {
    text-align: center;
    color: #c8a060;
    font-size: 12px;
    padding: 24px 12px;
}

.history-item {
    padding: 9px 11px;
    margin: 3px 0;
    background: #fffbf5;
    border: 1px solid #ffe0a0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: fadeIn 0.2s ease;
}

.history-item:hover {
    background: #fff3d0;
    border-color: #f7971e;
    transform: translateX(2px);
}

.history-item.active {
    background: #fff0c0;
    border-color: #f7971e;
    box-shadow: 0 1px 4px rgba(247, 151, 30, 0.2);
}

.history-item-preview {
    font-size: 12px;
    font-weight: 600;
    color: #5a3800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 3px;
}

.history-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: #c8a060;
}

.history-item-density {
    background: #ffe0a0;
    color: #7a4f00;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 10px;
}

.history-item-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: #fde8e8;
    color: #ef4444;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    line-height: 1;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    background: #ef4444;
    color: white;
}

/* ========== 中栏：输入表单 ========== */
.cae-input-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid #ffe0a0;
    overflow: hidden;
    min-width: 280px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #fff9ee, #fff4e0);
    border-bottom: 1px solid #ffe0a0;
    flex-shrink: 0;
    gap: 8px;
}

.panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #7a4f00;
}

.panel-tip {
    font-size: 11px;
    color: #c8a060;
}

.cae-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #7a4f00;
    margin-bottom: 7px;
}

.required-mark {
    color: #f7971e;
    font-size: 14px;
}

.label-tip {
    font-size: 11px;
    font-weight: 400;
    color: #c8a060;
}

.char-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 400;
    color: #c8a060;
}

.char-count.warn {
    color: #f7971e;
}

.char-count.danger {
    color: #ef4444;
}

.cae-textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #ffd080;
    border-radius: 7px;
    font-size: 13px;
    line-height: 1.65;
    font-family: inherit;
    resize: vertical;
    outline: none;
    background: #fffcf5;
    color: #3d2800;
    transition: all 0.2s;
    box-sizing: border-box;
    min-height: 160px;
}

.cae-textarea:focus {
    border-color: #f7971e;
    box-shadow: 0 0 0 3px rgba(247, 151, 30, 0.1);
    background: #fff;
}

.cae-textarea:disabled {
    background: #fdf6e8;
    color: #c8a060;
    cursor: not-allowed;
    opacity: 0.75;
}

.cae-textarea::placeholder {
    color: #d4aa70;
    font-size: 12px;
}

.nm-textarea-hint {
    margin-top: 5px;
    font-size: 11px;
    color: #c8a060;
}

.cae-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ffd080;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    background: #fffcf5;
    color: #3d2800;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%23c8a060'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.cae-select:focus {
    border-color: #f7971e;
    box-shadow: 0 0 0 2px rgba(247, 151, 30, 0.1);
}

.cae-select:disabled {
    background-color: #fdf6e8;
    color: #c8a060;
    cursor: not-allowed;
    opacity: 0.75;
}

/* Emoji密度单选按钮组 */
.density-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.density-option {
    flex: 1;
    min-width: 60px;
    cursor: pointer;
}

.density-option input[type="radio"] {
    display: none;
}

.density-btn {
    display: block;
    text-align: center;
    padding: 7px 4px;
    border: 1.5px solid #ffd080;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    color: #7a4f00;
    background: #fffcf5;
    transition: all 0.2s;
    cursor: pointer;
    white-space: nowrap;
}

.density-option input[type="radio"]:checked + .density-btn {
    background: linear-gradient(135deg, #f7971e, #ffd200);
    border-color: #f7971e;
    color: #fff;
    box-shadow: 0 2px 8px rgba(247, 151, 30, 0.35);
}

.density-option input[type="radio"]:disabled + .density-btn {
    opacity: 0.55;
    cursor: not-allowed;
}

.density-btn:hover {
    border-color: #f7971e;
    background: #fff3d0;
}

/* 快捷场景标签 */
.scene-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 4px;
}

.scene-tag {
    display: inline-block;
    padding: 5px 10px;
    background: #fff3d0;
    border: 1px solid #ffd080;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #7a4f00;
    cursor: pointer;
    transition: all 0.2s;
}

.scene-tag:hover {
    background: linear-gradient(135deg, #f7971e, #ffd200);
    border-color: #f7971e;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(247, 151, 30, 0.3);
}

/* ========== 右栏：结果面板 ========== */
.cae-result-panel {
    flex: 1.1;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
    min-width: 280px;
}

.result-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 结果区头部「换一批」按钮 */
.result-regen-btn {
    padding: 5px 12px;
    background: linear-gradient(135deg, #f7971e, #ffd200);
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    color: #5a3800;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(247, 151, 30, 0.3);
}

.result-regen-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(247, 151, 30, 0.45);
    background: linear-gradient(135deg, #f08010, #f0c000);
}

.result-regen-btn:active {
    transform: translateY(0);
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-time {
    font-size: 11px;
    color: #c8a060;
}

.cae-result-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 占位区域 */
.result-placeholder {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
}

.placeholder-icon {
    font-size: 56px;
    margin-bottom: 16px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.placeholder-title {
    font-size: 16px;
    font-weight: 700;
    color: #7a4f00;
    margin: 0 0 8px;
}

.placeholder-desc {
    font-size: 13px;
    color: #c8a060;
    margin: 3px 0;
    line-height: 1.5;
}

/* 加载状态 */
.result-loading {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.emoji-loading {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.emoji-spin {
    font-size: 28px;
    animation: emojiPulse 1s ease-in-out infinite;
}

@keyframes emojiPulse {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.7; }
    50% { transform: scale(1.3) rotate(15deg); opacity: 1; }
}

.loading-text {
    font-size: 13px;
    color: #c8a060;
    margin: 0;
    text-align: center;
}

/* 错误状态 */
.result-content--error {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.pc-error-text {
    font-size: 14px;
    color: #ef4444;
    margin: 0 0 16px;
}

.error-retry-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, #f7971e, #ffd200);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(247, 151, 30, 0.3);
}

.error-retry-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(247, 151, 30, 0.4);
}

/* 结果内容 */
.cae-result-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* 结果卡片入场动画 */
@keyframes cardSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-card {
    background: linear-gradient(135deg, #fffbf0, #fff8e7);
    border: 1px solid #ffe0a0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
    box-shadow: 0 2px 8px rgba(247, 151, 30, 0.08);
    animation: cardSlideIn 0.3s ease-out;
}

.result-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ffd080;
}

.result-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #7a4f00;
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #f7971e, #ffd200);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.result-card-actions {
    display: flex;
    gap: 6px;
}

.result-action-btn {
    padding: 4px 10px;
    background: #fff3d0;
    border: 1px solid #ffd080;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #7a4f00;
    cursor: pointer;
    transition: all 0.2s;
}

.result-action-btn:hover {
    background: linear-gradient(135deg, #f7971e, #ffd200);
    border-color: #f7971e;
    color: #fff;
}

.result-text-box {
    font-size: 14px;
    line-height: 1.8;
    color: #3d2800;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 14px;
    background: #fff;
    border-radius: 7px;
    border: 1px solid #ffe0a0;
    min-height: 80px;
}

.result-stats {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.result-stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #c8a060;
    background: #fff3d0;
    padding: 4px 10px;
    border-radius: 12px;
}

.result-stat-item strong {
    color: #f7971e;
}

/* ========== 模态框 ========== */
.cae-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.cae-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    width: 90%;
    max-width: 680px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.cae-modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

.cae-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(to bottom, #fff9ee, #fff4e0);
    border-bottom: 1px solid #ffe0a0;
    flex-shrink: 0;
}

.cae-modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #7a4f00;
}

.cae-modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: #fde8e8;
    color: #ef4444;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cae-modal-close:hover {
    background: #ef4444;
    color: #fff;
}

.cae-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;
}

/* 示例卡片 */
.example-card {
    background: #fffbf5;
    border: 1.5px solid #ffe0a0;
    border-radius: 9px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-card:hover {
    border-color: #f7971e;
    background: #fff3d0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(247, 151, 30, 0.15);
}

.example-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #7a4f00;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.example-card-preview {
    font-size: 12px;
    color: #9a7040;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 8px;
}

.example-card-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.example-tag {
    font-size: 10px;
    padding: 2px 7px;
    background: #ffe0a0;
    color: #7a4f00;
    border-radius: 8px;
    font-weight: 600;
}

/* ========== Toast消息 ========== */
.cae-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: rgba(60, 40, 0, 0.88);
    color: #ffe0a0;
    padding: 10px 22px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    z-index: 99999;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.cae-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ========== 滚动条样式 ========== */
.history-list::-webkit-scrollbar,
.cae-input-body::-webkit-scrollbar,
.cae-result-body::-webkit-scrollbar,
.cae-result-content::-webkit-scrollbar,
.cae-modal-body::-webkit-scrollbar {
    width: 5px;
}

.history-list::-webkit-scrollbar-track,
.cae-input-body::-webkit-scrollbar-track,
.cae-result-body::-webkit-scrollbar-track,
.cae-result-content::-webkit-scrollbar-track,
.cae-modal-body::-webkit-scrollbar-track {
    background: #fff3d0;
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb,
.cae-input-body::-webkit-scrollbar-thumb,
.cae-result-body::-webkit-scrollbar-thumb,
.cae-result-content::-webkit-scrollbar-thumb,
.cae-modal-body::-webkit-scrollbar-thumb {
    background: #f7971e;
    border-radius: 3px;
    opacity: 0.7;
}

.history-list::-webkit-scrollbar-thumb:hover,
.cae-input-body::-webkit-scrollbar-thumb:hover,
.cae-result-body::-webkit-scrollbar-thumb:hover,
.cae-result-content::-webkit-scrollbar-thumb:hover,
.cae-modal-body::-webkit-scrollbar-thumb:hover {
    background: #e06000;
}

/* ========== 动画 ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   响应式布局
   ======================================== */

/* ≥900px：三栏显示 */
@media (min-width: 900px) {
    .cae-history-panel {
        display: flex;
    }
}

/* 640px ~ 899px：隐藏历史栏 */
@media (max-width: 899px) {
    .cae-history-panel {
        display: none;
    }
    .cae-input-panel, .cae-result-panel {
        min-width: 0;
    }
}

/* ≤639px：纵向堆叠 */
@media (max-width: 639px) {
    .cae-main-content {
        flex-direction: column;
    }
    .cae-container {
        height: auto;
        min-height: auto;
    }
    .cae-input-panel, .cae-result-panel {
        min-height: 400px;
        border-right: none;
        border-bottom: 1px solid #ffe0a0;
    }
    .toolbar-title {
        display: none;
    }
    .cae-toolbar {
        flex-wrap: wrap;
        padding: 8px;
        gap: 6px;
    }
    .toolbar-group--right {
        margin-left: 0;
    }
}

/* ========================================
   暗黑模式 (body.dark 前缀)
   ======================================== */

body.dark .cae-container {
    background: #1a1008;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

body.dark .cae-toolbar {
    background: linear-gradient(135deg, #7a4500 0%, #4a3000 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

body.dark .toolbar-title {
    color: #ffd080;
}

body.dark .toolbar-btn {
    background: rgba(255, 200, 100, 0.12);
    color: #ffd080;
}

body.dark .toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 200, 100, 0.22);
}

body.dark .toolbar-btn-primary {
    background: #c05800;
    color: #fff;
}

body.dark .toolbar-btn-primary:hover:not(:disabled) {
    background: #e06000;
    color: #fff;
}

body.dark .cae-main-content {
    background: #1a1008;
}

/* 暗黑 - 左栏历史 */
body.dark .cae-history-panel {
    background: #120c04;
    border-right-color: #3a2800;
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, #1e1408, #170f04);
    border-bottom-color: #3a2800;
}

body.dark .history-panel-header h3 {
    color: #ffd080;
}

body.dark .history-count {
    background: #3a2800;
    color: #f7971e;
}

body.dark .history-clear-btn {
    background: #3a1000;
    color: #f7971e;
}

body.dark .history-clear-btn:hover {
    background: #5a2000;
}

body.dark .history-search input {
    background: #1a1008;
    border-color: #3a2800;
    color: #ffd080;
}

body.dark .history-search input::placeholder {
    color: #7a5a30;
}

body.dark .history-search input:focus {
    border-color: #f7971e;
}

body.dark .history-empty {
    color: #7a5a30;
}

body.dark .history-item {
    background: #1e1408;
    border-color: #3a2800;
    color: #ffd080;
}

body.dark .history-item:hover {
    background: #2a1c08;
    border-color: #f7971e;
}

body.dark .history-item.active {
    background: #2e1c00;
    border-color: #f7971e;
}

body.dark .history-item-preview {
    color: #ffd080;
}

body.dark .history-item-meta {
    color: #7a5a30;
}

body.dark .history-item-density {
    background: #3a2800;
    color: #ffd080;
}

/* 暗黑 - 中栏输入 */
body.dark .cae-input-panel {
    background: #120c04;
    border-right-color: #3a2800;
}

body.dark .panel-header {
    background: linear-gradient(to bottom, #1e1408, #170f04);
    border-bottom-color: #3a2800;
}

body.dark .panel-header h3 {
    color: #ffd080;
}

body.dark .panel-tip {
    color: #7a5a30;
}

body.dark .form-group label {
    color: #ffd080;
}

body.dark .char-count {
    color: #7a5a30;
}

body.dark .char-count.warn {
    color: #f7971e;
}

body.dark .char-count.danger {
    color: #ef4444;
}

body.dark .cae-textarea {
    background: #1a1008;
    border-color: #3a2800;
    color: #ffd0a0;
}

body.dark .cae-textarea:focus {
    border-color: #f7971e;
    box-shadow: 0 0 0 2px rgba(247, 151, 30, 0.15);
}

body.dark .cae-textarea:disabled {
    background: #120c04;
    color: #7a5a30;
}

body.dark .cae-textarea::placeholder {
    color: #7a5a30;
}

body.dark .nm-textarea-hint {
    color: #7a5a30;
}

body.dark .cae-select {
    background-color: #1a1008;
    border-color: #3a2800;
    color: #ffd0a0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%237a5a30'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}

body.dark .cae-select:focus {
    border-color: #f7971e;
}

body.dark .cae-select:disabled {
    background-color: #120c04;
    color: #7a5a30;
}

body.dark .cae-select option {
    background: #1a1008;
    color: #ffd0a0;
}

body.dark .density-btn {
    background: #1a1008;
    border-color: #3a2800;
    color: #ffd080;
}

body.dark .density-btn:hover {
    border-color: #f7971e;
    background: #2a1c08;
}

body.dark .density-option input[type="radio"]:checked + .density-btn {
    background: linear-gradient(135deg, #c05800, #a06000);
    border-color: #f7971e;
    color: #fff;
}

body.dark .scene-tag {
    background: #2a1c08;
    border-color: #3a2800;
    color: #ffd080;
}

body.dark .scene-tag:hover {
    background: linear-gradient(135deg, #c05800, #a06000);
    border-color: #f7971e;
    color: #fff;
}

/* 暗黑 - 右栏结果 */
body.dark .cae-result-panel {
    background: #120c04;
}

body.dark .result-regen-btn {
    background: linear-gradient(135deg, #c05800, #a06000);
    color: #ffd080;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

body.dark .result-regen-btn:hover {
    background: linear-gradient(135deg, #e06800, #c07000);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

body.dark .result-time {
    color: #7a5a30;
}

body.dark .result-placeholder {
    background: transparent;
}

body.dark .placeholder-title {
    color: #ffd080;
}

body.dark .placeholder-desc {
    color: #7a5a30;
}

body.dark .loading-text {
    color: #7a5a30;
}

body.dark .result-content--error {
    background: transparent;
}

body.dark .pc-error-text {
    color: #f87171;
}

body.dark .result-card {
    background: linear-gradient(135deg, #1e1408, #170f04);
    border-color: #3a2800;
}

body.dark .result-card-header {
    border-bottom-color: #3a2800;
}

body.dark .result-card-title {
    color: #ffd080;
}

body.dark .result-action-btn {
    background: #2a1c08;
    border-color: #3a2800;
    color: #ffd080;
}

body.dark .result-action-btn:hover {
    background: linear-gradient(135deg, #c05800, #a06000);
    border-color: #f7971e;
    color: #fff;
}

body.dark .result-text-box {
    background: #1a1008;
    border-color: #3a2800;
    color: #ffd0a0;
}

body.dark .result-stat-item {
    background: #2a1c08;
    color: #7a5a30;
}

body.dark .result-stat-item strong {
    color: #f7971e;
}

/* 暗黑 - 模态框 */
body.dark .cae-modal-overlay {
    background: rgba(0, 0, 0, 0.6);
}

body.dark .cae-modal-content {
    background: #1a1008;
}

body.dark .cae-modal-header {
    background: linear-gradient(to bottom, #1e1408, #170f04);
    border-bottom-color: #3a2800;
}

body.dark .cae-modal-header h3 {
    color: #ffd080;
}

body.dark .example-card {
    background: #1e1408;
    border-color: #3a2800;
}

body.dark .example-card:hover {
    border-color: #f7971e;
    background: #2a1c08;
}

body.dark .example-card-title {
    color: #ffd080;
}

body.dark .example-card-preview {
    color: #7a5a30;
}

body.dark .example-tag {
    background: #3a2800;
    color: #ffd080;
}

body.dark .cae-toast {
    background: rgba(255, 200, 100, 0.15);
    color: #ffd080;
    border: 1px solid #3a2800;
}

/* ========== 暗黑模式滚动条轨道视觉覆盖 ========== */
body.dark .history-list::-webkit-scrollbar-track,
body.dark .cae-input-body::-webkit-scrollbar-track,
body.dark .cae-result-body::-webkit-scrollbar-track,
body.dark .cae-result-content::-webkit-scrollbar-track,
body.dark .cae-modal-body::-webkit-scrollbar-track {
    background: #1a1008;
}

body.dark .history-list::-webkit-scrollbar-thumb,
body.dark .cae-input-body::-webkit-scrollbar-thumb,
body.dark .cae-result-body::-webkit-scrollbar-thumb,
body.dark .cae-result-content::-webkit-scrollbar-thumb,
body.dark .cae-modal-body::-webkit-scrollbar-thumb {
    background: #7a4500;
}

body.dark .history-list::-webkit-scrollbar-thumb:hover,
body.dark .cae-input-body::-webkit-scrollbar-thumb:hover,
body.dark .cae-result-body::-webkit-scrollbar-thumb:hover,
body.dark .cae-result-content::-webkit-scrollbar-thumb:hover,
body.dark .cae-modal-body::-webkit-scrollbar-thumb:hover {
    background: #c05800;
}
