/* ============================================================
   歇后语工具 - 传统中国红金主题
   chinese_idiom.css
   ============================================================ */

/* ========== 主容器 ========== */
.ci-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 620px;
    background: linear-gradient(135deg, #fdf6ec 0%, #fef9f0 40%, #fdf0e8 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(139, 0, 0, 0.1), inset 0 1px 0 rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.ci-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8b0000, #ffd700, #c41a1a, #ffd700, #8b0000);
    z-index: 1;
}

/* 全屏模式 */
.ci-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.ci-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    background: linear-gradient(135deg, #6b0000 0%, #a80000 40%, #c41a1a 70%, #d4380d 100%);
    color: white;
    flex-shrink: 0;
    box-shadow: 0 3px 12px rgba(100, 0, 0, 0.4);
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.ci-toolbar::after {
    content: '🏮';
    position: absolute;
    right: 180px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 28px;
    opacity: 0.15;
    pointer-events: none;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.toolbar-subtitle {
    font-size: 11px;
    color: rgba(255, 215, 0, 0.85);
    letter-spacing: 1px;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    padding-left: 10px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ========== 按钮 ========== */
.ci-btn {
    padding: 7px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ci-btn-ghost {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ci-btn-ghost:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.32);
    transform: translateY(-1px);
}

.ci-btn-ghost:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ci-btn-primary {
    background: linear-gradient(135deg, #ffd700, #ffcc00);
    color: #7a0000;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 215, 0, 0.5);
}

.ci-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #ffe033, #ffd700);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(255, 215, 0, 0.4);
}

.ci-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.ci-btn-fullscreen {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.ci-btn-fullscreen:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.28);
}

.ci-btn-fullscreen:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ========== 主内容区 ========== */
.ci-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========== 历史记录栏 ========== */
.ci-history-col {
    width: 190px;
    min-width: 170px;
    flex-shrink: 0;
    overflow: hidden;
    border-right: 1px solid rgba(139, 0, 0, 0.1);
    background: rgba(255, 252, 245, 0.72);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
}

.ci-history-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px 8px;
    border-bottom: 1px solid rgba(139, 0, 0, 0.08);
    background: rgba(255, 245, 235, 0.6);
}

.history-title {
    font-size: 12px;
    font-weight: 600;
    color: #7b3d2a;
}

.history-clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #bc8a5f;
    padding: 2px 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.history-clear-btn:hover {
    background: #fde8e8;
    color: #ef4444;
}

.history-search-wrap {
    padding: 6px 10px;
}

.history-search-input {
    width: 100%;
    padding: 5px 10px;
    border: 1px solid #e8d5c4;
    border-radius: 20px;
    font-size: 12px;
    outline: none;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.2s;
    color: #5d4037;
}

.history-search-input:focus {
    border-color: #c41a1a;
    box-shadow: 0 0 0 2px rgba(196, 26, 26, 0.1);
}

.history-search-input::placeholder {
    color: #c4a882;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px 8px;
}

.history-list::-webkit-scrollbar { width: 3px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list::-webkit-scrollbar-thumb { background: rgba(196, 26, 26, 0.2); border-radius: 3px; }
.history-list::-webkit-scrollbar-thumb:hover { background: rgba(196, 26, 26, 0.38); }

.history-empty {
    text-align: center;
    color: #bc8a5f;
    font-size: 12px;
    padding: 20px 10px;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #ead5c0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    gap: 8px;
}

.history-item:hover {
    background: #fff8f0;
    border-color: #c41a1a;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(139, 0, 0, 0.08);
}

.history-item.active {
    background: #fff0e8;
    border-color: #c41a1a;
    border-left: 3px solid #c41a1a;
}

.history-item-icon {
    font-size: 15px;
    flex-shrink: 0;
}

.history-item-body {
    flex: 1;
    min-width: 0;
}

.history-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #8b0000;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-meta {
    font-size: 11px;
    color: #bc8a5f;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-del {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #bc8a5f;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    opacity: 0;
    transition: all 0.2s;
}

.history-item:hover .history-item-del { opacity: 1; }

.history-item-del:hover {
    background: #fde8e8;
    color: #ef4444;
}

/* ========== 输入面板栏 ========== */
.ci-left {
    display: flex;
    flex-direction: column;
    width: 270px;
    min-width: 240px;
    flex-shrink: 0;
    overflow: hidden;
    border-right: 1px solid rgba(139, 0, 0, 0.08);
    background: rgba(255, 252, 245, 0.78);
    backdrop-filter: blur(8px);
}

.ci-input-panel {
    flex: 1;
    overflow-y: auto;
}

.ci-input-panel::-webkit-scrollbar { width: 3px; }
.ci-input-panel::-webkit-scrollbar-track { background: transparent; }
.ci-input-panel::-webkit-scrollbar-thumb { background: rgba(196, 26, 26, 0.2); border-radius: 3px; }
.ci-input-panel::-webkit-scrollbar-thumb:hover { background: rgba(196, 26, 26, 0.38); }

.input-section {
    padding: 14px 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group.half {
    flex: 1;
    min-width: 0;
}

.input-row {
    display: flex;
    gap: 10px;
}

.input-label {
    font-size: 12px;
    font-weight: 600;
    color: #5d3a1a;
    display: flex;
    align-items: center;
    gap: 4px;
}

.label-icon { font-size: 14px; }

.required {
    color: #c41a1a;
    font-size: 13px;
}

.ci-input,
.ci-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e2cfc0;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    background: rgba(255, 255, 255, 0.92);
    transition: all 0.2s;
    box-sizing: border-box;
    color: #5d3a1a;
    font-family: inherit;
}

.ci-input:focus,
.ci-select:focus {
    border-color: #c41a1a;
    box-shadow: 0 0 0 2px rgba(196, 26, 26, 0.12);
    background-color: #fff;  /* 用 background-color 不用简写，避免重置 select 的 background-image 箭头 */
}

.ci-input::placeholder { color: #c4a882; }

.ci-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23bc8a5f' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

/* 热门主题标签 */
.quick-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.quick-tag {
    padding: 4px 10px;
    background: rgba(196, 26, 26, 0.07);
    border: 1px solid rgba(196, 26, 26, 0.22);
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    color: #8b0000;
    transition: all 0.2s;
}

.quick-tag:hover {
    background: rgba(196, 26, 26, 0.16);
    border-color: #c41a1a;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(139, 0, 0, 0.12);
}

/* 释义 Toggle 开关 */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ci-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 23px;
    cursor: pointer;
    flex-shrink: 0;
}

.ci-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #e8d5c4;
    border-radius: 23px;
    transition: all 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 17px;
    height: 17px;
    background: white;
    border-radius: 50%;
    left: 3px;
    top: 3px;
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.ci-toggle input:checked + .toggle-slider { background: #c41a1a; }

.ci-toggle input:checked + .toggle-slider::before { transform: translateX(21px); }

.toggle-label {
    font-size: 12px;
    color: #7b4f3a;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

/* 使用说明框 */
.input-tips {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 240, 180, 0.12));
    border: 1px solid rgba(255, 200, 0, 0.35);
    border-left: 3px solid #e8b800;
    border-radius: 8px;
    padding: 10px 12px;
}

.tips-title {
    font-size: 12px;
    font-weight: 600;
    color: #7b5c14;
    margin-bottom: 6px;
}

.tips-list {
    margin: 0;
    padding-left: 14px;
    list-style: disc;
}

.tips-list li {
    font-size: 11px;
    color: #7b5c2a;
    line-height: 1.8;
}

kbd {
    display: inline-block;
    padding: 1px 5px;
    font-size: 10px;
    background: rgba(139, 0, 0, 0.08);
    border: 1px solid rgba(139, 0, 0, 0.2);
    border-radius: 3px;
    color: #8b0000;
    font-family: inherit;
}

/* ========== 右侧结果面板 ========== */
.ci-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(255, 252, 245, 0.82);
    backdrop-filter: blur(8px);
    position: relative;
}

/* 结果头部 */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    border-bottom: 1px solid rgba(139, 0, 0, 0.1);
    background: linear-gradient(to right, rgba(255, 215, 0, 0.1), rgba(196, 26, 26, 0.06), transparent);
    flex-shrink: 0;
    gap: 10px;
    flex-wrap: wrap;
}

.result-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}

.result-topic {
    font-size: 15px;
    font-weight: 700;
    color: #8b0000;
}

.result-info {
    font-size: 12px;
    color: #7b5c2a;
    background: rgba(255, 255, 255, 0.75);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 200, 0, 0.35);
}

.result-regen-btn {
    padding: 6px 12px;
    background: rgba(255, 215, 0, 0.12);
    color: #7a5c00;
    border: 1px solid rgba(255, 200, 0, 0.4);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.result-regen-btn:hover {
    background: rgba(255, 215, 0, 0.25);
    transform: translateY(-1px);
}

.result-copy-btn {
    padding: 6px 14px;
    background: linear-gradient(135deg, #c41a1a, #a80000);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.result-copy-btn:hover {
    background: linear-gradient(135deg, #a80000, #8b0000);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(139, 0, 0, 0.25);
}

/* ========== 占位提示 ========== */
.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 300px;
    padding: 40px 30px;
    text-align: center;
}

.placeholder-decor {
    position: relative;
    margin-bottom: 16px;
}

.placeholder-icon {
    font-size: 72px;
    animation: floatMask 3.5s ease-in-out infinite;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(139, 0, 0, 0.2));
}

@keyframes floatMask {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-14px) rotate(3deg); }
}

.placeholder-title {
    font-size: 21px;
    font-weight: 700;
    color: #8b0000;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.placeholder-desc {
    font-size: 14px;
    color: #8a6742;
    max-width: 340px;
    line-height: 1.75;
    margin-bottom: 28px;
}

.placeholder-features {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 24px;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(196, 26, 26, 0.14);
    border-radius: 12px;
    font-size: 13px;
    color: #7b4f3a;
    min-width: 88px;
    transition: all 0.2s;
}

.feature-item:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 200, 0, 0.5);
    transform: translateY(-2px);
}

.feature-icon { font-size: 24px; }

.placeholder-example {
    font-size: 13px;
    color: #7b4f3a;
    background: rgba(255, 255, 255, 0.7);
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px dashed rgba(196, 26, 26, 0.25);
}

.example-label {
    color: #bc8a5f;
    margin-right: 4px;
}

.example-text {
    color: #8b0000;
    font-weight: 600;
}

/* ========== 加载状态 ========== */
.result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 300px;
    padding: 40px;
    text-align: center;
}

.loading-animation {
    margin-bottom: 20px;
}

.loading-icon {
    font-size: 52px;
    animation: scrollBounce 1.8s ease-in-out infinite;
    display: block;
    margin-bottom: 14px;
}

@keyframes scrollBounce {
    0%, 100% { transform: rotate(-8deg) scale(1); }
    50% { transform: rotate(8deg) scale(1.12); }
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
}

.loading-dots span {
    width: 9px;
    height: 9px;
    background: #c41a1a;
    border-radius: 50%;
    display: inline-block;
    animation: dotBounce 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.loading-text {
    font-size: 15px;
    color: #8b0000;
    font-weight: 600;
    margin-bottom: 8px;
}

.loading-tips {
    font-size: 13px;
    color: #8a6742;
    max-width: 300px;
    line-height: 1.6;
}

/* ========== 结果内容 ========== */
.result-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 26px;
}

.result-content::-webkit-scrollbar { width: 4px; }
.result-content::-webkit-scrollbar-track { background: rgba(139, 0, 0, 0.04); border-radius: 4px; }
.result-content::-webkit-scrollbar-thumb { background: rgba(196, 26, 26, 0.2); border-radius: 4px; }
.result-content::-webkit-scrollbar-thumb:hover { background: rgba(196, 26, 26, 0.42); }

/* Markdown 渲染样式 */
.result-markdown {
    line-height: 1.85;
    color: #3d2b1f;
    font-size: 14px;
    word-break: break-word;
}

.result-markdown h1 {
    font-size: 20px;
    color: #8b0000;
    border-bottom: 2px solid rgba(255, 200, 0, 0.6);
    padding-bottom: 8px;
    margin: 0 0 18px;
}

.result-markdown h2 {
    font-size: 17px;
    color: #8b0000;
    margin: 22px 0 12px;
    padding: 8px 14px;
    background: linear-gradient(to right, rgba(196, 26, 26, 0.08), transparent);
    border-left: 4px solid #c41a1a;
    border-radius: 0 6px 6px 0;
}

.result-markdown h3 {
    font-size: 15px;
    color: #8b4513;
    margin: 16px 0 8px;
}

.result-markdown p {
    margin: 10px 0;
    color: #4a3728;
    line-height: 1.9;
}

.result-markdown ul,
.result-markdown ol {
    margin: 8px 0;
    padding-left: 22px;
}

.result-markdown li {
    margin: 6px 0;
    color: #4a3728;
}

.result-markdown strong {
    color: #8b0000;
    font-weight: 700;
    font-size: 15px;
}

.result-markdown em {
    color: #8b4513;
    font-style: italic;
}

.result-markdown blockquote {
    border-left: 4px solid #ffd700;
    padding: 10px 16px;
    margin: 14px 0;
    background: rgba(255, 215, 0, 0.08);
    border-radius: 0 8px 8px 0;
    color: #6d4c41;
    font-size: 14px;
    line-height: 1.8;
}

.result-markdown hr {
    border: none;
    border-top: 1px dashed rgba(196, 26, 26, 0.22);
    margin: 18px 0;
}

.result-markdown code {
    background: rgba(196, 26, 26, 0.08);
    color: #8b0000;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}

/* 结果区域 a 标签（规范：必须显式定义，不依赖全局样式）*/
.result-markdown a {
    color: #c41a1a;
    text-decoration: none;
    border-bottom: 1px solid rgba(196, 26, 26, 0.4);
    transition: color 0.2s, border-bottom-color 0.2s;
}

.result-markdown a:hover {
    color: #8b0000;
    border-bottom-color: #8b0000;
    text-decoration: underline;
}

/* ul/ol 列表标记颜色（规范：font-weight 600 + 主题色）*/
.result-markdown ul li::marker,
.result-markdown ol li::marker {
    color: #c41a1a;
    font-weight: 600;
}

/* ========== 结果内容淡入动画 ========== */
@keyframes resultFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ci-result-enter {
    animation: resultFadeIn 0.38s ease;
}

/* ========== 错误状态 ========== */
.result-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 300px;
    padding: 40px;
    text-align: center;
    gap: 14px;
}

.error-icon { font-size: 52px; }

.error-text {
    font-size: 14px;
    color: #ef5350;
    max-width: 320px;
    line-height: 1.6;
}

body.dark .error-text { color: #ff7070; }

/* ========== 示例模态框 ========== */
.ci-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px);
}

.ci-modal.show { display: flex; }

.ci-modal-content {
    background: #fffef8;
    border-radius: 14px;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(100, 0, 0, 0.18);
    animation: ciModalIn 0.25s ease;
    border: 1px solid rgba(255, 200, 0, 0.25);
}

@keyframes ciModalIn {
    from { opacity: 0; transform: scale(0.94) translateY(-12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.ci-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #7a0000, #c41a1a);
    color: white;
    flex-shrink: 0;
}

.ci-modal-header h3 {
    margin: 0;
    font-size: 15px;
    letter-spacing: 1px;
}

.ci-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ci-modal-close:hover { background: rgba(255, 255, 255, 0.35); }

.ci-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ci-modal-body::-webkit-scrollbar { width: 4px; }
.ci-modal-body::-webkit-scrollbar-track { background: transparent; }
.ci-modal-body::-webkit-scrollbar-thumb { background: rgba(196, 26, 26, 0.2); border-radius: 4px; }
.ci-modal-body::-webkit-scrollbar-thumb:hover { background: rgba(196, 26, 26, 0.38); }

/* 示例卡片 */
.example-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: #fffef4;
    border: 1px solid #ead5c0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-card:hover {
    background: #fff8f0;
    border-color: #c41a1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(139, 0, 0, 0.1);
}

.example-card-icon {
    font-size: 30px;
    flex-shrink: 0;
    margin-top: 2px;
}

.example-card-body { flex: 1; min-width: 0; }

.example-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #8b0000;
    margin-bottom: 4px;
}

.example-card-desc {
    font-size: 12px;
    color: #8a6742;
    line-height: 1.5;
    margin-bottom: 4px;
}

.example-card-preview {
    font-size: 12px;
    color: #c41a1a;
    font-style: italic;
    margin-bottom: 6px;
}

.example-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.example-tag {
    padding: 2px 8px;
    background: rgba(196, 26, 26, 0.08);
    border-radius: 10px;
    font-size: 11px;
    color: #8b0000;
}

/* ========== Toast 通知 ========== */
.ci-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: white;
    z-index: 999999;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
}

.ci-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ci-toast.success { background: #43a047; }
.ci-toast.error   { background: #e53935; }
.ci-toast.info    { background: #8b4513; }

/* ========== 暗黑模式（body.dark 前缀） ========== */
body.dark .ci-container {
    background: linear-gradient(135deg, #170a0a 0%, #1e1010 50%, #1a1208 100%);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 215, 0, 0.1);
}

body.dark .ci-container::before {
    opacity: 0.6;
}

body.dark .ci-history-col {
    background: rgba(28, 12, 12, 0.82);
    border-right-color: rgba(196, 26, 26, 0.18);
}

body.dark .history-header {
    background: rgba(28, 10, 10, 0.7);
    border-bottom-color: rgba(196, 26, 26, 0.15);
}

body.dark .history-title { color: #e8b4b8; }

body.dark .history-search-input {
    background: rgba(40, 18, 18, 0.9);
    border-color: #5a2a2a;
    color: #e8ccc0;
}

body.dark .history-search-input::placeholder { color: #7a4a4a; }

body.dark .history-search-input:focus {
    border-color: #c41a1a;
    box-shadow: 0 0 0 2px rgba(196, 26, 26, 0.15);
}

body.dark .history-item {
    background: rgba(42, 18, 18, 0.75);
    border-color: #5a2a2a;
}

body.dark .history-item:hover {
    background: rgba(90, 20, 20, 0.45);
    border-color: #c41a1a;
}

body.dark .history-item.active {
    background: rgba(100, 20, 20, 0.5);
    border-color: #c41a1a;
}

body.dark .history-item-title { color: #ff9090; }
body.dark .history-item-meta  { color: #a07060; }
body.dark .history-item-del   { color: #7a4a4a; }
body.dark .history-item-del:hover { background: rgba(196, 26, 26, 0.22); color: #ff8080; }

body.dark .history-clear-btn {
    color: #a07060;
}

body.dark .history-clear-btn:hover {
    background: rgba(196, 26, 26, 0.2);
    color: #ff8080;
}

body.dark .ci-left {
    background: rgba(28, 12, 12, 0.8);
    border-right-color: rgba(196, 26, 26, 0.14);
}

body.dark .input-label { color: #e8ccc0; }

body.dark .ci-input,
body.dark .ci-select {
    background-color: rgba(42, 18, 18, 0.9);  /* 用 background-color 不用简写，避免重置 background-image */
    border-color: #5a2a2a;
    color: #e8ccc0;
}

/* 暗黑模式下 select 下拉箭头改为浅色 */
body.dark .ci-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23e8ccc0' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
}

body.dark .ci-input:focus,
body.dark .ci-select:focus {
    border-color: #c41a1a;
    background-color: rgba(54, 22, 22, 0.95);  /* 用 background-color 不用简写 */
    box-shadow: 0 0 0 2px rgba(196, 26, 26, 0.15);
}

body.dark .ci-input::placeholder { color: #7a4a4a; }

body.dark .quick-tag {
    background: rgba(196, 26, 26, 0.13);
    border-color: rgba(196, 26, 26, 0.28);
    color: #ff9090;
}

body.dark .quick-tag:hover {
    background: rgba(196, 26, 26, 0.28);
}

body.dark .toggle-slider { background: #5a2a2a; }
body.dark .toggle-label { color: #c4a882; }

body.dark .input-tips {
    background: rgba(255, 215, 0, 0.04);
    border-color: rgba(255, 200, 0, 0.18);
    border-left-color: rgba(200, 160, 0, 0.5);
}

body.dark .tips-title { color: #e8c460; }
body.dark .tips-list li { color: #c4a882; }

body.dark kbd {
    background: rgba(139, 0, 0, 0.2);
    border-color: rgba(196, 26, 26, 0.3);
    color: #ff9090;
}

body.dark .result-panel {
    background: rgba(22, 10, 10, 0.88);
}

body.dark .result-header {
    background: linear-gradient(to right, rgba(100, 18, 18, 0.3), rgba(50, 10, 10, 0.2), transparent);
    border-bottom-color: rgba(196, 26, 26, 0.18);
}

body.dark .result-topic { color: #ff9090; }

body.dark .result-info {
    color: #c4a882;
    background: rgba(50, 22, 22, 0.7);
    border-color: rgba(200, 160, 0, 0.2);
}

body.dark .result-regen-btn {
    background: rgba(255, 215, 0, 0.07);
    color: #e8c460;
    border-color: rgba(200, 160, 0, 0.25);
}

body.dark .result-regen-btn:hover { background: rgba(255, 215, 0, 0.14); }

body.dark .placeholder-title { color: #ff9090; }
body.dark .placeholder-desc  { color: #c4a882; }

body.dark .feature-item {
    background: rgba(50, 22, 22, 0.6);
    border-color: rgba(196, 26, 26, 0.2);
    color: #c4a882;
}

body.dark .feature-item:hover {
    background: rgba(255, 215, 0, 0.05);
    border-color: rgba(200, 160, 0, 0.3);
}

body.dark .placeholder-example {
    background: rgba(50, 22, 22, 0.6);
    border-color: rgba(196, 26, 26, 0.2);
}

body.dark .example-label { color: #a07060; }
body.dark .example-text  { color: #ff9090; }

body.dark .loading-text  { color: #ff9090; }
body.dark .loading-tips  { color: #c4a882; }

body.dark .loading-dots span { background: #c41a1a; }

/* 暗黑模式下满轮条轨道背景显式覆盖 */
body.dark .result-content::-webkit-scrollbar-track    { background: rgba(40, 10, 10, 0.6); }
body.dark .history-list::-webkit-scrollbar-track       { background: rgba(28, 8, 8, 0.5); }
body.dark .ci-input-panel::-webkit-scrollbar-track     { background: rgba(28, 8, 8, 0.5); }
body.dark .ci-modal-body::-webkit-scrollbar-track      { background: rgba(28, 8, 8, 0.5); }

body.dark .result-markdown       { color: #e8ccc0; }
body.dark .result-markdown h1    { color: #ff9090; border-bottom-color: rgba(200, 160, 0, 0.3); }
body.dark .result-markdown h2    { color: #ff9090; background: linear-gradient(to right, rgba(196, 26, 26, 0.15), transparent); border-left-color: #c41a1a; }
body.dark .result-markdown h3    { color: #e8b4b8; }
body.dark .result-markdown p     { color: #d4b8b0; }
body.dark .result-markdown li    { color: #d4b8b0; }
body.dark .result-markdown strong { color: #ff9090; }
body.dark .result-markdown em    { color: #e8c460; }
body.dark .result-markdown hr    { border-top-color: rgba(196, 26, 26, 0.18); }

body.dark .result-markdown code {
    background: rgba(196, 26, 26, 0.2);
    color: #ff9090;
}

body.dark .result-markdown a {
    color: #ff8080;
    border-bottom-color: rgba(255, 128, 128, 0.4);
}

body.dark .result-markdown a:hover {
    color: #ffaaaa;
    border-bottom-color: #ffaaaa;
}

body.dark .result-markdown ul li::marker,
body.dark .result-markdown ol li::marker {
    color: #ff9090;
    font-weight: 600;
}

body.dark .result-markdown blockquote {
    background: rgba(255, 215, 0, 0.04);
    border-left-color: rgba(200, 160, 0, 0.5);
    color: #c4a882;
}

body.dark .ci-modal-content {
    background: #1e0e0e;
    border-color: rgba(196, 26, 26, 0.2);
}

body.dark .history-empty { color: #7a4a4a; }

body.dark .result-copy-btn {
    background: linear-gradient(135deg, #9a1515, #7a0000);
    color: #ffe8e8;
}

body.dark .ci-modal-body { background: #1e0e0e; }

body.dark .example-card {
    background: #2a1212;
    border-color: #5a2a2a;
}

body.dark .example-card:hover {
    background: #361818;
    border-color: #c41a1a;
}

body.dark .example-card-title   { color: #ff9090; }
body.dark .example-card-desc    { color: #c4a882; }
body.dark .example-card-preview { color: #ff9090; }
body.dark .example-tag { background: rgba(196, 26, 26, 0.15); color: #ff9090; }

/* ========== 响应式 ========== */
@media (max-width: 820px) {
    .ci-history-col { display: none; }
    .ci-left { width: 230px; min-width: 200px; }
}

@media (max-width: 580px) {
    .ci-left { display: none; }
    .toolbar-subtitle { display: none; }
}
