/* =============================================
   文言文大师 - classical_chinese_master.css
   水墨宣纸主题，三栏布局，支持暗黑模式
   ============================================= */

/* ========== 主容器 ========== */
.ccm-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #fdf8ef;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(100, 50, 10, 0.13);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.ccm-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;
}

/* ========== 顶部工具栏 ========== */
.ccm-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #2c1810 0%, #8b1a1a 45%, #6b3a2a 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 3px 12px rgba(44, 24, 16, 0.45);
    flex-shrink: 0;
}

.ccm-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 235, 195, 0.96);
    letter-spacing: 1px;
    margin-right: 8px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.toolbar-btn {
    padding: 6px 12px;
    background: rgba(255, 245, 220, 0.93);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #6b3a2a;
    transition: all 0.2s;
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* 主操作按钮（开始解析） */
.toolbar-btn-primary {
    background: linear-gradient(135deg, #c0392b 0%, #8b1a1a 100%);
    color: #fff !important;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.5);
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #d44535 0%, #a02020 100%);
    box-shadow: 0 4px 14px rgba(192, 57, 43, 0.6);
    color: #fff !important;
}

/* ========== 抖动动画 ========== */
@keyframes ccmShake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-6px); }
    30%, 70% { transform: translateX(6px); }
}

.ccm-textarea.shake {
    animation: ccmShake 0.5s ease-in-out;
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15) !important;
}

/* ========== 主内容区：三栏 ========== */
.ccm-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #fdf8ef;
}

/* ========== 左栏：历史记录 ========== */
.ccm-history-panel {
    width: 215px;
    flex-shrink: 0;
    background: #fffaf3;
    border-right: 1px solid #d4b896;
    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, #fffaf3 0%, #fff4e6 100%);
    border-bottom: 1px solid #d4b896;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #5a3010;
}

.history-count {
    font-size: 11px;
    color: #b5833a;
    font-weight: 400;
}

.history-limit-footer {
    flex-shrink: 0;
    padding: 5px 8px;
    text-align: center;
    font-size: 10px;
    color: #c8ab85;
    border-top: 1px solid #e8d5b8;
    background: #fffaf3;
    letter-spacing: 0.2px;
    user-select: none;
}

.history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #e74c3c;
    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 #e8d5b8;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d4b896;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #3a2010;
    background: #fffdf8;
}

.history-search input:focus {
    border-color: #b5833a;
    box-shadow: 0 0 0 2px rgba(181, 131, 58, 0.15);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list:hover::-webkit-scrollbar-track { background: #fff3e0; }
.history-list::-webkit-scrollbar-thumb { background: #d4b896; border-radius: 2px; }
.history-list::-webkit-scrollbar-thumb:hover { background: #b5833a; }

.history-empty {
    text-align: center;
    color: #b5833a;
    font-size: 12px;
    padding: 24px 8px;
    user-select: none;
    line-height: 1.7;
}

@keyframes ccmHistoryFadeIn {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: translateX(0); }
}

.history-item {
    display: flex;
    flex-direction: column;
    padding: 9px 11px;
    margin: 3px 0;
    background: #fffdf8;
    border: 1px solid #e8d5b8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: ccmHistoryFadeIn 0.22s ease;
}

.history-item:hover {
    background: #fff4e0;
    border-color: #d4b896;
    transform: translateX(2px);
}

.history-item.active {
    background: #fff0e6;
    border-color: #c0392b;
    box-shadow: 0 1px 4px rgba(192, 57, 43, 0.15);
}

.history-item-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: #fff0f0;
    color: #e74c3c;
    border: none;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s;
    padding: 0;
    line-height: 1;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    background: #fde8e8 !important;
}

.history-item-preview {
    font-size: 12px;
    color: #3a2010;
    font-weight: 500;
    line-height: 1.5;
    padding-right: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    gap: 4px;
}

.history-item-mode {
    font-size: 10px;
    color: #fff;
    background: #b5833a;
    padding: 1px 6px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.history-item-time {
    font-size: 10px;
    color: #a08060;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== 中栏：输入区 ========== */
.ccm-input-panel {
    width: 340px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #d4b896;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 12px 16px 10px;
    background: linear-gradient(to bottom, #fffdf8 0%, #fffaf2 100%);
    border-bottom: 1px solid #e8d5b8;
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0 0 3px;
    font-size: 14px;
    font-weight: 700;
    color: #3a2010;
}

.panel-tip {
    font-size: 11px;
    color: #a08060;
}

.ccm-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ccm-input-body::-webkit-scrollbar { width: 4px; }
.ccm-input-body::-webkit-scrollbar-track { background: transparent; }
.ccm-input-body::-webkit-scrollbar-thumb { background: #d4b896; border-radius: 2px; }
.ccm-input-body::-webkit-scrollbar-thumb:hover { background: #b5833a; }

/* 文本输入框 */
.ccm-textarea {
    width: 100%;
    min-height: 180px;
    max-height: 280px;
    padding: 12px 14px;
    border: 2px solid #d4b896;
    border-radius: 6px;
    font-size: 14px;
    font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", "宋体", Georgia, serif;
    color: #2c1810;
    background: #fffdf8;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 1.8;
    letter-spacing: 0.5px;
    box-sizing: border-box;
}

.ccm-textarea:focus {
    border-color: #b5833a;
    box-shadow: 0 0 0 3px rgba(181, 131, 58, 0.12);
}

.ccm-textarea::placeholder {
    color: #c8ab85;
    font-size: 12px;
    line-height: 1.6;
}

.ccm-textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #a08060;
    margin-top: -6px;
}

.ccm-textarea-hint {
    font-style: italic;
}

.ccm-char-count {
    font-variant-numeric: tabular-nums;
}

/* ========== 解析模式选择 ========== */
.ccm-mode-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ccm-mode-label {
    font-size: 12px;
    font-weight: 600;
    color: #5a3010;
    letter-spacing: 0.5px;
}

.ccm-mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ccm-mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 11px 8px;
    background: #fffdf8;
    border: 2px solid #d4b896;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s, transform 0.2s, box-shadow 0.2s;
    text-align: center;
    user-select: none;
}

.ccm-mode-card:hover {
    border-color: #b5833a;
    background: #fff8ec;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(181, 131, 58, 0.2);
}

.ccm-mode-card.selected {
    border-color: #c0392b;
    background: linear-gradient(135deg, #fff5f4 0%, #fff9f0 100%);
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.18);
    position: relative;
}

.ccm-mode-card.selected::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 10px;
    color: #c0392b;
    font-weight: 900;
    line-height: 1;
}

.mode-icon {
    font-size: 20px;
    margin-bottom: 4px;
    line-height: 1;
}

.mode-name {
    font-size: 12px;
    font-weight: 700;
    color: #2c1810;
    margin-bottom: 2px;
}

.mode-desc {
    font-size: 10px;
    color: #9a7050;
    line-height: 1.3;
}

.ccm-mode-card.selected .mode-name {
    color: #c0392b;
}

/* ========== 使用说明框 ========== */
.ccm-tips-box {
    background: linear-gradient(135deg, #fffbf0 0%, #fff8e8 100%);
    border: 1px solid #e8d5b8;
    border-left: 3px solid #b5833a;
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 12px;
}

.ccm-tips-box p {
    margin: 0 0 6px;
    font-weight: 600;
    color: #5a3010;
}

.ccm-tips-box ul {
    margin: 0;
    padding-left: 16px;
    color: #7a5c3f;
    line-height: 1.9;
}

.ccm-tips-box ul li {
    font-size: 11px;
}

/* ========== 右栏：解析结果 ========== */
.ccm-result-panel {
    flex: 1;
    min-width: 0;
    background: #fffdf8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ccm-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 10px;
    background: linear-gradient(to bottom, #fffdf8 0%, #fff9f0 100%);
    border-bottom: 1px solid #e8d5b8;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 6px;
}

.ccm-result-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #3a2010;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.result-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.result-action-btn {
    padding: 4px 10px;
    background: linear-gradient(135deg, #fff5f0 0%, #ffe8e0 100%);
    border: 1px solid #d4b896;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: #8b3a20;
    transition: all 0.2s;
    white-space: nowrap;
}

.result-action-btn:hover {
    background: linear-gradient(135deg, #ffe0d0 0%, #ffd0bc 100%);
    border-color: #c0392b;
    color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.15);
}

.result-mode-tag {
    font-size: 11px;
    background: linear-gradient(135deg, #c0392b 0%, #8b1a1a 100%);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.result-time {
    font-size: 11px;
    color: #a08060;
}

.ccm-result-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

.ccm-result-body::-webkit-scrollbar { width: 5px; }
.ccm-result-body::-webkit-scrollbar-track { background: transparent; }
.ccm-result-body:hover::-webkit-scrollbar-track { background: #fff8ec; }
.ccm-result-body::-webkit-scrollbar-thumb { background: #d4b896; border-radius: 3px; }
.ccm-result-body::-webkit-scrollbar-thumb:hover { background: #b5833a; }

/* ========== 占位/加载/结果/错误 ========== */

/* 占位 */
.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 300px;
    padding: 40px 20px;
    text-align: center;
    user-select: none;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
    animation: ccmFloatIcon 3s ease-in-out infinite;
}

@keyframes ccmFloatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.placeholder-title {
    font-size: 16px;
    font-weight: 700;
    color: #7a5c3f;
    margin: 0 0 8px;
}

.placeholder-desc {
    font-size: 13px;
    color: #b5956a;
    margin: 2px 0;
    line-height: 1.6;
}

.placeholder-quote {
    margin-top: 18px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #fff9f0 0%, #fff5e6 100%);
    border-left: 3px solid #c0392b;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    font-style: italic;
    color: #6b3a2a;
    font-family: "Noto Serif SC", "SimSun", Georgia, serif;
    letter-spacing: 0.5px;
}

/* 加载中 */
.result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 300px;
    padding: 40px 20px;
}

.loading-brush-wrap {
    font-size: 36px;
    margin-bottom: 10px;
    animation: ccmBrushWrite 1.5s ease-in-out infinite;
}

@keyframes ccmBrushWrite {
    0%, 100% { transform: rotate(-5deg) translateX(-5px); opacity: 0.7; }
    50% { transform: rotate(5deg) translateX(5px); opacity: 1; }
}

.loading-dots {
    display: flex;
    gap: 6px;
    margin: 8px 0 12px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: #c0392b;
    border-radius: 50%;
    animation: ccmDotBounce 1.2s ease-in-out infinite;
    opacity: 0.7;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ccmDotBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); opacity: 1; }
}

.loading-text {
    font-size: 13px;
    color: #8b5030;
    margin: 0;
}

/* 结果内容 */
@keyframes ccmResultFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-content {
    padding: 18px 20px;
    font-size: 14px;
    color: #2c1810;
    line-height: 1.9;
    font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", "宋体", Georgia, serif;
    border-left: 3px solid #c0392b;
    word-break: break-word;
    overflow-wrap: break-word;
    animation: ccmResultFadeIn 0.35s ease;
}

/* 错误提示 */
.result-error {
    flex: 1;
    min-height: 300px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.error-message {
    background: #fff5f5;
    border: 1px solid #fca5a5;
    border-left: 4px solid #e74c3c;
    color: #7f1d1d;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
}

/* ========== AI 结果内容专属样式 ========== */

/* 板块容器 */
.ccm-section {
    margin-bottom: 22px;
    background: #fffdf8;
    border: 1px solid #e8d5b8;
    border-radius: 8px;
    overflow: hidden;
}

.ccm-section-title {
    margin: 0;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #6b3a2a 0%, #c0392b 100%);
    letter-spacing: 0.5px;
}

.ccm-section-body {
    padding: 14px 16px;
    color: #3a2010;
    line-height: 1.9;
    font-size: 13.5px;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 翻译对照 */
.ccm-pair {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    margin: 8px 0;
    background: #fffdf5;
    border-left: 3px solid #b5833a;
    border-radius: 0 6px 6px 0;
    gap: 6px;
}

.ccm-original {
    font-size: 14px;
    font-weight: 600;
    color: #2c1810;
    letter-spacing: 1px;
    font-family: "Noto Serif SC", "SimSun", serif;
}

.ccm-translation {
    font-size: 13px;
    color: #6b4a30;
    padding-left: 6px;
    border-left: 2px dashed #d4b896;
}

/* 行内翻译对照 */
.ccm-original-inline {
    font-weight: 600;
    color: #2c1810;
    font-family: "Noto Serif SC", "SimSun", serif;
}

.ccm-trans-inline {
    color: #6b4a30;
    margin-left: 8px;
}

/* 字词注释列表 */
.ccm-char-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 0;
}

.ccm-char-item {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 10px 14px;
    background: #fffdf5;
    border: 1px solid #e8d5b8;
    border-radius: 6px;
    line-height: 1.7;
}

.ccm-char {
    font-size: 16px;
    font-weight: 700;
    color: #c0392b;
    font-family: "Noto Serif SC", "SimSun", serif;
    flex-shrink: 0;
}

.ccm-pinyin {
    font-size: 12px;
    color: #b5833a;
    font-style: italic;
    flex-shrink: 0;
}

.ccm-pos {
    font-size: 11px;
    background: #fff0e6;
    color: #8b4513;
    padding: 1px 7px;
    border-radius: 10px;
    flex-shrink: 0;
    border: 1px solid #d4b896;
}

.ccm-meaning {
    margin: 4px 0 0;
    width: 100%;
    font-size: 13px;
    color: #4a2c18;
    line-height: 1.7;
}

/* 字词注释（行内格式） */
.ccm-anno-word {
    font-weight: 700;
    color: #c0392b;
    font-family: "Noto Serif SC", "SimSun", serif;
}

/* 深度解析板块 */
.ccm-analysis-block {
    margin-bottom: 14px;
}

/* 高亮文本 */
.ccm-highlight {
    background: linear-gradient(120deg, rgba(181, 131, 58, 0.18) 0%, rgba(192, 57, 43, 0.12) 100%);
    color: #7a3010;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
}

/* 通用 table 样式（AI 可能生成） */
.result-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 13px;
}

.result-content table th {
    background: #6b3a2a;
    color: #fff;
    padding: 7px 12px;
    text-align: left;
    font-weight: 600;
}

.result-content table td {
    padding: 7px 12px;
    border: 1px solid #e8d5b8;
    color: #3a2010;
}

.result-content table tr:nth-child(even) td {
    background: #fffdf5;
}

/* 通用 li 样式 */
.result-content li {
    margin: 4px 0;
    line-height: 1.8;
}

/* li 列表标记符统一主题色 */
.result-content li::marker,
.ccm-section-body li::marker,
.ccm-tips-box ul li::marker {
    color: #ff9800;
}

.result-content p {
    margin: 6px 0;
}

.result-content h4 {
    margin: 16px 0 8px;
    color: #6b3a2a;
    font-size: 14px;
    border-bottom: 1px dashed #d4b896;
    padding-bottom: 4px;
}

/* ========== 示例导入模态框 ========== */
.ccm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 15, 5, 0.5);
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.ccm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    width: min(780px, 92vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.ccm-modal-content {
    background: #fffdf8;
    border-radius: 10px;
    box-shadow: 0 8px 40px rgba(44, 24, 16, 0.3);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
}

.ccm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #2c1810 0%, #8b1a1a 100%);
    color: white;
    flex-shrink: 0;
}

.ccm-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: rgba(255, 235, 195, 0.95);
}

.ccm-modal-close {
    background: rgba(255, 245, 220, 0.2);
    border: none;
    color: rgba(255, 235, 195, 0.9);
    font-size: 16px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ccm-modal-close:hover {
    background: rgba(255, 245, 220, 0.35);
}

.ccm-modal-body {
    padding: 18px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.ccm-modal-body::-webkit-scrollbar { width: 5px; }
.ccm-modal-body::-webkit-scrollbar-thumb { background: #d4b896; border-radius: 3px; }
.ccm-modal-body::-webkit-scrollbar-thumb:hover { background: #b5833a; }

/* 示例卡片 */
.example-card {
    display: flex;
    flex-direction: column;
    padding: 14px;
    background: #fffdf8;
    border: 1px solid #e8d5b8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.example-card:hover {
    border-color: #c0392b;
    background: #fff9f2;
    box-shadow: 0 3px 10px rgba(192, 57, 43, 0.12);
    transform: translateY(-1px);
}

.example-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.example-source {
    font-size: 12px;
    font-weight: 700;
    color: #6b3a2a;
}

.example-mode-tag {
    font-size: 10px;
    background: #fff0e6;
    color: #8b4513;
    padding: 1px 7px;
    border-radius: 10px;
    border: 1px solid #d4b896;
    white-space: nowrap;
}

.example-text {
    font-size: 12px;
    color: #5a3a20;
    line-height: 1.7;
    font-family: "Noto Serif SC", "SimSun", serif;
    margin-bottom: 10px;
    flex: 1;
}

.example-import-btn {
    padding: 5px 14px;
    background: linear-gradient(135deg, #c0392b 0%, #8b1a1a 100%);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    align-self: flex-end;
}

.example-import-btn:hover {
    background: linear-gradient(135deg, #d44535 0%, #a02020 100%);
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.3);
}

/* ========== 打印样式 ========== */
@media print {
    .ccm-toolbar,
    .ccm-history-panel,
    .ccm-input-panel,
    #resultPlaceholder,
    #resultLoading,
    .result-error,
    .ccm-modal,
    .ccm-modal-overlay {
        display: none !important;
    }

    .ccm-container {
        height: auto !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    .ccm-result-panel {
        width: 100% !important;
        overflow: visible !important;
    }

    .ccm-result-body {
        overflow: visible !important;
        height: auto !important;
    }

    .ccm-section {
        break-inside: avoid;
        width: 100%;
        overflow: visible;
    }

    .result-content {
        border-left: 2px solid #c0392b;
        padding: 10px;
    }
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .ccm-history-panel {
        width: 0;
        overflow: hidden;
        border-right: none;
    }

    .ccm-input-panel {
        width: 280px;
    }
}

@media (max-width: 600px) {
    .ccm-input-panel {
        width: 100%;
        border-right: none;
    }

    .ccm-result-panel {
        display: none;
    }

    .ccm-mode-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ccm-modal-body {
        grid-template-columns: 1fr;
    }
}

/* ========================================================
   暗黑模式 - 所有选择器必须以 body.dark 为父级前缀
   ======================================================== */

body.dark .ccm-container {
    background: #1a1005;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

body.dark .ccm-toolbar {
    background: linear-gradient(135deg, #110800 0%, #6a1010 45%, #3a1a08 100%);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.6);
}

body.dark .ccm-toolbar .toolbar-title {
    color: rgba(240, 210, 160, 0.96);
}

body.dark .toolbar-btn {
    background: rgba(70, 45, 20, 0.92);
    color: #e8c890;
}

body.dark .toolbar-btn:hover:not(:disabled) {
    background: rgba(90, 60, 30, 0.98);
    color: #f5dfa8;
}

body.dark .toolbar-btn-primary {
    background: linear-gradient(135deg, #a02020 0%, #6a0e0e 100%);
    color: #fff !important;
}

body.dark .toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #b82828 0%, #7a1212 100%);
    color: #fff !important;
}

body.dark .ccm-main-content {
    background: #1a1005;
}

/* 暗黑 - 历史面板 */
body.dark .ccm-history-panel {
    background: #221508;
    border-right-color: #4a3015;
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, #221508 0%, #1a1005 100%);
    border-bottom-color: #4a3015;
}

body.dark .history-panel-header h3 {
    color: #e0c095;
}

body.dark .history-limit-footer {
    background: #221508;
    border-top-color: #3a2510;
    color: #6a5030;
}

body.dark .history-clear-btn {
    background: rgba(200, 40, 40, 0.15);
    color: #e87070;
}

body.dark .history-clear-btn:hover {
    background: rgba(200, 40, 40, 0.25);
}

body.dark .history-search {
    border-bottom-color: #3a2510;
}

body.dark .history-search input {
    background: #2d1e0c;
    border-color: #4a3015;
    color: #e0c095;
}

body.dark .history-search input:focus {
    border-color: #b5833a;
    box-shadow: 0 0 0 2px rgba(181, 131, 58, 0.2);
}

body.dark .history-list:hover::-webkit-scrollbar-track {
    background: #2a1a08;
}

body.dark .history-list::-webkit-scrollbar-thumb {
    background: #5a3c1c;
}

body.dark .history-list::-webkit-scrollbar-thumb:hover {
    background: #a06030;
}

body.dark .history-empty {
    color: #7a5c30;
}

body.dark .history-item {
    background: #2a1c0a;
    border-color: #4a3015;
}

body.dark .history-item:hover {
    background: #341e0c;
    border-color: #6a4020;
}

body.dark .history-item.active {
    background: #3a1a10;
    border-color: #a02020;
}

body.dark .history-item-preview {
    color: #e0c095;
}

body.dark .history-item-mode {
    background: #6a4020;
}

body.dark .history-item-time {
    color: #7a5c30;
}

body.dark .history-item-delete {
    background: rgba(180, 30, 30, 0.2);
    color: #e87070;
}

/* 暗黑 - 输入面板 */
body.dark .ccm-input-panel {
    background: #231508;
    border-right-color: #4a3015;
}

body.dark .panel-header {
    background: linear-gradient(to bottom, #231508 0%, #1c1005 100%);
    border-bottom-color: #4a3015;
}

body.dark .panel-header h3 {
    color: #e8c890;
}

body.dark .panel-tip {
    color: #7a5c30;
}

body.dark .ccm-input-body::-webkit-scrollbar-thumb {
    background: #5a3c1c;
}

body.dark .ccm-input-body::-webkit-scrollbar-thumb:hover {
    background: #a06030;
}

body.dark .ccm-textarea {
    background: #1e1308;
    border-color: #4a3015;
    color: #e8d5b0;
}

body.dark .ccm-textarea:focus {
    border-color: #b5833a;
    box-shadow: 0 0 0 3px rgba(181, 131, 58, 0.18);
}

body.dark .ccm-textarea::placeholder {
    color: #6a4a25;
}

body.dark .ccm-textarea-footer {
    color: #7a5c30;
}

body.dark .ccm-mode-label {
    color: #d4a870;
}

body.dark .ccm-mode-card {
    background: #2a1c0a;
    border-color: #4a3015;
}

body.dark .ccm-mode-card:hover {
    border-color: #b5833a;
    background: #341e0c;
}

body.dark .ccm-mode-card.selected {
    border-color: #c0392b;
    background: linear-gradient(135deg, #3a1a10 0%, #2d1808 100%);
}

body.dark .ccm-mode-card.selected::after {
    color: #e87070;
}

body.dark .mode-name {
    color: #e8c890;
}

body.dark .mode-desc {
    color: #8a6040;
}

body.dark .ccm-mode-card.selected .mode-name {
    color: #e87070;
}

body.dark .ccm-tips-box {
    background: linear-gradient(135deg, #261808 0%, #1e1205 100%);
    border-color: #3a2510;
    border-left-color: #8a5020;
}

body.dark .ccm-tips-box p {
    color: #d4a870;
}

body.dark .ccm-tips-box ul {
    color: #9a7040;
}

/* 暗黑 - 结果面板 */
body.dark .ccm-result-panel {
    background: #1e1508;
}

body.dark .ccm-result-header {
    background: linear-gradient(to bottom, #1e1508 0%, #1a1005 100%);
    border-bottom-color: #4a3015;
}

body.dark .ccm-result-header h3 {
    color: #e8c890;
}

body.dark .result-mode-tag {
    background: linear-gradient(135deg, #a02020 0%, #6a0e0e 100%);
}

body.dark .result-time {
    color: #7a5c30;
}

body.dark .result-action-btn {
    background: rgba(60, 30, 15, 0.92);
    border-color: #5a3015;
    color: #d4a060;
}

body.dark .result-action-btn:hover {
    background: rgba(80, 40, 15, 0.98);
    border-color: #a02020;
    color: #e87070;
}

body.dark .ccm-result-body:hover::-webkit-scrollbar-track {
    background: #261808;
}

body.dark .ccm-result-body::-webkit-scrollbar-thumb {
    background: #5a3c1c;
}

body.dark .ccm-result-body::-webkit-scrollbar-thumb:hover {
    background: #a06030;
}

body.dark .result-placeholder {
    background: #1e1508;
}

body.dark .placeholder-title {
    color: #c8a060;
}

body.dark .placeholder-desc {
    color: #8a6030;
}

body.dark .placeholder-quote {
    background: linear-gradient(135deg, #261808 0%, #1e1205 100%);
    border-left-color: #a02020;
    color: #d4a060;
}

body.dark .loading-text {
    color: #c89060;
}

body.dark .loading-dots span {
    background: #e87070;
}

/* 暗黑 - 结果内容区（显式覆盖边框色，避免依赖亮色默认值） */
body.dark .result-content {
    color: #e8d5b0;
    border-left-color: #6a3a15;
}

body.dark .result-error .error-message {
    background: #2a1010;
    border-color: #6a2020;
    border-left-color: #a02020;
    color: #e8a0a0;
}

/* 暗黑 - AI结果内容专属样式 */
body.dark .ccm-section {
    background: #261808;
    border-color: #4a3015;
}

body.dark .ccm-section-title {
    background: linear-gradient(135deg, #3a1a08 0%, #7a1010 100%);
}

body.dark .ccm-section-body {
    color: #e0c095;
}

body.dark .ccm-pair {
    background: #2a1c0a;
    border-left-color: #8a5020;
}

body.dark .ccm-original {
    color: #f0d5a8;
}

body.dark .ccm-translation {
    color: #b8946a;
    border-left-color: #5a3a1c;
}

body.dark .ccm-original-inline {
    color: #f0d5a8;
}

body.dark .ccm-trans-inline {
    color: #b8946a;
}

body.dark .ccm-char-item {
    background: #2a1c0a;
    border-color: #4a3015;
}

body.dark .ccm-char {
    color: #e87070;
}

body.dark .ccm-pinyin {
    color: #c0902a;
}

body.dark .ccm-pos {
    background: #3a2010;
    color: #c8a060;
    border-color: #5a3a1c;
}

body.dark .ccm-meaning {
    color: #d0b080;
}

body.dark .ccm-anno-word {
    color: #e87070;
}

body.dark .ccm-highlight {
    background: linear-gradient(120deg, rgba(181, 131, 58, 0.22) 0%, rgba(192, 57, 43, 0.18) 100%);
    color: #f0c060;
}

body.dark .result-content table th {
    background: #4a2810;
}

body.dark .result-content table td {
    border-color: #4a3015;
    color: #e0c095;
}

body.dark .result-content table tr:nth-child(even) td {
    background: #231508;
}

body.dark .result-content h4 {
    color: #d4a870;
    border-bottom-color: #4a3015;
}

/* 暗黑 - 模态框 */
body.dark .ccm-modal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

body.dark .ccm-modal-content {
    background: #231508;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

body.dark .ccm-modal-header {
    background: linear-gradient(135deg, #110800 0%, #6a1010 100%);
}

body.dark .ccm-modal-body::-webkit-scrollbar-thumb {
    background: #5a3c1c;
}

body.dark .ccm-modal-body::-webkit-scrollbar-thumb:hover {
    background: #a06030;
}

body.dark .example-card {
    background: #2a1c0a;
    border-color: #4a3015;
}

body.dark .example-card:hover {
    background: #341e0c;
    border-color: #c0392b;
}

body.dark .example-source {
    color: #d4a870;
}

body.dark .example-mode-tag {
    background: #3a2510;
    color: #c8a060;
    border-color: #5a3a1c;
}

body.dark .example-text {
    color: #b8946a;
}
