/* =============================================
   春联生成 - couplet_creation.css
   春节喜庆主题，三栏布局，支持暗黑模式
   ============================================= */

/* ========== 主容器 ========== */
.cc-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #fff9f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(180, 30, 30, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #f5d0a9;
}

/* 全屏模式 */
.cc-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;
}

/* ========== 顶部工具栏 ========== */
.cc-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #c0392b 0%, #8b0000 50%, #c0392b 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(139, 0, 0, 0.4);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* 工具栏装饰背景纹 */
.cc-toolbar::before {
    content: '福 春 喜 🏮 福 春 喜 🏮 福 春 喜 🏮 福 春 喜 🏮';
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.08);
    white-space: nowrap;
    pointer-events: none;
    letter-spacing: 8px;
}

.cc-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 220, 180, 0.95);
    letter-spacing: 1px;
    margin-right: 8px;
    position: relative;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
    position: relative;
}

.cc-toolbar-btn {
    padding: 5px 11px;
    background: rgba(255, 245, 220, 0.92);
    border: 1px solid rgba(255, 200, 100, 0.5);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #8b0000;
    transition: all 0.2s;
    white-space: nowrap;
    position: relative;
}

.cc-toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(139, 0, 0, 0.25);
    border-color: #e8a800;
}

.cc-toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.cc-toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* 主操作按钮（生成春联） */
.cc-toolbar-btn-primary {
    background: linear-gradient(135deg, #f5a623 0%, #e8850a 100%);
    color: #fff;
    font-weight: 600;
    border: 1px solid rgba(255, 200, 80, 0.6);
    box-shadow: 0 2px 6px rgba(232, 133, 10, 0.5);
}

.cc-toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #f7b73a 0%, #f5a623 100%);
    box-shadow: 0 4px 12px rgba(232, 133, 10, 0.6);
    color: #fff;
}

/* Shake 抖动动画 */
@keyframes cc-shake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-5px); }
    30%, 70% { transform: translateX(5px); }
}

.cc-input.shake, .cc-select.shake, .cc-textarea.shake {
    animation: cc-shake 0.5s ease-in-out;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

/* ========== 主内容区：三栏 ========== */
.cc-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #fff9f0;
}

/* ========== 左栏：历史记录 ========== */
.cc-history-panel {
    width: 200px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #f5d0a9;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 12px;
    background: linear-gradient(to bottom, #fff9f0 0%, #fef0e0 100%);
    border-bottom: 1px solid #f5d0a9;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #8b0000;
}

.history-count {
    font-size: 11px;
    color: #b87333;
    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: 7px;
    border-bottom: 1px solid #f5d0a9;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #f5d0a9;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
    background: #fff;
}

.history-search input:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.1);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list::-webkit-scrollbar-thumb { background: #f5d0a9; border-radius: 2px; }
.history-list::-webkit-scrollbar-thumb:hover { background: #e8a070; }

.history-empty {
    text-align: center;
    color: #b87333;
    font-size: 12px;
    padding: 24px 8px;
    opacity: 0.7;
}

.history-item {
    padding: 9px 10px;
    cursor: pointer;
    border-bottom: 1px solid #fef0e0;
    border-left: 3px solid transparent; /* 预占位，防止激活时布局抖动 */
    transition: background 0.15s, border-left-color 0.2s;
    position: relative;
    padding-right: 26px; /* 给删除按钮留空 */
}

.history-item:hover { background: #fff5e8; }

.history-item.active {
    background: linear-gradient(to right, #fff0e0, #fff9f5);
    border-left-color: #c0392b;
}

.history-item-theme {
    font-size: 12px;
    font-weight: 600;
    color: #8b0000;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-meta {
    font-size: 11px;
    color: #b87333;
    display: flex;
    gap: 6px;
}

.history-item-badge {
    background: #fff0e0;
    border: 1px solid #f5d0a9;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 10px;
    color: #c0392b;
}

.history-item-time {
    font-size: 10px;
    color: #c9b090;
}

/* 历史条目单条删除按钮 */
.history-item-del {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: transparent;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.15s;
    z-index: 1;
}

.history-item:hover .history-item-del {
    color: #ef4444;
}

.history-item-del:hover {
    background: #fde8e8 !important;
    color: #dc2626 !important;
}

/* ========== 中栏：输入面板 ========== */
.cc-input-panel {
    width: 320px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #f5d0a9;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 12px 16px 10px;
    border-bottom: 1px solid #f5d0a9;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #fff9f0 0%, #fff 100%);
}

.panel-header h3 {
    margin: 0 0 3px 0;
    font-size: 13px;
    font-weight: 600;
    color: #8b0000;
}

.panel-tip {
    font-size: 11px;
    color: #b87333;
}

.cc-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px;
}

.cc-input-body::-webkit-scrollbar { width: 4px; }
.cc-input-body::-webkit-scrollbar-track { background: transparent; }
.cc-input-body::-webkit-scrollbar-thumb { background: #f5d0a9; border-radius: 2px; }
.cc-input-body::-webkit-scrollbar-thumb:hover { background: #e8a070; }

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #5a2d2d;
    margin-bottom: 5px;
}

.required-mark {
    color: #e53e3e;
    margin-left: 2px;
}

.label-tip {
    font-size: 11px;
    color: #b87333;
    font-weight: 400;
}

.cc-input, .cc-select, .cc-textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #f5d0a9;
    border-radius: 5px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
    background: #fff;
    font-family: inherit;
}

.cc-input:focus, .cc-select:focus, .cc-textarea:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

.cc-textarea {
    resize: vertical;
    min-height: 70px;
}

.cc-input-hint {
    font-size: 11px;
    color: #b87333;
    margin-top: 3px;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-group-half {
    flex: 1;
    min-width: 0;
}

/* 快速主题标签 */
.theme-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.theme-tag {
    padding: 4px 10px;
    background: #fff5e8;
    border: 1px solid #f5d0a9;
    border-radius: 20px;
    font-size: 11px;
    color: #8b0000;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.theme-tag:hover {
    background: #fde0b0;
    border-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(192, 57, 43, 0.15);
}

.theme-tag.active {
    background: linear-gradient(135deg, #c0392b, #8b0000);
    border-color: #8b0000;
    color: #fff;
}

/* ========== 右栏：春联展示 ========== */
.cc-result-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fffaf3;
}

.cc-result-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 44px;
    background: linear-gradient(to bottom, #fff9f0 0%, #fff 100%);
}

.result-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.result-meta-theme {
    font-size: 11px;
    background: #fff0e0;
    border: 1px solid #f5d0a9;
    border-radius: 10px;
    padding: 2px 8px;
    color: #8b0000;
    font-weight: 500;
}

.result-time {
    font-size: 10px;
    color: #c9b090;
}

.cc-result-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
}

.cc-result-body::-webkit-scrollbar { width: 6px; }
.cc-result-body::-webkit-scrollbar-track { background: transparent; }
.cc-result-body::-webkit-scrollbar-thumb { background: #f5d0a9; border-radius: 3px; }
.cc-result-body::-webkit-scrollbar-thumb:hover { background: #e8a070; }

/* 占位区 */
.result-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #c9a87c;
    margin: auto;
    width: 100%;
}

/* 眅灯左右分别摇曳，自然摇曳效果 */
.lantern-decoration {
    font-size: 40px;
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
    gap: 24px;
}

.lantern-decoration .lantern:first-child {
    display: inline-block;
    animation: cc-swing-l 2.5s ease-in-out infinite alternate;
}

.lantern-decoration .lantern:last-child {
    display: inline-block;
    animation: cc-swing-r 2.5s ease-in-out infinite alternate;
    animation-delay: 0.5s;
}

@keyframes cc-swing-l {
    from { transform: rotate(-10deg) scale(1); }
    to   { transform: rotate(4deg) scale(1.06); }
}

@keyframes cc-swing-r {
    from { transform: rotate(4deg) scale(1.06); }
    to   { transform: rotate(-10deg) scale(1); }
}

.placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: #c0392b;
    margin: 0 0 8px;
}

.placeholder-desc {
    font-size: 12px;
    color: #b87333;
    margin: 4px 0;
}

/* 加载中 */
.result-loading {
    text-align: center;
    padding: 60px 20px;
    width: 100%;
    margin: auto;
}

.loading-brush {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
}

.brush-char {
    font-size: 28px;
    font-weight: 700;
    color: #c0392b;
    animation: cc-brush-in 0.6s ease-in-out infinite alternate;
    display: inline-block;
}

.brush-char:nth-child(1) { animation-delay: 0.0s; }
.brush-char:nth-child(2) { animation-delay: 0.1s; }
.brush-char:nth-child(3) { animation-delay: 0.2s; }
.brush-char:nth-child(4) { animation-delay: 0.3s; }
.brush-char:nth-child(5) { animation-delay: 0.4s; }

.brush-dots {
    font-size: 28px;
    color: #e8a800;
    animation: cc-brush-in 0.6s ease-in-out infinite alternate;
    animation-delay: 0.5s;
}

@keyframes cc-brush-in {
    from { opacity: 0.3; transform: scaleY(0.7); }
    to   { opacity: 1;   transform: scaleY(1.1); }
}

.loading-text {
    font-size: 13px;
    color: #b87333;
}

/* ========== 春联展示区 ========== */
.couplet-display {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 10px 0;
    animation: cc-fadeIn 0.5s ease;
}

@keyframes cc-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 横批 */
.couplet-hengpi {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.hengpi-label {
    font-size: 11px;
    color: #b87333;
    font-weight: 500;
    letter-spacing: 2px;
}

.hengpi-text {
    font-size: 26px;
    font-weight: 700;
    color: #8b0000;
    letter-spacing: 8px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #fff0c0 0%, #ffd700 50%, #fff0c0 100%);
    border: 2px solid #c8a800;
    border-radius: 4px;
    box-shadow: 0 3px 12px rgba(200, 168, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.6);
    text-shadow: 0 1px 2px rgba(139, 0, 0, 0.2);
    min-width: 160px;
    text-align: center;
    font-family: "楷体", "STKaiti", "KaiTi", serif;
}

/* 上下联容器 */
.couplet-pair {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.couplet-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.couplet-label {
    font-size: 11px;
    color: #b87333;
    font-weight: 500;
    letter-spacing: 1px;
}

/* 竖排春联 */
.couplet-vertical {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-size: 28px;
    font-weight: 700;
    color: #8b0000;
    letter-spacing: 10px;
    line-height: 1.4;
    padding: 20px 14px;
    background: linear-gradient(180deg, #fff5e0 0%, #fff 100%);
    border: 2px solid #e8a800;
    border-radius: 4px;
    box-shadow: 3px 3px 12px rgba(139, 0, 0, 0.12), inset 0 0 20px rgba(255, 245, 200, 0.5);
    text-shadow: 0 1px 2px rgba(139, 0, 0, 0.15);
    font-family: "楷体", "STKaiti", "KaiTi", serif;
    min-height: 100px;
    position: relative;
    transition: all 0.3s ease;
}

.couplet-vertical:hover {
    box-shadow: 3px 3px 18px rgba(139, 0, 0, 0.2), inset 0 0 20px rgba(255, 245, 200, 0.6);
    transform: translateY(-2px);
}

/* 中间装饰 */
.couplet-divider {
    font-size: 28px;
    display: flex;
    align-items: center;
    padding: 0 4px;
}

/* 文字版结果（辅助） */
.couplet-text-box {
    width: 100%;
    max-width: 600px;
    background: #fff;
    border: 1px solid #f5d0a9;
    border-radius: 6px;
    padding: 14px 16px;
    box-shadow: 0 2px 6px rgba(192, 57, 43, 0.06);
}

.couplet-text-result {
    font-size: 13px;
    line-height: 1.9;
    color: #5a2d2d;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: "楷体", "STKaiti", "KaiTi", serif;
}

.couplet-text-result strong { color: #8b0000; font-weight: 700; }
.couplet-text-result em { color: #b87333; font-style: normal; }

/* 错误提示框及文字类（替代内联样式） */
.cc-error-box  { width: 100%; max-width: 500px; }
.cc-error-text { color: #ef4444; }

/* ========== 示例模态框 ========== */
.cc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
}

.cc-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 680px;
    max-width: 95vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: cc-modal-in 0.3s cubic-bezier(.34, 1.4, .64, 1);
}

@keyframes cc-modal-in {
    from { opacity: 0; transform: translate(-50%, -55%) scale(0.94); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.cc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f5d0a9;
    background: linear-gradient(to right, #fff9f0, #fff);
    border-radius: 10px 10px 0 0;
    flex-shrink: 0;
}

.cc-modal-header h3 {
    margin: 0;
    font-size: 15px;
    color: #8b0000;
    font-weight: 600;
}

.cc-modal-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #b87333;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.cc-modal-close:hover {
    background: #fff0e0;
    color: #8b0000;
}

.cc-modal-body {
    overflow-y: auto;
    padding: 16px 18px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.cc-modal-body::-webkit-scrollbar { width: 5px; }
.cc-modal-body::-webkit-scrollbar-track { background: transparent; }
.cc-modal-body::-webkit-scrollbar-thumb { background: #f5d0a9; border-radius: 3px; }
.cc-modal-body::-webkit-scrollbar-thumb:hover { background: #e8a070; }

.example-card {
    padding: 13px 14px;
    background: #fff9f0;
    border: 1px solid #f5d0a9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.example-card:hover {
    background: #fff0e0;
    border-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.12);
}

.example-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1.2;
}

.example-info { flex: 1; min-width: 0; }

.example-title {
    font-size: 13px;
    font-weight: 600;
    color: #8b0000;
    margin-bottom: 3px;
}

.example-badge {
    display: inline-block;
    padding: 1px 6px;
    background: #fff0e0;
    border: 1px solid #f5d0a9;
    border-radius: 3px;
    font-size: 10px;
    color: #c0392b;
    margin-bottom: 4px;
}

.example-desc {
    font-size: 11px;
    color: #b87333;
}

/* ========== Toast 通知 ========== */
.cc-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: #fff;
    padding: 10px 22px;
    border-radius: 22px;
    font-size: 13px;
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    white-space: nowrap;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.cc-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.cc-toast.success { background: linear-gradient(135deg, #c0392b, #8b0000); }
.cc-toast.info    { background: linear-gradient(135deg, #2980b9, #1a5276); }
.cc-toast.warning { background: linear-gradient(135deg, #e8a800, #c07800); }
.cc-toast.error   { background: linear-gradient(135deg, #e74c3c, #c0392b); }

/* ============================================
   暗黑模式 - body.dark 前缀
   ============================================ */
body.dark .cc-container {
    background: #1a0f0f;
    border-color: #3d1f1f;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

body.dark .cc-toolbar {
    background: linear-gradient(135deg, #7f1d1d 0%, #4a0e0e 50%, #7f1d1d 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

body.dark .cc-toolbar-btn {
    background: rgba(255, 230, 180, 0.12);
    border-color: rgba(200, 140, 60, 0.3);
    color: #f5c87a;
}

body.dark .cc-toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 230, 180, 0.2);
    color: #ffd700;
    border-color: #e8a800;
}

body.dark .cc-toolbar-btn-primary {
    background: linear-gradient(135deg, #c07800 0%, #8b5500 100%);
    color: #fff;
    border-color: rgba(200, 140, 0, 0.5);
}

body.dark .cc-toolbar-btn-primary:hover:not(:disabled) {
    color: #fff; /* 防止被 .cc-toolbar-btn:hover 的 #ffd700 覆盖 */
}

body.dark .cc-main-content {
    background: #1a0f0f;
}

body.dark .cc-history-panel {
    background: #1e1010;
    border-right-color: #3d1f1f;
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, #1e1010, #1a0f0f);
    border-bottom-color: #3d1f1f;
}

body.dark .history-panel-header h3 { color: #f5c87a; }
body.dark .history-count           { color: #a07050; }

body.dark .history-clear-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

body.dark .history-search { border-bottom-color: #3d1f1f; }

body.dark .history-search input::placeholder { color: #64748b; }

body.dark .history-search input {
    background: #2a1515;
    border-color: #3d1f1f;
    color: #e5c88a;
}

body.dark .history-search input:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.2);
}

body.dark .history-item { border-bottom-color: #2a1515; }
body.dark .history-item:hover { background: #2a1515; }

body.dark .history-item.active {
    background: linear-gradient(to right, #2a1515, #1e1010);
    border-left-color: #e8a800;
}

body.dark .history-item-theme  { color: #f5c87a; }
body.dark .history-item-meta   { color: #a07050; }
body.dark .history-item-badge  { background: #2a1515; border-color: #3d1f1f; color: #f5a623; }
body.dark .history-item-time   { color: #6b4a2a; }
body.dark .history-empty       { color: #a07050; }
body.dark .history-list::-webkit-scrollbar-thumb { background: #3d1f1f; }
body.dark .history-list::-webkit-scrollbar-thumb:hover { background: #5a2d2d; }

body.dark .history-item-del { color: transparent; }
body.dark .history-item:hover .history-item-del { color: #f87171; }
body.dark .history-item-del:hover { background: rgba(239,68,68,0.18) !important; color: #ef4444 !important; }

body.dark .cc-input-panel {
    background: #1e1010;
    border-right-color: #3d1f1f;
}

body.dark .panel-header {
    background: linear-gradient(to bottom, #1e1010, #1a0f0f);
    border-bottom-color: #3d1f1f;
}

body.dark .panel-header h3 { color: #f5c87a; }
body.dark .panel-tip        { color: #a07050; }

body.dark .cc-input-body::-webkit-scrollbar-thumb { background: #3d1f1f; }
body.dark .cc-input-body::-webkit-scrollbar-thumb:hover { background: #5a2d2d; }

body.dark .form-group label { color: #e5c88a; }
body.dark .label-tip        { color: #a07050; }

body.dark .cc-input,
body.dark .cc-select,
body.dark .cc-textarea {
    background: #2a1515;
    border-color: #3d1f1f;
    color: #e5c88a;
}

body.dark .cc-input:focus,
body.dark .cc-select:focus,
body.dark .cc-textarea:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.2);
}

body.dark .cc-input-hint { color: #64748b; }

body.dark .cc-input::placeholder,
body.dark .cc-textarea::placeholder { color: #64748b; }

body.dark .cc-select option { background: #2a1515; color: #e5c88a; }

body.dark .theme-tag {
    background: #2a1515;
    border-color: #3d1f1f;
    color: #f5a623;
}

body.dark .theme-tag:hover {
    background: #3d1f1f;
    border-color: #c0392b;
}

body.dark .theme-tag.active {
    background: linear-gradient(135deg, #7f1d1d, #4a0e0e);
    border-color: #7f1d1d;
    color: #ffd700;
}

body.dark .result-meta-theme { background: #2a1515; border-color: #3d1f1f; color: #f5c87a; }
body.dark .result-time       { color: #6b4a2a; }

body.dark .cc-result-panel { background: #1a0f0f; }

body.dark .cc-result-body::-webkit-scrollbar-thumb { background: #3d1f1f; }
body.dark .cc-result-body::-webkit-scrollbar-thumb:hover { background: #5a2d2d; }

body.dark .placeholder-title { color: #f5c87a; }
body.dark .placeholder-desc  { color: #a07050; }

body.dark .loading-text  { color: #a07050; }
body.dark .brush-char    { color: #f5c87a; }
body.dark .brush-dots    { color: #c07800; }

body.dark .hengpi-text {
    background: linear-gradient(135deg, #5a4000 0%, #8b6400 50%, #5a4000 100%);
    border-color: #8b6400;
    color: #ffd700;
    box-shadow: 0 3px 12px rgba(139, 100, 0, 0.4), inset 0 1px 0 rgba(255, 220, 100, 0.2);
}

body.dark .couplet-vertical {
    background: linear-gradient(180deg, #2a1a0a 0%, #1e1010 100%);
    border-color: #8b6400;
    color: #f5c87a;
    box-shadow: 3px 3px 12px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(100, 60, 0, 0.3);
}

body.dark .couplet-vertical:hover {
    box-shadow: 3px 3px 18px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(100, 60, 0, 0.4);
}

body.dark .hengpi-label,
body.dark .couplet-label { color: #a07050; }

body.dark .couplet-text-box {
    background: #1e1010;
    border-color: #3d1f1f;
}

body.dark .couplet-text-result { color: #e5c88a; }
body.dark .couplet-text-result strong { color: #f5c87a; }
body.dark .cc-error-box  { border-color: #5a2d2d; }
body.dark .cc-error-text { color: #f87171; }

body.dark .cc-modal {
    background: #1e1010;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body.dark .cc-modal-header {
    background: linear-gradient(to right, #1a0f0f, #1e1010);
    border-bottom-color: #3d1f1f;
}

body.dark .cc-modal-header h3   { color: #f5c87a; }
body.dark .cc-modal-close       { color: #a07050; }
body.dark .cc-modal-close:hover { background: #2a1515; color: #f5c87a; }

body.dark .example-card {
    background: #2a1515;
    border-color: #3d1f1f;
}

body.dark .example-card:hover {
    background: #3d1f1f;
    border-color: #c0392b;
}

body.dark .example-title  { color: #f5c87a; }
body.dark .example-badge  { background: #3d1f1f; border-color: #5a2d2d; color: #f5a623; }
body.dark .example-desc   { color: #a07050; }

body.dark .cc-modal-body::-webkit-scrollbar-thumb { background: #3d1f1f; }
body.dark .cc-modal-body::-webkit-scrollbar-thumb:hover { background: #5a2d2d; }

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .cc-history-panel { display: none; }
    .cc-input-panel   { width: 280px; }
}

@media (max-width: 639px) {
    .cc-input-panel { width: 100%; border-right: none; border-bottom: 1px solid #f5d0a9; }
    .cc-main-content { flex-direction: column; }
    .cc-result-panel { min-height: 300px; }
    .couplet-pair { gap: 8px; }
    .couplet-vertical { font-size: 22px; letter-spacing: 6px; }
    .hengpi-text { font-size: 20px; letter-spacing: 4px; }
    .cc-modal-body { grid-template-columns: 1fr; }
    .toolbar-title { display: none; } /* 小屏下隐藏标题，避免按钮挤压换行 */
}

@media (max-width: 639px) {
    body.dark .cc-input-panel { border-bottom-color: #3d1f1f; }
}
