/* ========== 代码命名风格切换 - 专属样式 ========== */
/* 开发者主题：深蓝渐变工具栏 + 代码等宽字体 + 各风格色彩标识 */

/* ========== 主容器 ========== */
.cn-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 580px;
    background: #f0f4f8;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.cn-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.cn-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 14px;
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    color: #e2e8f0;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(15, 32, 39, 0.4);
}

.cn-toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.cn-toolbar-brand {
    font-size: 13px;
    font-weight: 700;
    color: #7dd3fc;
    letter-spacing: 0.5px;
    margin-right: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.cn-toolbar-btn {
    padding: 6px 11px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #e2e8f0;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1;
}

.cn-toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.cn-toolbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cn-toolbar-btn.cn-btn-primary {
    background: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%);
    border-color: #0284c7;
    color: #fff;
    font-weight: 600;
}

.cn-toolbar-btn.cn-btn-primary:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0369a1 100%);
    box-shadow: 0 3px 10px rgba(6, 182, 212, 0.4);
}

/* ========== 三栏布局 ========== */
.cn-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f0f4f8;
}

/* ========== 左栏：历史记录 ========== */
.cn-history-panel {
    width: 190px;
    min-width: 150px;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.cn-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.cn-history-header h3 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cn-history-count {
    font-size: 10px;
    background: #e2e8f0;
    color: #64748b;
    border-radius: 8px;
    padding: 1px 5px;
    margin-left: 4px;
}

.cn-history-clear-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s;
    line-height: 1;
}

.cn-history-clear-btn:hover {
    color: #ef4444;
    background: #fee2e2;
}

.cn-history-search {
    padding: 8px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.cn-history-search input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 11px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #334155;
}

.cn-history-search input:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.1);
}

.cn-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.cn-history-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 11px;
    padding: 24px 8px;
    line-height: 1.8;
}

.cn-history-item {
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    margin-bottom: 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: cn-fadeIn 0.2s ease;
}

.cn-history-item:hover {
    background: #eff6ff;
    border-color: #bae6fd;
    transform: translateX(2px);
}

.cn-history-item.active {
    background: #e0f2fe;
    border-color: #06b6d4;
}

.cn-history-item-input {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.cn-history-item-time {
    font-size: 10px;
    color: #94a3b8;
}

.cn-history-item-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: #fde8e8;
    color: #ef4444;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.2s;
    cursor: pointer;
    line-height: 1;
}

.cn-history-item:hover .cn-history-item-del {
    opacity: 1;
}

.cn-history-item-del:hover {
    background: #ef4444;
    color: #fff;
}

@keyframes cn-fadeIn {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ========== 中栏：输入面板 ========== */
.cn-input-panel {
    width: 320px;
    min-width: 260px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cn-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 16px;
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.cn-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.cn-detect-badge {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #06b6d4, #0284c7);
    padding: 2px 8px;
    border-radius: 10px;
    font-family: 'Consolas', 'Monaco', monospace;
    animation: cn-detect-appear 0.3s ease;
}

@keyframes cn-detect-appear {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.cn-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* 主输入框 */
.cn-input-wrapper {
    position: relative;
}

.cn-main-input {
    width: 100%;
    padding: 11px 36px 11px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    color: #1e293b;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #f8fafc;
}

.cn-main-input:focus {
    border-color: #06b6d4;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12);
}

.cn-main-input::placeholder {
    color: #94a3b8;
    font-family: inherit;
    font-size: 12px;
}

.cn-input-clear-x {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #e2e8f0;
    border: none;
    color: #64748b;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.cn-input-clear-x:hover {
    background: #cbd5e1;
    color: #334155;
}

/* 分词预览 */
.cn-words-preview {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    font-size: 12px;
    flex-wrap: wrap;
}

.cn-words-label {
    color: #16a34a;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.cn-words-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.cn-word-chip {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    font-weight: 600;
    animation: cn-chip-in 0.18s ease;
}

@keyframes cn-chip-in {
    from { opacity: 0; transform: scale(0.82); }
    to   { opacity: 1; transform: scale(1); }
}

/* 命名风格说明表格 */
.cn-style-guide {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
}

.cn-guide-title {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 10px;
    font-weight: 600;
}

.cn-guide-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.cn-guide-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 8px;
    border-radius: 5px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left-width: 3px;
    transition: all 0.15s;
}

.cn-guide-item:hover {
    transform: translateX(2px);
}

.cn-guide-name {
    font-size: 10px;
    font-weight: 600;
    color: #475569;
}

.cn-guide-ex {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 10px;
    color: #64748b;
}

/* 各风格颜色 */
.cn-style-camel    { border-left-color: #22c55e; }
.cn-style-pascal   { border-left-color: #3b82f6; }
.cn-style-snake    { border-left-color: #f59e0b; }
.cn-style-screaming{ border-left-color: #ef4444; }
.cn-style-kebab    { border-left-color: #8b5cf6; }
.cn-style-cobol    { border-left-color: #ec4899; }
.cn-style-dot      { border-left-color: #06b6d4; }
.cn-style-space    { border-left-color: #64748b; }
.cn-style-title    { border-left-color: #f97316; }
.cn-style-path     { border-left-color: #10b981; }

/* 快速示例 */
.cn-quick-examples {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.cn-qe-label {
    font-size: 11px;
    color: #64748b;
    flex-shrink: 0;
    white-space: nowrap;
}

.cn-qe-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.cn-qe-tag {
    padding: 3px 8px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 10px;
    color: #0284c7;
    cursor: pointer;
    transition: all 0.15s;
}

.cn-qe-tag:hover {
    background: #e0f2fe;
    border-color: #06b6d4;
    transform: translateY(-1px);
}

.cn-qe-tag:active {
    transform: scale(0.97);
    background: #bae6fd;
}

/* 操作提示 */
.cn-input-hint {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    padding: 4px 0;
}

/* ========== 右栏：结果面板 ========== */
.cn-results-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f0f4f8;
    min-width: 300px;
}

.cn-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 16px;
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 6px;
}

.cn-results-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.cn-results-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.cn-word-count {
    font-size: 11px;
    color: #64748b;
    font-family: 'Consolas', 'Monaco', monospace;
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 8px;
}

/* 空状态 */
.cn-results-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    color: #94a3b8;
}

.cn-placeholder-icon {
    font-size: 48px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 16px;
    letter-spacing: -2px;
    animation: cn-placeholder-breathe 3s ease-in-out infinite;
}

@keyframes cn-placeholder-breathe {
    0%, 100% { opacity: 0.45; }
    50%       { opacity: 0.75; }
}

.cn-placeholder-title {
    font-size: 15px;
    font-weight: 600;
    color: #94a3b8;
    margin: 0 0 8px 0;
}

.cn-placeholder-desc {
    font-size: 12px;
    color: #cbd5e1;
    margin: 0 0 4px 0;
}

/* 结果列表 */
.cn-results-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-content: start;
}

/* 结果卡片 */
.cn-result-item {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    border-left-width: 4px;
    overflow: hidden;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    animation: cn-slideIn 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.cn-result-item:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

@keyframes cn-slideIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cn-result-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 4px;
}

.cn-result-style-label {
    font-size: 11px;
    font-weight: 700;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #334155;
}

.cn-result-usage {
    font-size: 9px;
    color: #94a3b8;
    flex-shrink: 1;
    line-height: 1.4;
}

.cn-result-value-row {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    gap: 6px;
    flex: 1;
}

.cn-result-value {
    flex: 1;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    word-break: break-all;
    line-height: 1.4;
    cursor: pointer;
    user-select: all;
}

.cn-result-copy-btn {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: #64748b;
}

.cn-result-copy-btn:hover {
    background: #e2e8f0;
    color: #334155;
    transform: scale(1.1);
}

.cn-result-copy-btn.copied {
    background: #dcfce7;
    border-color: #86efac;
    color: #16a34a;
}

.cn-result-desc {
    padding: 0 10px 7px;
    font-size: 9px;
    color: #94a3b8;
    line-height: 1.4;
}

/* 检测到的输入风格高亮 */
.cn-result-item.cn-result-detected {
    background: #f0feff;
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.35);
}

.cn-result-item.cn-result-detected:hover {
    background: #e6fdff;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.18), 0 0 0 2px rgba(6, 182, 212, 0.4);
}

.cn-detected-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    background: #06b6d4;
    color: #fff;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 5px;
    vertical-align: middle;
    font-family: inherit;
    letter-spacing: 0.3px;
}

/* 各风格卡片左边框颜色 */
.cn-result-camelCase          { border-left-color: #22c55e; }
.cn-result-PascalCase         { border-left-color: #3b82f6; }
.cn-result-snake_case         { border-left-color: #f59e0b; }
.cn-result-SCREAMING_SNAKE    { border-left-color: #ef4444; }
.cn-result-kebab              { border-left-color: #8b5cf6; }
.cn-result-COBOL              { border-left-color: #ec4899; }
.cn-result-dot                { border-left-color: #06b6d4; }
.cn-result-space              { border-left-color: #64748b; }
.cn-result-Title              { border-left-color: #f97316; }
.cn-result-path               { border-left-color: #10b981; }

/* 结果值颜色（与卡片匹配） */
.cn-result-camelCase   .cn-result-value { color: #15803d; }
.cn-result-PascalCase  .cn-result-value { color: #1d4ed8; }
.cn-result-snake_case  .cn-result-value { color: #b45309; }
.cn-result-SCREAMING_SNAKE .cn-result-value { color: #dc2626; }
.cn-result-kebab       .cn-result-value { color: #7c3aed; }
.cn-result-COBOL       .cn-result-value { color: #be185d; }
.cn-result-dot         .cn-result-value { color: #0e7490; }
.cn-result-space       .cn-result-value { color: #475569; }
.cn-result-Title       .cn-result-value { color: #c2410c; }
.cn-result-path        .cn-result-value { color: #047857; }

/* ========== 示例模态框 ========== */
.cn-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99998;
    backdrop-filter: blur(2px);
}

.cn-modal-overlay.show { display: block; }

.cn-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 580px;
    max-height: 80vh;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    overflow: hidden;
    flex-direction: column;
    animation: cn-modalIn 0.2s ease;
}

.cn-modal.show { display: flex; }

@keyframes cn-modalIn {
    from { opacity: 0; transform: translate(-50%, -52%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

.cn-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #0f2027, #2c5364);
    color: #e2e8f0;
    flex-shrink: 0;
}

.cn-modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.cn-modal-close {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #e2e8f0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.cn-modal-close:hover { background: rgba(255, 255, 255, 0.3); }

.cn-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.cn-example-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.cn-example-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.cn-example-card:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(59, 130, 246, 0.1);
}

.cn-example-card-title {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cn-example-card-input {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: #0284c7;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cn-example-card-desc {
    font-size: 10px;
    color: #94a3b8;
}

/* ========== AI 侧边栏 ========== */
.cn-ai-sidebar {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    z-index: 100002;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.cn-ai-sidebar.show { right: 0; }

.cn-ai-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 100001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(2px);
}

.cn-ai-overlay.show {
    opacity: 1;
    visibility: visible;
}

.cn-ai-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0f2027, #2c5364);
    color: #e2e8f0;
    flex-shrink: 0;
}

.cn-ai-sidebar-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.cn-ai-close-btn {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #e2e8f0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.cn-ai-close-btn:hover { background: rgba(255, 255, 255, 0.3); }

.cn-ai-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cn-ai-form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cn-ai-form-row label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.cn-ai-select {
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #334155;
    outline: none;
    transition: all 0.2s;
    background: #f8fafc;
    cursor: pointer;
}

.cn-ai-select:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.1);
    background: #fff;
}

.cn-ai-textarea {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #334155;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: all 0.2s;
    background: #f8fafc;
    min-height: 90px;
    box-sizing: border-box;
    width: 100%;
}

.cn-ai-textarea:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.1);
    background: #fff;
}

.cn-ai-actions {
    display: flex;
    gap: 10px;
}

.cn-ai-btn {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.cn-ai-btn-primary {
    background: linear-gradient(135deg, #06b6d4, #0284c7);
    color: #fff;
}

.cn-ai-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #0891b2, #0369a1);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.cn-ai-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cn-ai-btn-cancel {
    background: #fee2e2;
    color: #dc2626;
}

.cn-ai-btn-cancel:hover {
    background: #fecaca;
}

.cn-ai-result {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

/* AI 建议卡片（由后端渲染 HTML 注入） */
.cn-ai-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

.cn-ai-suggest-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #06b6d4;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.cn-ai-suggest-item:hover {
    background: #f0f9ff;
    border-color: #bae6fd;
    border-left-color: #06b6d4;
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.1);
}

.cn-ai-suggest-name {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    font-weight: 700;
    color: #0284c7;
}

.cn-ai-suggest-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

.cn-ai-suggest-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.cn-ai-tag {
    display: inline-block;
    padding: 1px 6px;
    background: #e0f2fe;
    color: #0284c7;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}

.cn-ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    color: #64748b;
    font-size: 13px;
}

.cn-loading-dots {
    display: flex;
    gap: 5px;
}

.cn-loading-dots span {
    width: 8px;
    height: 8px;
    background: #06b6d4;
    border-radius: 50%;
    animation: cn-dot-bounce 1.2s infinite ease-in-out;
}

.cn-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.cn-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes cn-dot-bounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
    40%           { transform: scale(1.0); opacity: 1; }
}

.cn-ai-error {
    padding: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #dc2626;
    font-size: 12px;
}

.cn-ai-tips {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 12px;
    color: #64748b;
}

.cn-ai-tips p {
    margin: 0 0 8px;
    font-weight: 600;
    color: #334155;
    font-size: 12px;
}

.cn-ai-tips ul {
    margin: 0;
    padding-left: 16px;
}

.cn-ai-tips li {
    margin-bottom: 4px;
    line-height: 1.5;
}

.cn-ai-tips li::marker {
    color: #06b6d4;
}

.cn-required { color: #ef4444; }

/* ========== Toast 提示 ========== */
.cn-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 32, 39, 0.92);
    color: #e2e8f0;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    z-index: 999999;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.cn-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .cn-results-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .cn-history-panel {
        display: none;
    }
    .cn-input-panel {
        width: 260px;
        min-width: 220px;
    }
    .cn-example-grid {
        grid-template-columns: 1fr;
    }
    .cn-ai-sidebar {
        width: 90vw;
        right: -90vw;
    }
}

@media (max-width: 560px) {
    .cn-input-panel {
        width: 220px;
    }
    .cn-guide-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== 暗黑模式 ========== */
body.dark .cn-container {
    background: #0f172a;
}

body.dark .cn-toolbar {
    background: linear-gradient(135deg, #020617 0%, #0f172a 50%, #1e293b 100%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

body.dark .cn-toolbar-btn {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

body.dark .cn-toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.13);
}

body.dark .cn-toolbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

body.dark .cn-main-content {
    background: #0f172a;
}

/* 历史面板 */
body.dark .cn-history-panel {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.15);
}

body.dark .cn-history-header {
    background: linear-gradient(to bottom, #253244, #1e293b);
    border-bottom-color: rgba(148, 163, 184, 0.15);
}

body.dark .cn-history-header h3 {
    color: #94a3b8;
}

body.dark .cn-history-count {
    background: rgba(148, 163, 184, 0.15);
    color: #64748b;
}

body.dark .cn-history-search input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark .cn-history-search input::placeholder {
    color: #475569;
}

body.dark .cn-history-item {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.15);
}

body.dark .cn-history-item:hover {
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.3);
}

body.dark .cn-history-item.active {
    background: rgba(6, 182, 212, 0.12);
    border-color: #06b6d4;
}

body.dark .cn-history-item-input {
    color: #e2e8f0;
}

/* 输入面板 */
body.dark .cn-input-panel {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.15);
}

body.dark .cn-panel-header {
    background: linear-gradient(to bottom, #253244, #1e293b);
    border-bottom-color: rgba(148, 163, 184, 0.15);
}

body.dark .cn-panel-header h3 {
    color: #e2e8f0;
}

body.dark .cn-main-input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark .cn-main-input:focus {
    border-color: #06b6d4;
    background: #0f172a;
}

body.dark .cn-main-input::placeholder {
    color: #475569;
}

body.dark .cn-words-preview {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.25);
}

body.dark .cn-style-guide {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.15);
}

body.dark .cn-guide-title {
    color: #475569;
}

body.dark .cn-guide-item {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.12);
}

body.dark .cn-guide-name {
    color: #94a3b8;
}

body.dark .cn-guide-ex {
    color: #64748b;
}

body.dark .cn-qe-tag {
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.25);
    color: #22d3ee;
}

body.dark .cn-qe-tag:hover {
    background: rgba(6, 182, 212, 0.18);
}

body.dark .cn-input-hint {
    color: #475569;
}

/* 结果面板 */
body.dark .cn-results-panel {
    background: #0f172a;
}

body.dark .cn-results-header {
    background: linear-gradient(to bottom, #1e293b, #162032);
    border-bottom-color: rgba(148, 163, 184, 0.15);
    flex-wrap: wrap;
    gap: 6px;
}

body.dark .cn-results-header h3 {
    color: #e2e8f0;
}

body.dark .cn-word-count {
    background: rgba(148, 163, 184, 0.15);
    color: #64748b;
}

body.dark .cn-placeholder-icon {
    color: #1e293b;
}

body.dark .cn-placeholder-title {
    color: #6e7681;
}

body.dark .cn-result-item {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.12);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

body.dark .cn-result-item:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

body.dark .cn-result-head {
    border-bottom-color: rgba(148, 163, 184, 0.1);
}

body.dark .cn-result-style-label {
    color: #94a3b8;
}

body.dark .cn-result-desc {
    color: #475569;
}

body.dark .cn-result-copy-btn {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

body.dark .cn-result-copy-btn:hover {
    background: rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
}

body.dark .cn-result-copy-btn.copied {
    background: rgba(74, 222, 128, 0.12);
    border-color: rgba(74, 222, 128, 0.25);
    color: #4ade80;
}

/* 暗黑模式各命名风格结果值颜色 */
body.dark .cn-result-item.cn-result-detected {
    background: rgba(6, 182, 212, 0.08);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.3);
}

body.dark .cn-result-camelCase   .cn-result-value { color: #4ade80; }
body.dark .cn-result-PascalCase  .cn-result-value { color: #60a5fa; }
body.dark .cn-result-snake_case  .cn-result-value { color: #fbbf24; }
body.dark .cn-result-SCREAMING_SNAKE .cn-result-value { color: #f87171; }
body.dark .cn-result-kebab       .cn-result-value { color: #a78bfa; }
body.dark .cn-result-COBOL       .cn-result-value { color: #f472b6; }
body.dark .cn-result-dot         .cn-result-value { color: #22d3ee; }
body.dark .cn-result-space       .cn-result-value { color: #94a3b8; }
body.dark .cn-result-Title       .cn-result-value { color: #fb923c; }
body.dark .cn-result-path        .cn-result-value { color: #34d399; }

/* 暗黑模式 AI 侧边栏 */
body.dark .cn-ai-sidebar {
    background: #1e293b;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
}

body.dark .cn-ai-sidebar-header {
    background: linear-gradient(135deg, #020617, #1e293b);
}

body.dark .cn-ai-select,
body.dark .cn-ai-textarea {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark .cn-ai-form-row label {
    color: #94a3b8;
}

body.dark .cn-ai-result {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.15);
}

body.dark .cn-ai-suggest-item {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.12);
    border-left-color: #06b6d4;
}

body.dark .cn-ai-suggest-item:hover {
    background: rgba(6, 182, 212, 0.1);
}

body.dark .cn-ai-suggest-name { color: #22d3ee; }
body.dark .cn-ai-suggest-desc { color: #64748b; }

body.dark .cn-ai-tips {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.12);
}

body.dark .cn-ai-tips p { color: #94a3b8; }
body.dark .cn-ai-tips li { color: #64748b; }

/* 暗黑模式模态框 */
body.dark .cn-modal {
    background: #1e293b;
}

body.dark .cn-modal-body {
    background: #1e293b;
}

body.dark .cn-example-card {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.12);
}

body.dark .cn-example-card:hover {
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.3);
}

body.dark .cn-example-card-title { color: #94a3b8; }
body.dark .cn-example-card-input { color: #22d3ee; }
body.dark .cn-example-card-desc  { color: #475569; }

/* 历史记录滚动条 */
.cn-history-list::-webkit-scrollbar,
.cn-input-body::-webkit-scrollbar,
.cn-results-list::-webkit-scrollbar,
.cn-ai-sidebar-body::-webkit-scrollbar {
    width: 4px;
}

.cn-history-list::-webkit-scrollbar-track,
.cn-input-body::-webkit-scrollbar-track,
.cn-results-list::-webkit-scrollbar-track,
.cn-ai-sidebar-body::-webkit-scrollbar-track {
    background: transparent;
}

.cn-history-list::-webkit-scrollbar-thumb,
.cn-input-body::-webkit-scrollbar-thumb,
.cn-results-list::-webkit-scrollbar-thumb,
.cn-ai-sidebar-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

body.dark .cn-history-list::-webkit-scrollbar-thumb,
body.dark .cn-input-body::-webkit-scrollbar-thumb,
body.dark .cn-results-list::-webkit-scrollbar-thumb,
body.dark .cn-ai-sidebar-body::-webkit-scrollbar-thumb {
    background: #334155;
}

/* ========== 暗黑模式补充 ========== */

/* 输入清除按鈕 */
body.dark .cn-input-clear-x {
    background: #334155;
    color: #64748b;
}
body.dark .cn-input-clear-x:hover {
    background: #475569;
    color: #e2e8f0;
}

/* 分词预览 */
body.dark .cn-words-label {
    color: #34d399;
}
body.dark .cn-word-chip {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.25);
}

/* 检测风格徽标 */
body.dark .cn-detect-badge {
    background: linear-gradient(135deg, #0e7490, #1d4ed8);
}

/* 历史条目删除按钮 */
body.dark .cn-history-item-del {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}
body.dark .cn-history-item-del:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* 历史清空按鈕 */
body.dark .cn-history-clear-btn {
    color: #475569;
}
body.dark .cn-history-clear-btn:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

/* 结果区 usage 文字 */
body.dark .cn-result-usage {
    color: #475569;
}

/* 空状态副文字 */
body.dark .cn-placeholder-desc {
    color: #475569;
}

/* 检测卡片 hover */
body.dark .cn-result-item.cn-result-detected:hover {
    background: rgba(6, 182, 212, 0.12);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(6, 182, 212, 0.35);
}

/* AI 侧边栏 — 加载状态 */
body.dark .cn-ai-loading {
    color: #64748b;
}

/* AI 建议标签 */
body.dark .cn-ai-tag {
    background: rgba(6, 182, 212, 0.12);
    color: #22d3ee;
}

/* AI 错误提示 */
body.dark .cn-ai-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* AI 取消按鈕 */
body.dark .cn-ai-btn-cancel {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}
body.dark .cn-ai-btn-cancel:hover {
    background: rgba(239, 68, 68, 0.22);
}

/* AI 输入框焦点状态 */
body.dark .cn-ai-select:focus,
body.dark .cn-ai-textarea:focus {
    background: #0f172a;
    border-color: #06b6d4;
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.15);
}

body.dark .cn-ai-tips li::marker {
    color: #22d3ee;
}

/* 必填标记 */
body.dark .cn-required {
    color: #f87171;
}

/* ========== 清空历史确认弹框 ========== */
.cn-confirm-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100010;
    backdrop-filter: blur(3px);
}

.cn-confirm-overlay.show { display: block; }

.cn-confirm-dialog {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -52%);
    width: 320px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
    z-index: 100011;
    flex-direction: column;
    align-items: center;
    padding: 28px 24px 20px;
    text-align: center;
    animation: cn-confirmIn 0.22s ease;
    opacity: 0;
    pointer-events: none;
}

.cn-confirm-dialog.show {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%);
}

@keyframes cn-confirmIn {
    from { opacity: 0; transform: translate(-50%, -56%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

.cn-confirm-icon {
    font-size: 36px;
    margin-bottom: 10px;
    line-height: 1;
}

.cn-confirm-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.cn-confirm-desc {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.5;
}

.cn-confirm-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.cn-confirm-btn {
    flex: 1;
    height: 36px;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
}

.cn-confirm-cancel {
    background: #f1f5f9;
    color: #64748b;
}

.cn-confirm-cancel:hover {
    background: #e2e8f0;
    color: #334155;
}

.cn-confirm-ok {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.cn-confirm-ok:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.35);
}

/* 确认弹框暗黑模式 */
body.dark .cn-confirm-dialog {
    background: #1e293b;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

body.dark .cn-confirm-title {
    color: #e2e8f0;
}

body.dark .cn-confirm-desc {
    color: #64748b;
}

body.dark .cn-confirm-cancel {
    background: #334155;
    color: #94a3b8;
}

body.dark .cn-confirm-cancel:hover {
    background: #475569;
    color: #e2e8f0;
}
