/**
 * 汉字拼音工具 - 样式文件
 * 主题色：靛蓝 + 朱砂红，蕴含汉字文化气韵
 * 声调着色：1声蓝 / 2声绿 / 3声橙 / 4声红 / 轻声灰
 */

/* ===================== 容器 ===================== */
.ccp-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    min-height: 500px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}
/* ===================== 工具栏 ===================== */
.ccp-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 16px;
    background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #1a237e 100%);
    border-bottom: 1px solid #0d1754;
    flex-shrink: 0;
    flex-wrap: wrap;
    row-gap: 6px;
}

.ccp-toolbar-left,
.ccp-toolbar-center,
.ccp-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ccp-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.ccp-tool-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.55);
    transform: translateY(-1px);
}

.ccp-ai-btn {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.25), rgba(255, 193, 7, 0.15));
    border-color: rgba(255, 193, 7, 0.55);
    color: #ffd54f;
}

.ccp-ai-btn:hover {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.4), rgba(255, 193, 7, 0.3));
}

.ccp-opt-label {
    display: flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 12px;
    cursor: pointer;
    user-select: none;
}

.ccp-opt-label input[type="checkbox"] {
    accent-color: #ffd54f;
    width: 13px;
    height: 13px;
    cursor: pointer;
}

/* ===================== 主内容三栏 ===================== */
.ccp-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===================== 历史记录侧栏 ===================== */
.ccp-history {
    width: 200px;
    min-width: 160px;
    border-right: 1px solid #e8ecf4;
    display: flex;
    flex-direction: column;
    background: #f7f8fc;
    flex-shrink: 0;
}

.ccp-history-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(to bottom, #f0f3fb, #eaeff9);
    border-bottom: 1px solid #e0e6f0;
    flex-shrink: 0;
}

.ccp-history-title {
    font-size: 12px;
    font-weight: 700;
    color: #3949ab;
}

.ccp-history-clear {
    background: none;
    border: none;
    color: #9e9e9e;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s;
}

.ccp-history-clear:hover {
    color: #e53935;
    background: #fde8e8;
}

.ccp-history-search {
    padding: 7px 10px;
    border-bottom: 1px solid #e8ecf4;
    flex-shrink: 0;
}

.ccp-history-search input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #dde3f0;
    border-radius: 4px;
    font-size: 11px;
    background: #fff;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
    color: #333;
}

.ccp-history-search input:focus {
    border-color: #3949ab;
    box-shadow: 0 0 0 2px rgba(57, 73, 171, 0.1);
}

.ccp-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.ccp-history-list::-webkit-scrollbar { width: 3px; }
.ccp-history-list::-webkit-scrollbar-track { background: transparent; }
.ccp-history-list::-webkit-scrollbar-thumb { background: #c5cae9; border-radius: 2px; }

.ccp-history-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eef1f8;
    transition: background 0.15s;
    position: relative;
}

.ccp-history-item:hover {
    background: #e8eaf6;
}

.ccp-history-item.active {
    background: #e8eaf6;
    box-shadow: inset 3px 0 0 #3b82f6;
}

.ccp-history-item-text {
    font-size: 12px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.ccp-history-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3px;
}

.ccp-history-item-time {
    font-size: 10px;
    color: #9e9e9e;
}

.ccp-history-item-del {
    display: none;
    background: none;
    border: none;
    color: #bbb;
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.2s;
}

.ccp-history-item:hover .ccp-history-item-del {
    display: block;
}

.ccp-history-item-del:hover {
    color: #e53935;
}

.ccp-history-empty {
    text-align: center;
    padding: 28px 10px;
    color: #bbb;
    font-size: 12px;
}

/* ===================== 输入区 ===================== */
.ccp-input-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e8ecf4;
    min-width: 260px;
    background: #fff;
}

.ccp-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 14px;
    background: #fafbff;
    border-bottom: 1px solid #eef1f8;
    flex-shrink: 0;
}

.ccp-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #3949ab;
}

.ccp-char-count {
    font-size: 11px;
    color: #9e9e9e;
    font-variant-numeric: tabular-nums;
}

.ccp-char-count.warning { color: #e67e22; }
.ccp-char-count.danger { color: #e53935; font-weight: 600; }

.ccp-textarea {
    flex: 1;
    padding: 16px 18px;
    border: none;
    outline: none;
    resize: none;
    font-size: 20px;
    line-height: 2;
    color: #212121;
    background: #fff;
    font-family: "Microsoft YaHei", "PingFang SC", "SimSun", serif;
    letter-spacing: 3px;
}

.ccp-textarea::placeholder {
    font-size: 13px;
    color: #c5cae9;
    line-height: 1.9;
    letter-spacing: 0;
}

.ccp-quick-examples {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 8px 14px;
    border-top: 1px solid #eef1f8;
    background: #fafbff;
    flex-shrink: 0;
}

.ccp-quick-label {
    font-size: 11px;
    color: #9e9e9e;
    white-space: nowrap;
}

.ccp-quick-chip {
    padding: 3px 10px;
    background: #fff;
    border: 1px solid #c5cae9;
    border-radius: 12px;
    color: #3949ab;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.18s;
}

.ccp-quick-chip:hover {
    background: #3949ab;
    color: #fff;
    border-color: #3949ab;
    transform: translateY(-1px);
}

.ccp-convert-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 12px 14px;
    padding: 12px 0;
    background: linear-gradient(135deg, #1a237e, #3949ab);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.ccp-convert-btn:hover {
    background: linear-gradient(135deg, #0d1754, #1a237e);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(26, 35, 126, 0.35);
}

.ccp-convert-btn:active {
    transform: translateY(0);
}

.ccp-convert-btn:disabled {
    background: #9e9e9e;
    cursor: not-allowed;
    pointer-events: none;
}

.ccp-btn-hint {
    font-size: 11px;
    opacity: 0.65;
    font-weight: 400;
}

/* ===================== 结果区 ===================== */
.ccp-result-section {
    flex: 1.3;
    display: flex;
    flex-direction: column;
    min-width: 280px;
    background: #fff;
}

.ccp-result-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ccp-result-stat {
    font-size: 11px;
    color: #9e9e9e;
    background: #f0f3fb;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.ccp-action-btn {
    padding: 4px 10px;
    background: #f5f6ff;
    border: 1px solid #dde3f0;
    border-radius: 4px;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.18s;
}

.ccp-action-btn:hover {
    background: #e8eaf6;
    border-color: #3949ab;
    color: #3949ab;
}

.ccp-action-btn--xs {
    font-size: 11px;
    padding: 2px 7px;
}

/* 错误提示文字（JS动态生成时使用，禁止内联style） */
.ccp-err-text { color: #e53935; }

/* 按钮上方间距（JS动态生成时使用，禁止内联style） */
.ccp-action-btn--gap { margin-top: 10px; }

.ccp-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px;
}

.ccp-result-body::-webkit-scrollbar { width: 4px; }
.ccp-result-body::-webkit-scrollbar-track { background: #f5f6ff; }
.ccp-result-body::-webkit-scrollbar-thumb { background: #c5cae9; border-radius: 3px; }
.ccp-result-body::-webkit-scrollbar-thumb:hover { background: #3949ab; }

/* 占位符：flex: 1 确保三态（placeholder/loading/error）高度一致、内容垂直居中 */
.ccp-result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #bbb;
    text-align: center;
}

.ccp-placeholder-icon {
    font-size: 56px;
    margin-bottom: 14px;
    opacity: 0.45;
}

.ccp-placeholder-title {
    font-size: 16px;
    color: #9e9e9e;
    font-weight: 600;
    margin-bottom: 8px;
}

.ccp-placeholder-desc {
    font-size: 12px;
    color: #c5cae9;
    margin-bottom: 18px;
}

.ccp-tone-preview {
    display: flex;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
}

/* 占位区功能特性标签 */
.ccp-feature-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: center;
    margin-top: 18px;
}

.ccp-feature-pill {
    padding: 4px 11px;
    background: #f0f3fb;
    border: 1px solid #c5cae9;
    border-radius: 20px;
    font-size: 11px;
    color: #3949ab;
    cursor: default;
    transition: all 0.18s;
}

.ccp-feature-pill:hover {
    transform: translateY(-2px);
    background: #e8eaf6;
    box-shadow: 0 2px 6px rgba(57, 73, 171, 0.15);
}

/* 声调着色预览 */
.tone-demo.t1 { color: #1565c0; }
.tone-demo.t2 { color: #2e7d32; }
.tone-demo.t3 { color: #e65100; }
.tone-demo.t4 { color: #b71c1c; }

/* ===================== 拼音结果样式 ===================== */
.ccp-pinyin-block {
    animation: ccpFadeUp 0.32s ease-out forwards;
}

@keyframes ccpFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.ccp-spinning {
    display: inline-block;
    animation: spin 1s linear infinite;
    opacity: 1 !important;
}

.ccp-paragraph {
    margin-bottom: 22px;
}

.ccp-paragraph + .ccp-paragraph {
    padding-top: 16px;
    border-top: 1px dashed #e8ecf4;
}

/* 上下对照模式 */
.ccp-pair-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    line-height: 1.3;
}

.ccp-pair {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 20px;
    padding: 3px 4px;
    border-radius: 5px;
    transition: background 0.15s;
    cursor: default;
}

.ccp-pair:hover {
    background: #eef1fb;
}

.ccp-pair:hover .ccp-hz {
    color: #1a237e;
}

/* 声调颜色 */
.ccp-py {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1.6;
    white-space: nowrap;
}

.ccp-py[data-tone="0"] { color: #9e9e9e; }   /* 轻声 */
.ccp-py[data-tone="1"] { color: #1565c0; }   /* 1声蓝 */
.ccp-py[data-tone="2"] { color: #2e7d32; }   /* 2声绿 */
.ccp-py[data-tone="3"] { color: #e65100; }   /* 3声橙 */
.ccp-py[data-tone="4"] { color: #b71c1c; }   /* 4声红 */
.ccp-py.no-color { color: #555; }             /* 关闭着色 */

.ccp-hz {
    font-size: 22px;
    color: #212121;
    font-family: "Microsoft YaHei", "PingFang SC", "SimSun", serif;
    line-height: 1.2;
    position: relative;
}

/* 多音字汉字：橙色虚线下划线 + help光标，无论是否开启'多音字标注'开关均生效 */
.ccp-hz.poly-hz {
    border-bottom: 2px dashed #e67e22;
    cursor: help;
}

/* 多音字标记 */
.poly-mark {
    font-size: 9px;
    color: #e65100;
    background: #fff3e0;
    border: 1px solid #ffcc80;
    border-radius: 3px;
    padding: 0 3px;
    vertical-align: super;
    margin-left: 1px;
    font-weight: 700;
}

/* 纯拼音模式 */
.ccp-plain-py-wrap {
    font-size: 17px;
    line-height: 2.2;
    word-spacing: 5px;
    color: #333;
}

.ccp-plain-py-wrap .py-span[data-tone="0"] { color: #9e9e9e; }
.ccp-plain-py-wrap .py-span[data-tone="1"] { color: #1565c0; }
.ccp-plain-py-wrap .py-span[data-tone="2"] { color: #2e7d32; }
.ccp-plain-py-wrap .py-span[data-tone="3"] { color: #e65100; }
.ccp-plain-py-wrap .py-span[data-tone="4"] { color: #b71c1c; }
.ccp-plain-py-wrap .py-span.no-color { color: #555; }

/* 未找到拼音的字 */
.ccp-unknown {
    font-size: 12px;
    color: #bbb;
    text-decoration: underline dotted;
}

/* ===================== AI侧边栏 ===================== */
.ccp-ai-sidebar {
    position: fixed;
    top: 0;
    right: -430px;
    width: 410px;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.13);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ccp-ai-sidebar.open {
    right: 0;
}

.ccp-ai-sidebar-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, #1a237e, #3949ab);
    color: #fff;
    flex-shrink: 0;
}

.ccp-ai-sidebar-title {
    font-size: 15px;
    font-weight: 700;
}

.ccp-ai-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ccp-ai-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.ccp-ai-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ccp-ai-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.ccp-ai-field-label {
    font-size: 12px;
    font-weight: 700;
    color: #555;
}

.ccp-ai-mode-group {
    display: flex;
    gap: 6px;
}

.ccp-mode-btn {
    flex: 1;
    padding: 7px 4px;
    border: 1px solid #dde3f0;
    border-radius: 6px;
    background: #fafbff;
    color: #666;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.ccp-mode-btn.active {
    background: #1a237e;
    border-color: #1a237e;
    color: #fff;
    font-weight: 600;
}

.ccp-mode-btn:hover:not(.active) {
    border-color: #3949ab;
    color: #3949ab;
    background: #e8eaf6;
}

.ccp-ai-textarea {
    padding: 10px 12px;
    border: 1px solid #dde3f0;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    font-family: "Microsoft YaHei", serif;
    line-height: 1.7;
}

.ccp-ai-textarea:focus {
    border-color: #3949ab;
    box-shadow: 0 0 0 2px rgba(57, 73, 171, 0.1);
}

.ccp-ai-actions {
    display: flex;
    gap: 8px;
}

.ccp-ai-submit {
    flex: 1;
    padding: 10px;
    background: linear-gradient(135deg, #1a237e, #3949ab);
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.ccp-ai-submit:hover {
    background: linear-gradient(135deg, #0d1754, #1a237e);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 35, 126, 0.3);
}

.ccp-ai-cancel {
    padding: 10px 16px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 7px;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.ccp-ai-cancel:hover {
    background: #fde8e8;
    border-color: #e53935;
    color: #e53935;
}

.ccp-ai-result {
    border: 1px solid #e8ecf4;
    border-radius: 7px;
    overflow: hidden;
}

.ccp-ai-result-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 12px;
    background: #f0f3fb;
    border-bottom: 1px solid #e0e6f0;
    font-size: 12px;
    font-weight: 700;
    color: #3949ab;
}

.ccp-ai-result-body {
    padding: 12px;
    font-size: 13px;
    line-height: 1.9;
    color: #333;
    max-height: 360px;
    overflow-y: auto;
    word-break: break-word;
}

.ccp-ai-result-body.loading::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 14px;
    background: #3949ab;
    animation: ccpBlink 0.8s step-end infinite;
    margin-left: 2px;
    vertical-align: text-bottom;
}

@keyframes ccpBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* AI结果标题：通过语义化CSS类控制颜色，禁止内联style硬编码 */
.ccp-md-h2 { display: block; margin: 14px 0 5px; font-size: 15px; font-weight: 700; color: #1a237e; }
.ccp-md-h3 { display: block; margin: 12px 0 4px; font-size: 14px; font-weight: 700; color: #1a237e; }
.ccp-md-h4 { display: block; margin: 10px 0 4px; font-size: 13px; font-weight: 700; color: #1a237e; }

/* Markdown列表（JS动态生成时使用，禁止内联style） */
.ccp-md-ul { padding-left: 18px; margin: 6px 0; list-style: disc; }
.ccp-md-li { margin: 3px 0; }

/* 分析模式实时说明 */
.ccp-mode-hint {
    padding: 7px 10px;
    background: #f0f3fb;
    border-radius: 5px;
    border-left: 3px solid #3949ab;
    font-size: 11px;
    color: #555;
    line-height: 1.6;
    min-height: 32px;
}

.ccp-ai-tips {
    padding: 10px 12px;
    background: #f0f3fb;
    border: 1px solid #c5cae9;
    border-radius: 6px;
    font-size: 11px;
    color: #666;
}

.ccp-ai-tips p {
    margin: 0 0 5px;
    font-weight: 700;
    color: #3949ab;
}

.ccp-ai-tips ul {
    margin: 0;
    padding-left: 16px;
}

.ccp-ai-tips li {
    margin-bottom: 4px;
}

/* ===================== 遮罩层 ===================== */
.ccp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.28);
    z-index: 999;
    display: none;
}

.ccp-overlay.visible {
    display: block;
}

/* ===================== Toast ===================== */
.ccp-toast-wrap {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 7px;
    pointer-events: none;
}

.ccp-toast {
    padding: 9px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    animation: ccpToastIn 0.28s ease;
    pointer-events: none;
}

.ccp-toast.success { background: #2e7d32; }
.ccp-toast.error   { background: #b71c1c; }
.ccp-toast.info    { background: #1565c0; }
.ccp-toast.warning { background: #e65100; }

@keyframes ccpToastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes ccpToastOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-10px); }
}

/* ===================== 全屏模式 ===================== */
.ccp-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 800;
    border-radius: 0;
    box-shadow: none;
}

/* ===================== 暗黑模式 ===================== */
body.dark .ccp-container {
    background: #1a1a2e;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

body.dark .ccp-toolbar {
    background: linear-gradient(135deg, #0d0f2e 0%, #1a1c4a 50%, #0d0f2e 100%);
    border-color: #0a0c24;
}

body.dark .ccp-history {
    background: #1e1e38;
    border-color: #2a2a50;
}

body.dark .ccp-history-head {
    background: linear-gradient(to bottom, #1e1e38, #1a1a30);
    border-color: #2a2a50;
}

body.dark .ccp-history-title { color: #7986cb; }

body.dark .ccp-history-clear { color: #555; }
body.dark .ccp-history-clear:hover { color: #ef5350; background: #3a1a1a; }

body.dark .ccp-history-search input {
    background: #16162e;
    border-color: #333366;
    color: #ccc;
}
body.dark .ccp-history-search input:focus {
    border-color: #5c6bc0;
    box-shadow: 0 0 0 2px rgba(92, 107, 192, 0.15);
}

body.dark .ccp-history-item { border-color: #2a2a50; }
body.dark .ccp-history-item:hover { background: #242444; }
body.dark .ccp-history-item.active {
    background: #242444;
    box-shadow: inset 3px 0 0 #3b82f6, 0 1px 5px rgba(0, 0, 0, 0.3);
}
body.dark .ccp-history-item-text { color: #bbb; }
body.dark .ccp-history-item-time { color: #555; }
body.dark .ccp-history-item-del:hover { color: #c62828; }
body.dark .ccp-history-empty { color: #444; }

body.dark .ccp-input-section { background: #1a1a2e; border-color: #2a2a50; }
body.dark .ccp-section-header { background: #1e1e38; border-color: #2a2a50; }
body.dark .ccp-section-title { color: #7986cb; }
body.dark .ccp-char-count { color: #555; }

body.dark .ccp-textarea {
    background: #1a1a2e;
    color: #ddd;
}
body.dark .ccp-textarea::placeholder { color: #2d2d5a; }

body.dark .ccp-quick-examples { background: #1e1e38; border-color: #2a2a50; }
body.dark .ccp-quick-chip {
    background: #16162e;
    border-color: #333366;
    color: #7986cb;
}
body.dark .ccp-quick-chip:hover {
    background: #3949ab;
    color: #fff;
    border-color: #3949ab;
}

body.dark .ccp-convert-btn {
    background: linear-gradient(135deg, #0d0f2e, #1a237e);
}
body.dark .ccp-convert-btn:hover {
    background: linear-gradient(135deg, #060820, #0d1754);
    box-shadow: 0 5px 14px rgba(57, 73, 171, 0.4);
}

body.dark .ccp-result-section { background: #1a1a2e; }
body.dark .ccp-result-body { background: #1a1a2e; }
body.dark .ccp-result-body::-webkit-scrollbar-track { background: #1a1a2e; }
body.dark .ccp-result-body::-webkit-scrollbar-thumb { background: #333366; }
body.dark .ccp-result-body::-webkit-scrollbar-thumb:hover { background: #5c6bc0; }

body.dark .ccp-result-stat { color: #666; background: #1e1e38; }
body.dark .ccp-action-btn {
    background: #1e1e38;
    border-color: #333366;
    color: #9e9e9e;
}
body.dark .ccp-action-btn:hover {
    background: #242444;
    border-color: #5c6bc0;
    color: #7986cb;
}

body.dark .ccp-placeholder-title { color: #555; }
body.dark .ccp-placeholder-desc { color: #555; }

body.dark .ccp-hz { color: #e0e7ff; }

body.dark .ccp-pair:hover {
    background: #252545;
}

body.dark .ccp-pair:hover .ccp-hz {
    color: #7986cb;
}

/* 暗黑模式声调色 */
body.dark .ccp-py[data-tone="0"] { color: #757575; }
body.dark .ccp-py[data-tone="1"] { color: #64b5f6; }
body.dark .ccp-py[data-tone="2"] { color: #81c784; }
body.dark .ccp-py[data-tone="3"] { color: #ffb74d; }
body.dark .ccp-py[data-tone="4"] { color: #ef9a9a; }
body.dark .ccp-py.no-color { color: #aaa; }

body.dark .ccp-plain-py-wrap { color: #bbb; }
body.dark .ccp-plain-py-wrap .py-span[data-tone="0"] { color: #757575; }
body.dark .ccp-plain-py-wrap .py-span[data-tone="1"] { color: #64b5f6; }
body.dark .ccp-plain-py-wrap .py-span[data-tone="2"] { color: #81c784; }
body.dark .ccp-plain-py-wrap .py-span[data-tone="3"] { color: #ffb74d; }
body.dark .ccp-plain-py-wrap .py-span[data-tone="4"] { color: #ef9a9a; }
body.dark .ccp-plain-py-wrap .py-span.no-color { color: #aaa; }

body.dark .ccp-paragraph { border-color: #2a2a50; }

body.dark .poly-mark {
    color: #ffb74d;
    background: #2e2000;
    border-color: #5c3a00;
}

/* 暗黑模式：多音字虚线下划线 */
body.dark .ccp-hz.poly-hz {
    border-bottom-color: #ffb74d;
}

/* 暗黑模式：AI结果标题 */
body.dark .ccp-md-h2, body.dark .ccp-md-h3, body.dark .ccp-md-h4 { color: #7986cb; }

/* 暗黑模式：分析模式说明 */
body.dark .ccp-mode-hint {
    background: #1e1e38;
    border-left-color: #5c6bc0;
    color: #888;
}

/* 暗黑模式：功能特性标签 */
body.dark .ccp-feature-pill {
    background: #1e1e38;
    border-color: #333366;
    color: #7986cb;
}

body.dark .ccp-feature-pill:hover {
    background: #242444;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

body.dark .ccp-ai-sidebar {
    background: #1a1a2e;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
}
body.dark .ccp-ai-sidebar-head {
    background: linear-gradient(135deg, #0d0f2e, #1a237e);
}
body.dark .ccp-ai-field-label { color: #9e9e9e; }
body.dark .ccp-mode-btn {
    background: #16162e;
    border-color: #333366;
    color: #888;
}
body.dark .ccp-mode-btn.active {
    background: #1a237e;
    border-color: #3949ab;
}
body.dark .ccp-mode-btn:hover:not(.active) {
    border-color: #5c6bc0;
    color: #7986cb;
    background: #242444;
}
body.dark .ccp-ai-textarea {
    background: #16162e;
    border-color: #333366;
    color: #ccc;
}
body.dark .ccp-ai-textarea:focus {
    border-color: #5c6bc0;
}
body.dark .ccp-ai-result {
    border-color: #2a2a50;
}
body.dark .ccp-ai-result-head {
    background: #1e1e38;
    border-color: #2a2a50;
    color: #7986cb;
}
body.dark .ccp-ai-result-body {
    color: #ccc;
    background: #1a1a2e;
}
body.dark .ccp-ai-result-body.loading::after { background: #7986cb; }
body.dark .ccp-ai-tips {
    background: #1e1e38;
    border-color: #333366;
    color: #777;
}
body.dark .ccp-ai-tips p { color: #7986cb; }

/* 暗黑模式：错误提示文字 */
body.dark .ccp-err-text { color: #ef5350; }

body.dark .ccp-ai-cancel:hover {
    background: #3a1a1a;
    border-color: #ef5350;
    color: #ef5350;
}

/* ===================== 响应式 ===================== */
@media (max-width: 900px) {
    .ccp-history { display: none; }
    .ccp-toolbar-center { order: 3; width: 100%; }
}

@media (max-width: 639px) {
    .ccp-main { flex-direction: column; }
    .ccp-input-section { border-right: none; border-bottom: 1px solid #e8ecf4; min-height: 260px; }
    .ccp-result-section { min-height: 280px; }
    .ccp-ai-sidebar { width: 100%; right: -100%; }
    .ccp-ai-sidebar.open { right: 0; }
    .ccp-toolbar { flex-wrap: wrap; }
}

.ccp-container.fullscreen {
    z-index: 99999;
}