/* ================================================
   标题优化 - title_optimization.css
   主题：暖橙/琥珀渐变，内容创作感，活力写作风格
   暗黑模式：body.dark 前缀
   ================================================ */

/* ---------- 根容器 ---------- */
.to-container {
    display: flex;
    flex-direction: column;
    height: 660px;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    overflow: hidden;
    background: #fffbf5;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    box-shadow: 0 2px 16px rgba(217, 119, 6, 0.10);
    transition: height 0.3s;
}

.to-container.fullscreen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9000;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
}

/* ---------- 工具栏 ---------- */
.to-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    height: 48px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #92400e 0%, #d97706 100%);
    border-bottom: 2px solid #b45309;
}

.to-toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: #fef3c7;
    letter-spacing: 0.5px;
    margin-right: 4px;
    white-space: nowrap;
}

.to-toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.to-toolbar-group:not(:last-child) {
    padding-right: 10px;
    border-right: 1px solid rgba(255,255,255,0.25);
    margin-right: 2px;
}

.to-toolbar-group:last-child {
    margin-left: auto;
}

.to-toolbar-btn {
    height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 5px;
    background: rgba(255,255,255,0.12);
    color: #fef3c7;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s;
}

.to-toolbar-btn:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    color: #fff;
    transform: translateY(-1px);
}

.to-toolbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
}

.to-toolbar-btn-primary {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.55);
    font-weight: 600;
}

.to-toolbar-btn-primary:hover {
    background: rgba(255,255,255,0.38);
}

.to-toolbar-btn-primary:disabled {
    background: rgba(255,255,255,0.10);
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ---------- 三栏主体 ---------- */
.to-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* ======= 左栏：历史记录 ======= */
.to-history-panel {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #fed7aa;
    background: #fff8f0;
    overflow: hidden;
}

.to-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px 8px;
    border-bottom: 1px solid #fed7aa;
    background: linear-gradient(to bottom, #fef3c7 0%, #fde68a 100%);
    flex-shrink: 0;
}

.to-history-header h3 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
    background: none;
    border: none;
    padding: 0;
}

.to-history-count {
    font-size: 11px;
    color: #d97706;
    font-weight: normal;
}

.to-history-clear-btn {
    background: #fff8f0;
    border: 1px solid #fbbf24;
    color: #b45309;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 3px;
    transition: all 0.2s;
    white-space: nowrap;
}

.to-history-clear-btn:hover {
    background: #fde68a;
    border-color: #d97706;
}

.to-history-search {
    padding: 8px 10px;
    border-bottom: 1px solid #fed7aa;
    flex-shrink: 0;
}

.to-history-search input {
    width: 100%;
    height: 26px;
    padding: 0 8px;
    border: 1px solid #fbbf24;
    border-radius: 4px;
    font-size: 11px;
    background: #fff;
    color: #92400e;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.to-history-search input:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 2px rgba(217,119,6,0.12);
}

.to-history-list {
    flex: 1;
    overflow-y: auto;
}

.to-history-list::-webkit-scrollbar { width: 5px; }
.to-history-list::-webkit-scrollbar-track { background: #fff8f0; }
.to-history-list::-webkit-scrollbar-thumb { background: #fbbf24; border-radius: 3px; }
.to-history-list::-webkit-scrollbar-thumb:hover { background: #d97706; }

.to-history-empty {
    padding: 20px 12px;
    text-align: center;
    font-size: 12px;
    color: #92400e;
    opacity: 0.6;
    line-height: 1.8;
}

.to-history-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    margin: 4px 8px;
    background: #fff;
    border: 1px solid #fde68a;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.to-history-item:hover {
    background: #fffbeb;
    border-color: #fbbf24;
    transform: translateX(2px);
}

.to-history-item.active {
    background: #fef3c7;
    border-left: 3px solid #1e40af;
    box-shadow: 0 1px 4px rgba(30,64,175,0.12);
}

.to-history-item-main {
    flex: 1;
    min-width: 0;
}

.to-history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.to-history-item-meta {
    display: flex;
    gap: 4px;
    font-size: 10px;
    color: #78716c;
    flex-wrap: wrap;
}

.to-history-item-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 0 4px;
    border-radius: 3px;
    font-size: 10px;
    border: 1px solid #fde68a;
}

.to-history-item-del {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    background: #fee2e2;
    color: #ef4444;
    border: none;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.to-history-item:hover .to-history-item-del {
    opacity: 1;
}

.to-history-item-del:hover {
    background: #ef4444;
    color: #fff;
}

/* ======= 中栏：输入区域 ======= */
.to-input-panel {
    width: 290px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #fed7aa;
    background: #fff;
    overflow: hidden;
}

.to-input-header {
    padding: 12px 14px 10px;
    border-bottom: 1px solid #fde68a;
    background: linear-gradient(to bottom, #fffbf5 0%, #fff8f0 100%);
    flex-shrink: 0;
}

.to-input-header h3 {
    margin: 0 0 2px 0;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
}

.to-input-tip {
    font-size: 11px;
    color: #78716c;
}

.to-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}

.to-input-body::-webkit-scrollbar { width: 5px; }
.to-input-body::-webkit-scrollbar-track { background: #fffbf5; }
.to-input-body::-webkit-scrollbar-thumb { background: #fbbf24; border-radius: 3px; }
.to-input-body::-webkit-scrollbar-thumb:hover { background: #d97706; }

/* 字段组 */
.to-field-group {
    margin-bottom: 14px;
}

.to-field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #78716c;
    margin-bottom: 6px;
}

.to-title-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #fbbf24;
    border-radius: 6px;
    font-size: 13px;
    color: #44403c;
    background: #fff;
    outline: none;
    transition: all 0.2s;
    resize: vertical;
    min-height: 68px;
    line-height: 1.6;
    box-sizing: border-box;
    font-family: inherit;
}

.to-title-input:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217,119,6,0.12);
}

.to-title-input::placeholder {
    color: #a8a29e;
    font-size: 12px;
}

.to-char-counter {
    text-align: right;
    font-size: 11px;
    color: #a8a29e;
    margin-top: 4px;
}

.to-char-counter.warning { color: #f59e0b; }
.to-char-counter.limit { color: #ef4444; }

/* 选项组 */
.to-option-group {
    margin-bottom: 14px;
}

.to-option-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #78716c;
    margin-bottom: 8px;
}

.to-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.to-option {
    padding: 4px 10px;
    border: 1px solid #d6d3d1;
    border-radius: 16px;
    font-size: 12px;
    color: #57534e;
    background: #fafaf9;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
    user-select: none;
}

.to-option:hover {
    border-color: #d97706;
    color: #92400e;
    background: #fffbeb;
}

.to-option.selected {
    background: linear-gradient(135deg, #92400e 0%, #d97706 100%);
    border-color: #b45309;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 1px 6px rgba(180,83,9,0.25);
}

/* 使用说明 */
.to-tips-box {
    padding: 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    font-size: 12px;
    color: #57534e;
    line-height: 1.6;
}

.to-tips-box p {
    margin: 0 0 6px 0;
    font-weight: 600;
    color: #b45309;
}

.to-tips-box ul {
    margin: 0;
    padding-left: 16px;
}

.to-tips-box li {
    margin-bottom: 3px;
}

.to-tips-box li::marker {
    color: #d97706;
}

/* ======= 右栏：优化结果 ======= */
.to-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fffdf8;
    overflow: hidden;
    min-width: 0;
}

.to-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 10px;
    border-bottom: 1px solid #fde68a;
    background: linear-gradient(to bottom, #fffbf5 0%, #fff8f0 100%);
    flex-shrink: 0;
}

.to-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
}

.to-result-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

.to-result-char-count {
    font-size: 11px;
    color: #a8a29e;
    margin-left: auto;
}

.to-result-time {
    font-size: 11px;
    color: #a8a29e;
}

.to-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

.to-result-body::-webkit-scrollbar { width: 6px; }
.to-result-body::-webkit-scrollbar-track { background: #fffbf5; }
.to-result-body::-webkit-scrollbar-thumb { background: #fbbf24; border-radius: 3px; }
.to-result-body::-webkit-scrollbar-thumb:hover { background: #d97706; }

/* 占位提示 */
.to-result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    text-align: center;
    color: #a8a29e;
    padding: 20px;
}

.to-placeholder-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.65;
    animation: pulseIcon 2.8s ease-in-out infinite;
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); opacity: 0.65; }
    50% { transform: scale(1.1); opacity: 0.9; }
}

.to-placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: #78716c;
    margin: 0 0 8px 0;
}

.to-placeholder-desc {
    font-size: 13px;
    color: #a8a29e;
    margin: 3px 0;
}

/* 占位快速体验标签 */
.to-quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

.to-quick-tag {
    padding: 4px 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 14px;
    font-size: 12px;
    color: #92400e;
    cursor: pointer;
    transition: all 0.2s;
}

.to-quick-tag:hover {
    background: #fef3c7;
    border-color: #fbbf24;
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 2px 6px rgba(217,119,6,0.15);
}

/* 加载中 */
.to-result-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.to-loading-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.to-loading-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fbbf24;
    animation: toDotBounce 1.2s infinite ease-in-out both;
}

.to-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.to-loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.to-loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes toDotBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.to-loading-text {
    font-size: 13px;
    color: #d97706;
    font-weight: 500;
}

/* 结果内容 */
.to-result-content {
    flex: 1;
}

/* 入场动效（仅通过 JS 添加 .result-enter-anim 触发，避免双重播放） */
.to-result-content.result-enter-anim {
    animation: toResultEnter 0.38s ease;
}

@keyframes toResultEnter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 错误提示 */
#toResultError {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.to-error-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    text-align: center;
}

.to-error-icon { font-size: 40px; margin-bottom: 12px; }
.to-error-msg { font-size: 14px; color: #dc2626; margin: 0 0 6px 0; }
.to-error-tip { font-size: 12px; color: #a8a29e; margin: 0 0 16px 0; }

.to-retry-btn {
    padding: 8px 20px;
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    color: #b45309;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.to-retry-btn:hover {
    background: #fef3c7;
    border-color: #d97706;
}

/* ======= AI 生成结果卡片样式 ======= */
.to-result-card {
    background: #fff;
    border: 1px solid #fde68a;
    border-top: 3px solid #d97706;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 8px rgba(217,119,6,0.08);
}

/* 原始标题头部 */
.to-original-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #92400e 0%, #d97706 100%);
    flex-wrap: wrap;
}

.to-original-label {
    font-size: 11px;
    font-weight: 600;
    color: #fde68a;
    background: rgba(255,255,255,0.15);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.25);
    white-space: nowrap;
}

.to-original-text {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
    flex: 1;
    min-width: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* 区块结构 */
.to-section {
    padding: 14px 16px;
    border-bottom: 1px solid #fef3c7;
}

.to-section:last-child {
    border-bottom: none;
}

.to-section-title {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: #b45309;
    border-left: 3px solid #d97706;
    padding-left: 8px;
    line-height: 1.4;
}

/* 诊断部分 */
.to-diagnosis {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.to-diag-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
}

.to-diag-weak {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #7c2d12;
}

.to-diag-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

/* 候选标题 */
.to-candidates {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.to-candidate-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: #fffbf5;
    border: 1px solid #fde68a;
    border-radius: 8px;
    transition: all 0.2s;
}

.to-candidate-item:hover {
    background: #fef3c7;
    border-color: #fbbf24;
    box-shadow: 0 2px 8px rgba(217,119,6,0.12);
    transform: translateX(2px);
}

.to-candidate-rank {
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #92400e 0%, #d97706 100%);
    color: #fff;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(180,83,9,0.3);
}

.to-candidate-item:nth-child(1) .to-candidate-rank { background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%); }
.to-candidate-item:nth-child(2) .to-candidate-rank { background: linear-gradient(135deg, #b45309 0%, #d97706 100%); }

.to-candidate-body {
    flex: 1;
    min-width: 0;
}

.to-candidate-title {
    font-size: 14px;
    font-weight: 700;
    color: #44403c;
    margin-bottom: 6px;
    line-height: 1.5;
    word-break: break-word;
}

.to-candidate-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 5px;
}

.to-ctag {
    display: inline-block;
    padding: 2px 8px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    font-size: 11px;
    color: #92400e;
    font-weight: 500;
}

.to-candidate-reason {
    font-size: 12px;
    color: #78716c;
    line-height: 1.5;
}

.to-copy-single {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 5px;
    color: #b45309;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.to-copy-single:hover {
    background: #fef3c7;
    border-color: #fbbf24;
    transform: scale(1.08);
    box-shadow: 0 2px 6px rgba(217,119,6,0.2);
}

.to-copy-single:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

/* 优化建议 */
.to-tips-list {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: #44403c;
    line-height: 1.8;
}

.to-tips-list li {
    margin-bottom: 4px;
    padding-left: 2px;
}

.to-tips-list li::marker {
    color: #d97706;
}

/* ======= 示例模态框 ======= */
.to-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 10001;
    backdrop-filter: blur(2px);
}

.to-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10002;
    background: #fff;
    border-radius: 10px;
    width: 600px;
    max-width: calc(100vw - 32px);
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(180,83,9,0.18);
    flex-direction: column;
    animation: toModalSlideIn 0.22s ease-out;
}

@keyframes toModalSlideIn {
    from { opacity: 0; transform: translate(-50%, -54%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.to-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #fde68a;
    background: linear-gradient(to bottom, #fffbf5 0%, #fff8f0 100%);
    flex-shrink: 0;
}

.to-modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
}

.to-modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: #fde68a;
    color: #57534e;
    font-size: 14px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.to-modal-close:hover {
    background: #fbbf24;
    color: #92400e;
}

.to-modal-body {
    overflow-y: auto;
    padding: 16px;
    max-height: calc(80vh - 60px);
}

.to-modal-body::-webkit-scrollbar { width: 6px; }
.to-modal-body::-webkit-scrollbar-track { background: #fffbf5; }
.to-modal-body::-webkit-scrollbar-thumb { background: #fbbf24; border-radius: 3px; }
.to-modal-body::-webkit-scrollbar-thumb:hover { background: #d97706; }

.to-example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

.to-example-card {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    background: #fffbf5;
    border: 1px solid #fde68a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    align-items: flex-start;
}

.to-example-card:hover {
    background: #fffbeb;
    border-color: #fbbf24;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(217,119,6,0.12);
}

.to-example-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1.2;
}

.to-example-info { flex: 1; min-width: 0; }

.to-example-title-text {
    font-size: 14px;
    font-weight: 700;
    color: #44403c;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.to-example-badge {
    display: inline-block;
    font-size: 10px;
    color: #b45309;
    background: #fef3c7;
    padding: 1px 7px;
    border-radius: 8px;
    margin-bottom: 4px;
    border: 1px solid #fde68a;
}

.to-example-desc {
    font-size: 12px;
    color: #78716c;
    line-height: 1.4;
}

.to-modal-error {
    text-align: center;
    color: #a8a29e;
    padding: 20px;
    font-size: 13px;
}

/* ======= 抖动动效 ======= */
@keyframes toShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.to-title-input.shake {
    animation: toShake 0.4s ease;
    border-color: #ef4444;
}

/* ======= 暗黑模式 ======= */
body.dark .to-container {
    background: #1c1a17;
    border-color: #78350f;
    box-shadow: 0 2px 16px rgba(0,0,0,0.5);
}

body.dark .to-toolbar {
    background: linear-gradient(135deg, #1c0a00 0%, #78350f 100%);
    border-bottom-color: #92400e;
}

body.dark .to-history-panel {
    background: #1c1510;
    border-right-color: #78350f;
}

body.dark .to-history-header {
    background: linear-gradient(to bottom, #2d1a0a 0%, #261408 100%);
    border-bottom-color: #78350f;
}

body.dark .to-history-header h3 {
    color: #fde68a;
}

body.dark .to-history-count {
    color: #fbbf24;
}

body.dark .to-history-clear-btn {
    background: #2d1a0a;
    border-color: #b45309;
    color: #fbbf24;
}

body.dark .to-history-clear-btn:hover {
    background: #451a03;
    border-color: #d97706;
}

body.dark .to-history-search {
    border-bottom-color: #78350f;
}

body.dark .to-history-search input {
    background: #2c2118;
    border-color: #92400e;
    color: #fef3c7;
}

body.dark .to-history-search input:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 2px rgba(217,119,6,0.2);
}

body.dark .to-history-list::-webkit-scrollbar-track { background: #1c1510; }
body.dark .to-history-list::-webkit-scrollbar-thumb { background: #92400e; }
body.dark .to-history-list::-webkit-scrollbar-thumb:hover { background: #b45309; }

body.dark .to-history-empty {
    color: #a16207;
}

body.dark .to-history-item {
    background: #2c2118;
    border-color: #78350f;
}

body.dark .to-history-item:hover {
    background: #3a2a1a;
    border-color: #b45309;
    transform: translateX(2px);
}

body.dark .to-history-item.active {
    background: #3a2a1a;
    border-left-color: #3b82f6;
    box-shadow: 0 1px 4px rgba(59,130,246,0.18);
}

body.dark .to-history-item-title {
    color: #fde68a;
}

body.dark .to-history-item-meta {
    color: #78716c;
}

body.dark .to-history-item-badge {
    background: #3a2a1a;
    color: #fbbf24;
    border-color: #78350f;
}

body.dark .to-history-item-del {
    background: #3a1a1a;
    color: #f87171;
}

body.dark .to-history-item-del:hover {
    background: #ef4444;
    color: #fff;
}

body.dark .to-input-panel {
    background: #1c1a17;
    border-right-color: #78350f;
}

body.dark .to-input-header {
    background: linear-gradient(to bottom, #261a0f 0%, #221508 100%);
    border-bottom-color: #78350f;
}

body.dark .to-input-header h3 {
    color: #fde68a;
}

body.dark .to-input-tip {
    color: #a8a29e;
}

body.dark .to-input-body::-webkit-scrollbar-track { background: #1c1a17; }
body.dark .to-input-body::-webkit-scrollbar-thumb { background: #92400e; }
body.dark .to-input-body::-webkit-scrollbar-thumb:hover { background: #b45309; }

body.dark .to-field-label {
    color: #a8a29e;
}

body.dark .to-title-input {
    background: #2c2118;
    border-color: #92400e;
    color: #fef3c7;
}

body.dark .to-title-input:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217,119,6,0.2);
}

body.dark .to-title-input::placeholder {
    color: #57534e;
}

body.dark .to-char-counter {
    color: #78716c;
}

body.dark .to-option-label {
    color: #a8a29e;
}

body.dark .to-option {
    background: #2c2118;
    border-color: #57534e;
    color: #a8a29e;
}

body.dark .to-option:hover {
    border-color: #d97706;
    color: #fbbf24;
    background: #3a2a1a;
}

body.dark .to-option.selected {
    background: linear-gradient(135deg, #78350f 0%, #b45309 100%);
    border-color: #d97706;
    color: #fef3c7;
    box-shadow: 0 1px 6px rgba(180,83,9,0.4);
}

body.dark .to-tips-box {
    background: #261a0f;
    border-color: #78350f;
    color: #a8a29e;
}

body.dark .to-tips-box p {
    color: #fbbf24;
}

body.dark .to-result-panel {
    background: #1e1a14;
}

body.dark .to-result-body {
    background: #1e1a14;
}

body.dark .to-result-header {
    background: linear-gradient(to bottom, #261a0f 0%, #221508 100%);
    border-bottom-color: #78350f;
}

body.dark .to-result-header h3 {
    color: #fde68a;
}

body.dark .to-result-meta span {
    color: #57534e;
}

body.dark .to-result-body::-webkit-scrollbar-track { background: #1e1a14; }
body.dark .to-result-body::-webkit-scrollbar-thumb { background: #92400e; }
body.dark .to-result-body::-webkit-scrollbar-thumb:hover { background: #b45309; }

body.dark .to-placeholder-title {
    color: #a8a29e;
}

body.dark .to-placeholder-desc {
    color: #57534e;
}

body.dark .to-quick-tag {
    background: #2c2118;
    border-color: #78350f;
    color: #fbbf24;
}

body.dark .to-quick-tag:hover {
    background: #3a2a1a;
    border-color: #d97706;
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 2px 6px rgba(217,119,6,0.25);
}

body.dark .to-loading-dots span {
    background: #d97706;
}

body.dark .to-loading-text {
    color: #d97706;
}

body.dark .to-result-card {
    background: #2c2118;
    border-color: #78350f;
    border-top-color: #d97706;
}

body.dark .to-original-header {
    background: linear-gradient(135deg, #451a03 0%, #92400e 100%);
}

body.dark .to-candidate-rank {
    background: linear-gradient(135deg, #451a03 0%, #78350f 100%);
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

body.dark .to-candidate-item:nth-child(1) .to-candidate-rank {
    background: linear-gradient(135deg, #78350f 0%, #b45309 100%);
}

body.dark .to-candidate-item:nth-child(2) .to-candidate-rank {
    background: linear-gradient(135deg, #451a03 0%, #92400e 100%);
}

body.dark .to-section {
    border-bottom-color: #3a2a1a;
}

body.dark .to-section-title {
    color: #fbbf24;
    border-left-color: #d97706;
}

body.dark .to-diag-weak {
    background: #3a1f0a;
    border-color: #78350f;
    color: #fde68a;
}

body.dark .to-candidate-item {
    background: #261a0f;
    border-color: #78350f;
}

body.dark .to-candidate-item:hover {
    background: #3a2a1a;
    border-color: #b45309;
    box-shadow: 0 2px 8px rgba(217,119,6,0.2);
    transform: translateX(2px);
}

body.dark .to-candidate-title {
    color: #fef3c7;
}

body.dark .to-ctag {
    background: #3a2a1a;
    border-color: #78350f;
    color: #fbbf24;
}

body.dark .to-candidate-reason {
    color: #a8a29e;
}

body.dark .to-copy-single {
    background: #3a2a1a;
    border-color: #78350f;
    color: #fbbf24;
}

body.dark .to-copy-single:hover {
    background: #451a03;
    border-color: #d97706;
    transform: scale(1.08);
    box-shadow: 0 2px 6px rgba(217,119,6,0.25);
}

body.dark .to-tips-list {
    color: #d6d3d1;
}

body.dark .to-tips-list li::marker {
    color: #d97706;
}

body.dark .to-tips-box li::marker {
    color: #fbbf24;
}

body.dark .to-error-msg {
    color: #f87171;
}

body.dark .to-retry-btn {
    background: #2c2118;
    border-color: #b45309;
    color: #fbbf24;
}

body.dark .to-retry-btn:hover {
    background: #3a2a1a;
    border-color: #d97706;
}

/* 暗黑模式模态框 */
body.dark .to-modal-body::-webkit-scrollbar-track { background: #2c2118; }
body.dark .to-modal-body::-webkit-scrollbar-thumb { background: #92400e; border-radius: 3px; }
body.dark .to-modal-body::-webkit-scrollbar-thumb:hover { background: #b45309; }

body.dark .to-modal {
    background: #2c2118;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

body.dark .to-modal-header {
    background: linear-gradient(to bottom, #261a0f 0%, #221508 100%);
    border-bottom-color: #78350f;
}

body.dark .to-modal-header h3 {
    color: #fde68a;
}

body.dark .to-modal-close {
    background: #3a2a1a;
    color: #fbbf24;
}

body.dark .to-modal-close:hover {
    background: #451a03;
    color: #fff;
}

body.dark .to-example-card {
    background: #261a0f;
    border-color: #78350f;
}

body.dark .to-example-card:hover {
    background: #3a2a1a;
    border-color: #b45309;
    box-shadow: 0 3px 10px rgba(217,119,6,0.2);
}

body.dark .to-example-title-text {
    color: #fef3c7;
}

body.dark .to-example-badge {
    background: #3a2a1a;
    color: #fbbf24;
    border-color: #78350f;
}

body.dark .to-example-desc {
    color: #a8a29e;
}

body.dark .to-modal-error {
    color: #57534e;
}

/* ======= 响应式适配 ======= */
@media (max-width: 900px) {
    .to-history-panel { width: 160px; }
    .to-input-panel { width: 240px; }
}

@media (max-width: 700px) {
    .to-main-content { flex-direction: column; }
    .to-history-panel { width: 100%; height: 140px; border-right: none; border-bottom: 1px solid #fed7aa; }
    .to-input-panel { width: 100%; height: 220px; border-right: none; border-bottom: 1px solid #fed7aa; }
    .to-result-panel { flex: 1; }
    body.dark .to-history-panel { border-bottom-color: #78350f; }
    body.dark .to-input-panel { border-bottom-color: #78350f; }
}
