/* =============================================
   书籍读后感 - book_review.css
   书卷气风格：暖棕 + 奶油色纸张质感
   暗黑模式以 body.dark 为父级选择器前缀
   ============================================= */

/* ========== CSS 变量 ========== */
:root {
    --br-primary:        #92400e;
    --br-primary-light:  #b45309;
    --br-accent:         #d97706;
    --br-accent-light:   #fbbf24;
    --br-bg:             #fdf8f0;
    --br-panel-bg:       #ffffff;
    --br-border:         #e7d5c2;
    --br-text:           #3d2b1f;
    --br-text-sub:       #78614e;
    --br-text-muted:     #a8907a;
    --br-star-active:    #f59e0b;
    --br-star-empty:     #d1c4b8;
}

/* ========== 主容器 ========== */
.br-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: var(--br-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(92, 53, 14, 0.1);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.br-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    min-height: unset;
}

/* ========== 顶部工具栏 ========== */
.br-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #6b3310 0%, #b45309 100%);
    color: #fff;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(107, 51, 16, 0.35);
    flex-shrink: 0;
}

.toolbar-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.5px;
    margin-right: 6px;
}

.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: #7c3e12;
    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;
}

/* 主操作按钮 - AI生成 */
.toolbar-btn-primary {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(180, 83, 9, 0.4);
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.5);
    color: #fff;
}

/* 当主按钮禁用时，明确降级样式 */
.toolbar-btn-primary:disabled {
    background: rgba(180, 83, 9, 0.35);
    color: rgba(255, 255, 255, 0.5);
    box-shadow: none;
    cursor: not-allowed;
}

/* 取消按钮 */
.toolbar-btn-cancel {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}

.toolbar-btn-cancel:hover:not(:disabled) {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: #fff;
}

/* ========== 主内容区：三栏 ========== */
.br-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: var(--br-bg);
}

/* ========== 左栏：历史记录 ========== */
.br-history-panel {
    width: 210px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid var(--br-border);
    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, #fdf5eb 0%, #f5e9d6 100%);
    border-bottom: 1px solid var(--br-border);
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--br-primary);
}

.history-count {
    font-size: 11px;
    color: var(--br-text-muted);
    font-weight: 400;
}

.history-clear-btn {
    background: #fff3e6;
    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 var(--br-border);
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--br-border);
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: var(--br-text);
    background: #fff;
}

.history-search input:focus {
    border-color: var(--br-accent);
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.1);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.history-empty {
    text-align: center;
    color: var(--br-text-muted);
    font-size: 12px;
    padding: 24px 12px;
    line-height: 1.6;
}

/* 历史条目 */
.history-item {
    display: flex;
    flex-direction: column;
    padding: 9px 11px;
    margin-bottom: 4px;
    background: #fdf8f0;
    border: 1px solid #edddc9;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: br-fadeIn 0.2s ease;
}

@keyframes br-fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.history-item:hover {
    background: #fbefd8;
    border-color: var(--br-accent-light);
    transform: translateX(2px);
}

.history-item.active {
    background: #fef3c7;
    border-color: var(--br-accent);
    box-shadow: 0 1px 4px rgba(217, 119, 6, 0.2);
}

.history-item-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: #fff0f0;
    color: #ef4444;
    border-radius: 3px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    background: #ef4444;
    color: #fff;
}

.history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--br-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 20px;
    margin-bottom: 3px;
}

.history-item-meta {
    font-size: 11px;
    color: var(--br-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-stars {
    font-size: 11px;
    color: var(--br-star-active);
    margin-top: 2px;
}

/* ========== 中栏：输入面板 ========== */
.br-input-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid var(--br-border);
    overflow: hidden;
    min-width: 320px;
}

/* ========== 右栏：结果面板 ========== */
.br-result-panel {
    width: 42%;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
    min-width: 280px;
}

/* ========== 面板公共 Header ========== */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #fdf5eb 0%, #f5e9d6 100%);
    border-bottom: 1px solid var(--br-border);
    flex-shrink: 0;
    gap: 10px;
}

.panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--br-primary);
    white-space: nowrap;
}

.panel-tip {
    font-size: 11px;
    color: var(--br-text-muted);
    flex: 1;
    text-align: right;
}

/* 结果 Meta 信息 */
.result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.result-meta-book {
    font-size: 12px;
    font-weight: 600;
    color: var(--br-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-char-count {
    font-size: 11px;
    color: var(--br-text-muted);
    background: #f5e9d6;
    padding: 1px 7px;
    border-radius: 8px;
}

.result-time {
    font-size: 11px;
    color: var(--br-text-muted);
}

/* ========== 输入面板内容 ========== */
.br-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--br-text-sub);
    margin-bottom: 5px;
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.form-group-half {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.required-mark {
    color: #ef4444;
    margin-left: 2px;
}

.label-tip {
    font-size: 11px;
    color: var(--br-text-muted);
    font-weight: 400;
    margin-left: 4px;
}

/* 输入框 */
.br-input {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--br-border);
    border-radius: 5px;
    font-size: 13px;
    color: var(--br-text);
    background: #fff;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.br-input:focus {
    border-color: var(--br-accent);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.br-input.shake {
    animation: shake 0.45s ease-in-out;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15%, 55%, 85% { transform: translateX(-5px); }
    35%, 70% { transform: translateX(5px); }
}

/* 下拉框 */
.br-select {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--br-border);
    border-radius: 5px;
    font-size: 13px;
    color: var(--br-text);
    background: #fff;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a8907a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.br-select:focus {
    border-color: var(--br-accent);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

/* 文本区域 */
.br-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--br-border);
    border-radius: 5px;
    font-size: 13px;
    color: var(--br-text);
    background: #fff;
    outline: none;
    resize: vertical;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.65;
    min-height: 120px;
}

.br-textarea:focus {
    border-color: var(--br-accent);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.br-textarea.shake {
    animation: shake 0.45s ease-in-out;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

.br-textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.br-textarea-hint {
    font-size: 11px;
    color: var(--br-text-muted);
}

.notes-char-count {
    font-size: 11px;
    color: var(--br-text-muted);
}

/* ========== 星级评分 ========== */
.star-rating-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.star-rating {
    display: flex;
    gap: 2px;
}

.star {
    font-size: 22px;
    color: var(--br-star-empty);
    cursor: pointer;
    transition: color 0.15s, transform 0.12s;
    user-select: none;
    line-height: 1;
}

.star:hover,
.star.active {
    color: var(--br-star-active);
}

.star:hover {
    transform: scale(1.15);
}

.star:active {
    transform: scale(0.95);
}

.rating-label {
    font-size: 12px;
    color: var(--br-text-muted);
    min-width: 50px;
    transition: color 0.2s;
}

.rating-label.rated {
    color: var(--br-accent);
    font-weight: 600;
}

/* ========== 结果面板内容 ========== */
.br-result-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 初始占位 */
.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    color: var(--br-text-muted);
    flex: 1;
    margin: auto;
}

.placeholder-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.5;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

.placeholder-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--br-text-sub);
    margin: 0 0 8px 0;
}

.placeholder-desc {
    font-size: 12px;
    color: var(--br-text-muted);
    margin: 4px 0 0 0;
    line-height: 1.6;
}

/* 加载中 */
.result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex: 1;
    margin: auto;
    padding: 40px 24px;
}

.loading-book-anim {
    font-size: 48px;
    animation: bookPulse 1.4s ease-in-out infinite;
    display: block;
}

@keyframes bookPulse {
    0%, 100% { transform: scale(1) rotate(-3deg); opacity: 0.8; }
    50%       { transform: scale(1.1) rotate(3deg); opacity: 1; }
}

.loading-dots {
    display: flex;
    gap: 6px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--br-accent);
    animation: dots 1.2s infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dots {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
    40%            { transform: scale(1.1); opacity: 1; }
}

.loading-text {
    font-size: 13px;
    color: var(--br-text-muted);
    margin: 0;
}

/* 结果内容 */
.result-content {
    padding: 20px 20px 24px;
    font-size: 14px;
    line-height: 1.9;
    color: var(--br-text);
    white-space: pre-line;
    word-break: break-word;
    font-family: 'STSong', 'SimSun', 'Georgia', 'Times New Roman', serif;
    background: #fffdf8;
    border-left: 3px solid #f5e9d6;
    letter-spacing: 0.02em;
    flex: 1;
}

/* 结果内容入场动效 */
@keyframes brResultEnter {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-content.result-enter-anim {
    animation: brResultEnter 0.35s ease-out both;
}

/* ========== 错误块 ========== */
.result-error-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    flex: 1;
    margin: auto;
}

.result-error-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.85;
}

.result-error-msg {
    font-size: 13px;
    color: #92400e;
    margin: 0 0 18px 0;
    line-height: 1.65;
    max-width: 260px;
}

.result-error-retry {
    padding: 7px 20px;
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(180, 83, 9, 0.3);
}

.result-error-retry:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.35);
}

/* ========== 自定义滚动条 ========== */
.history-list::-webkit-scrollbar,
.br-input-body::-webkit-scrollbar,
.br-result-body::-webkit-scrollbar,
.br-modal-body::-webkit-scrollbar { width: 4px; }

.history-list::-webkit-scrollbar-track,
.br-input-body::-webkit-scrollbar-track,
.br-result-body::-webkit-scrollbar-track,
.br-modal-body::-webkit-scrollbar-track { background: transparent; }

.history-list::-webkit-scrollbar-thumb,
.br-input-body::-webkit-scrollbar-thumb,
.br-result-body::-webkit-scrollbar-thumb,
.br-modal-body::-webkit-scrollbar-thumb {
    background: rgba(180, 83, 9, 0.22);
    border-radius: 2px;
}

.history-list::-webkit-scrollbar-thumb:hover,
.br-input-body::-webkit-scrollbar-thumb:hover,
.br-result-body::-webkit-scrollbar-thumb:hover,
.br-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(180, 83, 9, 0.44);
}

/* ========== 模态框 ========== */
.br-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(60, 30, 5, 0.35);
    z-index: 100000;
    backdrop-filter: blur(2px);
}

.br-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100001;
    width: 680px;
    max-width: 92vw;
    max-height: 82vh;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(60, 30, 5, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalIn 0.22s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: translate(-50%, -55%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

.br-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(to bottom, #fdf5eb 0%, #f5e9d6 100%);
    border-bottom: 1px solid var(--br-border);
    flex-shrink: 0;
}

.br-modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--br-primary);
}

.br-modal-close {
    width: 28px; height: 28px;
    background: #fff;
    border: 1px solid var(--br-border);
    color: var(--br-text-muted);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.br-modal-close:hover {
    background: #fde8e8;
    color: #ef4444;
    border-color: #fca5a5;
}

.br-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 12px;
    align-content: start;
}

/* 示例卡片 */
.example-card {
    padding: 12px 14px;
    border: 1px solid var(--br-border);
    border-radius: 7px;
    background: #fdfaf5;
    cursor: pointer;
    transition: all 0.18s;
}

.example-card:hover {
    border-color: var(--br-accent);
    background: #fef3c7;
    box-shadow: 0 3px 10px rgba(217, 119, 6, 0.12);
    transform: translateY(-1px);
}

.example-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.example-card-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.example-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--br-text);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.example-card-badge {
    font-size: 10px;
    padding: 1px 7px;
    background: #fff3d6;
    color: var(--br-accent);
    border-radius: 8px;
    border: 1px solid #fde68a;
    white-space: nowrap;
}

.example-card-desc {
    font-size: 12px;
    color: var(--br-text-muted);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ========== Toast 提示 ========== */
.br-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(60, 30, 5, 0.85);
    color: #fff;
    padding: 9px 20px;
    border-radius: 6px;
    font-size: 13px;
    z-index: 200000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.br-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.br-toast.success { background: rgba(22, 101, 52, 0.9); }
.br-toast.error   { background: rgba(153, 27, 27, 0.9); }
.br-toast.info    { background: rgba(30, 58, 138, 0.9); }

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .br-result-panel { width: 38%; }
}

@media (max-width: 768px) {
    .br-main-content { flex-direction: column; }
    .br-history-panel { width: 100%; height: 140px; border-right: none; border-bottom: 1px solid var(--br-border); }
    .br-result-panel  { width: 100%; min-width: unset; }
    .br-input-panel   { min-width: unset; }
    .form-row         { flex-direction: column; gap: 0; }
    .form-group-half  { flex: none; width: 100%; margin-bottom: 12px; }
    .br-toolbar       { gap: 4px; }
    .toolbar-title    { display: none; }
}

/* ========== 暗黑模式 ========== */
body.dark {
    --br-bg:           #1a1108;
    --br-panel-bg:     #211507;
    --br-border:       rgba(200, 160, 100, 0.2);
    --br-text:         #e8d5c0;
    --br-text-sub:     #c4a882;
    --br-text-muted:   #8c7060;
    --br-star-empty:   #4a3828;
}

body.dark .br-container {
    background: var(--br-bg);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}

body.dark .br-toolbar {
    background: linear-gradient(135deg, #3d1c06 0%, #5a2e0a 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark .toolbar-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #e8d5c0;
    border: 1px solid rgba(200, 160, 100, 0.2);
}

body.dark .toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

body.dark .toolbar-btn-primary {
    background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
    color: #fff;
    border: none;
}

body.dark .toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

body.dark .toolbar-btn-primary:disabled {
    background: rgba(146, 64, 14, 0.3);
    color: rgba(255, 255, 255, 0.35);
    box-shadow: none;
    border: 1px solid rgba(146, 64, 14, 0.2);
}

body.dark .toolbar-btn-cancel {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: #fff;
    border: none;
}

body.dark .br-main-content {
    background: var(--br-bg);
}

body.dark .br-history-panel,
body.dark .br-input-panel,
body.dark .br-result-panel {
    background: #1d1209;
    border-color: var(--br-border);
}

body.dark .history-panel-header,
body.dark .panel-header {
    background: linear-gradient(to bottom, #2a1a08 0%, #231508 100%);
    border-color: var(--br-border);
}

body.dark .history-panel-header h3,
body.dark .panel-header h3 {
    color: #d4a574;
}

body.dark .history-search input {
    background: #120d05;
    border-color: var(--br-border);
    color: var(--br-text);
}

body.dark .history-search input::placeholder {
    color: var(--br-text-muted);
}

body.dark .history-item {
    background: #2a1a08;
    border-color: rgba(160, 100, 40, 0.3);
}

body.dark .history-item:hover {
    background: #321f0a;
    border-color: rgba(217, 119, 6, 0.5);
}

body.dark .history-item.active {
    background: #3d2508;
    border-color: var(--br-accent);
    box-shadow: 0 1px 4px rgba(217, 119, 6, 0.3);
}

body.dark .history-item-title {
    color: var(--br-text);
}

body.dark .br-input,
body.dark .br-select,
body.dark .br-textarea {
    background: #120d05;
    border-color: var(--br-border);
    color: var(--br-text);
}

body.dark .br-input:focus,
body.dark .br-select:focus,
body.dark .br-textarea:focus {
    border-color: var(--br-accent);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

body.dark .br-input::placeholder,
body.dark .br-textarea::placeholder {
    color: var(--br-text-muted);
}

body.dark .br-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238c7060' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

body.dark .result-content {
    background: #1d1209;
    color: var(--br-text);
    border-left-color: rgba(180, 83, 9, 0.4);
}

body.dark .br-result-body {
    background: #1d1209;
}

body.dark .result-error-msg {
    color: #fbbf24;
}

body.dark .result-error-retry {
    background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
}

body.dark .result-error-retry:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

body.dark .result-placeholder,
body.dark .result-loading {
    background: transparent;
}

body.dark .result-char-count {
    background: rgba(180, 83, 9, 0.2);
    color: #b89a82;
}

body.dark .br-modal {
    background: #1d1209;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

body.dark .br-modal-header {
    background: linear-gradient(to bottom, #2a1a08 0%, #231508 100%);
    border-color: var(--br-border);
}

body.dark .br-modal-close {
    background: #2a1a08;
    border-color: var(--br-border);
    color: var(--br-text-muted);
}

body.dark .br-modal-body {
    background: #1d1209;
}

body.dark .example-card {
    background: #2a1a08;
    border-color: var(--br-border);
}

body.dark .example-card:hover {
    background: #321f0a;
    border-color: var(--br-accent);
}

body.dark .example-card-title {
    color: var(--br-text);
}

body.dark .example-card-badge {
    background: rgba(180, 83, 9, 0.2);
    color: var(--br-accent-light);
    border-color: rgba(180, 83, 9, 0.3);
}

body.dark .form-group label {
    color: var(--br-text-sub);
}

body.dark .star {
    color: var(--br-star-empty);
}

body.dark .star:hover,
body.dark .star.active {
    color: var(--br-star-active);
}

body.dark .br-toast {
    background: rgba(230, 200, 160, 0.95);
    color: #3d1c06;
}

body.dark .br-toast.success { background: rgba(22, 101, 52, 0.95); color: #fff; }
body.dark .br-toast.error   { background: rgba(153, 27, 27, 0.95); color: #fff; }
body.dark .br-toast.info    { background: rgba(29, 78, 216, 0.95); color: #fff; }

/* 暗黑模式自定义滚动条 */
body.dark .history-list::-webkit-scrollbar-thumb,
body.dark .br-input-body::-webkit-scrollbar-thumb,
body.dark .br-result-body::-webkit-scrollbar-thumb,
body.dark .br-modal-body::-webkit-scrollbar-thumb {
    background: rgba(200, 140, 60, 0.28);
}

body.dark .history-list::-webkit-scrollbar-thumb:hover,
body.dark .br-input-body::-webkit-scrollbar-thumb:hover,
body.dark .br-result-body::-webkit-scrollbar-thumb:hover,
body.dark .br-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(200, 140, 60, 0.52);
}

body.dark .history-clear-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

body.dark .history-clear-btn:hover {
    background: rgba(239, 68, 68, 0.22);
}

body.dark .br-modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

body.dark .br-select option {
    background: #120d05;
    color: var(--br-text);
}

body.dark .panel-tip,
body.dark .br-textarea-hint,
body.dark .notes-char-count,
body.dark .label-tip {
    color: #9d8470;
}

body.dark .loading-text {
    color: #b89a82;
}

body.dark .history-item-meta {
    color: #9d8470;
}

body.dark .result-meta-book {
    color: #d4a574;
}

body.dark .result-time {
    color: #9d8470;
}

body.dark .history-count {
    color: #9d8470;
}

body.dark .placeholder-desc {
    color: #9d8470;
}

body.dark .rating-label {
    color: #9d8470;
}

body.dark .rating-label.rated {
    color: #fbbf24;
    font-weight: 600;
}

body.dark .example-card-desc {
    color: #9d8470;
}
