/* =============================================
   夸夸助手 - compliment_assistant.css
   三栏布局，玫瑰粉主题，充满活力与温暖
   主色调：玫瑰红 #be185d + 粉红 #ec4899
   ============================================= */

/* ========== 主容器 ========== */
.ca-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #fff0f6;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(190, 24, 93, 0.08);
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

.ca-container.fullscreen {
    position: fixed;
    top: 0; left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    min-height: unset;
}

/* ========== 顶部工具栏 ========== */
.ca-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #9d174d 0%, #be185d 40%, #ec4899 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(190, 24, 93, 0.45);
    flex-shrink: 0;
}

.ca-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.5px;
    margin-right: 8px;
}

.ca-toolbar .toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.ca-toolbar .toolbar-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #be185d;
    transition: all 0.2s;
    white-space: nowrap;
}

.ca-toolbar .toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.ca-toolbar .toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.ca-toolbar .toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ca-toolbar .toolbar-btn-primary {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.4);
}

.ca-toolbar .toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.5);
    color: #fff;
}

/* Shake 抖动校验动画 */
@keyframes caShake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-5px); }
    30%, 70% { transform: translateX(5px); }
}

.ca-input.shake,
.ca-select.shake,
.ca-textarea.shake {
    animation: caShake 0.5s ease-in-out;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

/* ========== 主内容区：三栏布局 ========== */
.ca-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #fff0f6;
}

/* ========== 左栏：历史记录 ========== */
.ca-history-panel {
    width: 200px;
    flex-shrink: 0;
    background: #fdf2f8;
    border-right: 1px solid #fce7f3;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ca-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fdf4ff 0%, #fce7f3 100%);
    border-bottom: 1px solid #fce7f3;
    flex-shrink: 0;
}

.ca-history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #831843;
}

.ca-history-count {
    font-size: 11px;
    color: #be185d;
    font-weight: 400;
}

.ca-history-clear {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.ca-history-clear:hover { background: #fde8e8; }

.ca-history-search {
    padding: 8px;
    border-bottom: 1px solid #fce7f3;
    flex-shrink: 0;
    position: relative;
}

.ca-history-search input {
    width: 100%;
    padding: 6px 26px 6px 10px;
    border: 1px solid #fce7f3;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
    background: #fff0f6;
}

.ca-history-search input:focus {
    border-color: #ec4899;
    box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.12);
    background: #fff;
}

.ca-history-search-clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
}

.ca-history-search-clear:hover { color: #be185d; }

.ca-history-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 6px 0;
}

.ca-history-list::-webkit-scrollbar { width: 4px; }
.ca-history-list::-webkit-scrollbar-thumb { background: #fce7f3; border-radius: 2px; }
.ca-history-list::-webkit-scrollbar-thumb:hover { background: #ec4899; }

.ca-history-empty {
    text-align: center;
    color: #d1bfcc;
    font-size: 12px;
    padding: 30px 12px;
    line-height: 1.6;
}

.ca-history-item {
    padding: 10px 12px;
    border-bottom: 1px solid #fdf4ff;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.ca-history-item:hover {
    background: #fce7f3;
}

.ca-history-item-name {
    font-size: 12px;
    font-weight: 600;
    color: #831843;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.ca-history-item-scene {
    font-size: 11px;
    color: #be185d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.ca-history-item-time {
    font-size: 10px;
    color: #c084a0;
}

.ca-history-item-del {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #f9a8d4;
    cursor: pointer;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    padding: 2px;
}

.ca-history-item:hover .ca-history-item-del {
    opacity: 1;
}

.ca-history-item-del:hover { color: #ef4444; }

.ca-history-item-preview {
    font-size: 10px;
    color: #c084a0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
    font-style: italic;
    opacity: 0.85;
}

.ca-history-char-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    background: linear-gradient(135deg, #be185d, #ec4899);
    color: #fff;
    padding: 1px 5px;
    border-radius: 8px;
    margin-left: 5px;
    vertical-align: middle;
    line-height: 1.4;
}

/* ========== 中栏：输入面板 ========== */
.ca-input-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid #fce7f3;
    background: #fff;
}

.ca-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 44px;
    padding: 8px 16px;
    border-bottom: 1px solid #fce7f3;
    background: linear-gradient(to bottom, #fff 0%, #fdf9fb 100%);
    flex-shrink: 0;
}

.ca-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #831843;
}

.ca-panel-tip {
    font-size: 11px;
    color: #c084a0;
    text-align: right;
}

.ca-input-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 16px;
}

.ca-input-body::-webkit-scrollbar { width: 4px; }
.ca-input-body::-webkit-scrollbar-thumb { background: #fce7f3; border-radius: 2px; }
.ca-input-body::-webkit-scrollbar-thumb:hover { background: #ec4899; }

.ca-section-label {
    font-size: 11px;
    font-weight: 700;
    color: #be185d;
    letter-spacing: 0.3px;
    padding: 5px 10px;
    border-left: 3px solid #ec4899;
    border-bottom: 1px solid #fce7f3;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(to right, rgba(236, 72, 153, 0.06), transparent);
    border-radius: 0 4px 4px 0;
}

.ca-form-group {
    margin-bottom: 12px;
}

.ca-form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.ca-form-half {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.ca-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 5px;
}

.ca-required-mark {
    color: #ec4899;
    margin-left: 2px;
}

.ca-label-tip {
    color: #9ca3af;
    font-weight: 400;
    font-size: 11px;
}

.ca-input,
.ca-select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #fce7f3;
    border-radius: 5px;
    font-size: 13px;
    color: #1f2937;
    background: #fff;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.ca-input:focus,
.ca-select:focus {
    border-color: #ec4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
    background: #fffafc;
}

.ca-input::placeholder { color: #d1bfcc; }

.ca-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #fce7f3;
    border-radius: 5px;
    font-size: 13px;
    color: #1f2937;
    background: #fff;
    outline: none;
    resize: vertical;
    transition: all 0.2s;
    box-sizing: border-box;
    line-height: 1.6;
    font-family: inherit;
    min-height: 90px;
}

.ca-textarea:focus {
    border-color: #ec4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
    background: #fffafc;
}

.ca-textarea::placeholder { color: #d1bfcc; }

.ca-textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.ca-textarea-hint {
    font-size: 11px;
    color: #c084a0;
}

.ca-char-count {
    font-size: 11px;
    color: #c084a0;
}

.ca-char-count.warning { color: #f59e0b; }
.ca-char-count.danger  { color: #ef4444; }

/* ========== 右栏：结果面板 ========== */
.ca-result-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

.ca-result-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.ca-result-time {
    font-size: 11px;
    color: #c084a0;
}

.ca-result-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.ca-result-body::-webkit-scrollbar { width: 4px; }
.ca-result-body::-webkit-scrollbar-thumb { background: #fce7f3; border-radius: 2px; }
.ca-result-body::-webkit-scrollbar-thumb:hover { background: #ec4899; }

/* 初始占位 */
.ca-result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 40px 20px;
    color: #c084a0;
}

.ca-placeholder-emoji {
    font-size: 52px;
    margin-bottom: 16px;
    animation: caFloat 3s ease-in-out infinite;
}

@keyframes caFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.ca-placeholder-title {
    font-size: 15px;
    font-weight: 600;
    color: #be185d;
    margin: 0 0 8px;
}

.ca-placeholder-desc {
    font-size: 13px;
    color: #c084a0;
    margin: 3px 0;
    line-height: 1.6;
}

.ca-placeholder-tip {
    font-size: 12px;
    color: #f9a8d4;
    margin-top: 12px;
    padding: 6px 14px;
    background: #fdf2f8;
    border-radius: 20px;
}

/* 加载中 */
.ca-result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 40px 20px;
}

.ca-loading-star {
    font-size: 44px;
    animation: caSpin 1.5s ease-in-out infinite;
    margin-bottom: 16px;
}

@keyframes caSpin {
    0%   { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(180deg) scale(1.15); }
    100% { transform: rotate(360deg) scale(1); }
}

.ca-loading-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.ca-loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ec4899;
    animation: caBounce 1.2s ease-in-out infinite;
}

.ca-loading-dots span:nth-child(2) { animation-delay: 0.2s; background: #f472b6; }
.ca-loading-dots span:nth-child(3) { animation-delay: 0.4s; background: #f9a8d4; }

@keyframes caBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.6; }
    40% { transform: translateY(-10px); opacity: 1; }
}

.ca-loading-text {
    font-size: 13px;
    color: #be185d;
    margin: 0;
    transition: opacity 0.25s ease;
}

/* 夸夸结果卡片 */
.ca-result-card-wrap {
    width: 100%;
    animation: caCardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes caCardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ca-result-card {
    background: linear-gradient(135deg, #fff0f6 0%, #fdf2f8 50%, #fff 100%);
    border: 2px solid #fce7f3;
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 4px 20px rgba(190, 24, 93, 0.1), 0 1px 4px rgba(190, 24, 93, 0.06);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.25s ease;
}

.ca-result-card:hover {
    box-shadow: 0 10px 36px rgba(190, 24, 93, 0.18), 0 3px 12px rgba(190, 24, 93, 0.1);
    transform: translateY(-2px);
}

.ca-result-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #be185d, #ec4899, #f472b6, #ec4899, #be185d);
    background-size: 200% 100%;
    animation: caShine 3s linear infinite;
}

@keyframes caShine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.ca-card-deco-top {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.ca-deco-star {
    color: #f9a8d4;
    font-size: 14px;
    animation: caStarPulse 2s ease-in-out infinite;
}

.ca-deco-star:nth-child(2) {
    color: #ec4899;
    font-size: 18px;
    animation-delay: 0.3s;
}

.ca-deco-star:nth-child(3) { animation-delay: 0.6s; }

@keyframes caStarPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
}

.ca-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #fce7f3;
}

.ca-card-target {
    font-size: 15px;
    font-weight: 700;
    color: #9d174d;
}

.ca-card-badge {
    background: linear-gradient(135deg, #be185d, #ec4899);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.ca-card-body {
    font-size: 14px;
    line-height: 1.9;
    color: #1f2937;
    white-space: pre-wrap;
    word-break: break-word;
}

.ca-card-footer {
    display: flex;
    justify-content: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed #fce7f3;
}

.ca-card-emojis {
    font-size: 16px;
    letter-spacing: 4px;
    animation: caEmojiBounce 2s ease-in-out infinite;
}

@keyframes caEmojiBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* 错误状态 */
.ca-error-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 40px 20px;
}

.ca-error-block {
    text-align: center;
    padding: 24px;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 10px;
    max-width: 300px;
}

.ca-error-icon { font-size: 36px; margin-bottom: 12px; }

.ca-error-title {
    font-size: 15px;
    font-weight: 600;
    color: #dc2626;
    margin: 0 0 6px;
}

.ca-error-hint {
    font-size: 13px;
    color: #9ca3af;
    margin: 0 0 14px;
}

.ca-error-retry {
    padding: 8px 18px;
    background: linear-gradient(135deg, #be185d, #ec4899);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.ca-error-retry:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(190, 24, 93, 0.3);
}

/* ========== 示例导入模态框 ========== */
.ca-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
    animation: caFadeIn 0.2s ease;
}

.ca-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    width: min(640px, 92vw);
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: caModalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes caModalIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.ca-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #fce7f3;
    flex-shrink: 0;
}

.ca-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #831843;
}

.ca-modal-close {
    background: none;
    border: none;
    font-size: 16px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.ca-modal-close:hover {
    background: #fce7f3;
    color: #be185d;
}

.ca-modal-body {
    overflow-y: auto;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.ca-modal-body::-webkit-scrollbar { width: 4px; }
.ca-modal-body::-webkit-scrollbar-thumb { background: #fce7f3; border-radius: 2px; }
.ca-modal-body::-webkit-scrollbar-thumb:hover { background: #ec4899; }

/* 示例卡片 */
.ca-example-card {
    border: 1px solid #fce7f3;
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.ca-example-card:hover {
    border-color: #ec4899;
    background: #fff0f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(190, 24, 93, 0.12);
}

.ca-example-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.ca-example-icon {
    font-size: 20px;
}

.ca-example-title {
    font-size: 13px;
    font-weight: 600;
    color: #831843;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ca-example-badge {
    font-size: 10px;
    color: #be185d;
    background: #fdf2f8;
    border: 1px solid #fce7f3;
    padding: 1px 6px;
    border-radius: 10px;
    white-space: nowrap;
}

.ca-example-desc {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== Toast 提示 ========== */
.ca-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-80px);
    background: #1f2937;
    color: #fff;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    z-index: 99999;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
    opacity: 0;
    pointer-events: none;
    max-width: min(320px, 85vw);
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.ca-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.ca-toast.success { background: #059669; }
.ca-toast.error   { background: #dc2626; }
.ca-toast.info    { background: #be185d; }
.ca-toast.warn    { background: #d97706; }

/* ========== 动画工具 ========== */
@keyframes caFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ========== 暗黑模式 ========== */
body.dark .ca-container {
    background: #1e0a14;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark .ca-toolbar {
    background: linear-gradient(135deg, #500724 0%, #831843 40%, #9d174d 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark .ca-toolbar .toolbar-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #f9a8d4;
}

body.dark .ca-toolbar .toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.22);
}

body.dark .ca-toolbar .toolbar-btn-primary {
    background: linear-gradient(135deg, #047857, #059669);
    color: #fff;
}

body.dark .ca-main-content { background: #1e0a14; }

body.dark .ca-history-panel {
    background: #280d1c;
    border-right-color: #4a1030;
}

body.dark .ca-history-header {
    background: linear-gradient(to bottom, #300f22 0%, #280d1c 100%);
    border-bottom-color: #4a1030;
}

body.dark .ca-history-header h3 { color: #f9a8d4; }
body.dark .ca-history-count { color: #f472b6; }
body.dark .ca-history-clear { background: rgba(239, 68, 68, 0.15); color: #f87171; }
body.dark .ca-history-clear:hover { background: rgba(239, 68, 68, 0.25); }

body.dark .ca-history-search { border-bottom-color: #4a1030; }
body.dark .ca-history-search input {
    border-color: #4a1030;
    background: #1e0a14;
    color: #f3e8ef;
}
body.dark .ca-history-search input::placeholder { color: #64748b; }
body.dark .ca-history-search input:focus {
    border-color: #ec4899;
    background: #280d1c;
}
body.dark .ca-history-search-clear { color: #7c4163; }
body.dark .ca-history-search-clear:hover { color: #f9a8d4; }

body.dark .ca-history-item:hover { background: #3b1228; }
body.dark .ca-history-item { border-bottom-color: #2d0f1e; }
body.dark .ca-history-item-name { color: #f9a8d4; }
body.dark .ca-history-item-scene { color: #f472b6; }
body.dark .ca-history-item-time { color: #7c4163; }
body.dark .ca-history-item-del { color: #4a1030; }
body.dark .ca-history-item:hover .ca-history-item-del { opacity: 1; }
body.dark .ca-history-item-del:hover { color: #f87171; }

body.dark .ca-history-item-preview { color: #7c4163; opacity: 0.9; }
body.dark .ca-history-char-badge { background: linear-gradient(135deg, #831843, #be185d); }

body.dark .ca-history-empty { color: #4a1030; }

body.dark .ca-history-list::-webkit-scrollbar-thumb { background: #4a1030; }
body.dark .ca-history-list::-webkit-scrollbar-thumb:hover { background: #ec4899; }

body.dark .ca-input-panel {
    background: #1a0811;
    border-right-color: #4a1030;
}

body.dark .ca-panel-header {
    background: linear-gradient(to bottom, #1a0811 0%, #220b17 100%);
    border-bottom-color: #4a1030;
}

body.dark .ca-panel-header h3 { color: #f9a8d4; }
body.dark .ca-panel-tip { color: #7c4163; }

body.dark .ca-input-body::-webkit-scrollbar-thumb { background: #4a1030; }
body.dark .ca-input-body::-webkit-scrollbar-thumb:hover { background: #ec4899; }

body.dark .ca-section-label {
    color: #f472b6;
    border-bottom-color: #4a1030;
    border-left-color: #ec4899;
    background: linear-gradient(to right, rgba(236, 72, 153, 0.1), transparent);
}

body.dark .ca-form-group label { color: #e5d3dc; }

body.dark .ca-input,
body.dark .ca-select,
body.dark .ca-textarea {
    border-color: #4a1030;
    background: #1e0a14;
    color: #f3e8ef;
}

body.dark .ca-input:focus,
body.dark .ca-select:focus,
body.dark .ca-textarea:focus {
    border-color: #ec4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.15);
    background: #280d1c;
}

body.dark .ca-input::placeholder,
body.dark .ca-textarea::placeholder { color: #64748b; }

body.dark .ca-textarea-hint { color: #7c4163; }
body.dark .ca-char-count { color: #7c4163; }

body.dark .ca-result-panel {
    background: #1a0811;
}

body.dark .ca-result-panel .ca-panel-header {
    background: linear-gradient(to bottom, #1a0811 0%, #220b17 100%);
    border-bottom-color: #4a1030;
}

body.dark .ca-result-panel .ca-panel-header h3 { color: #f9a8d4; }
body.dark .ca-result-time { color: #9d8090; }

body.dark .ca-result-body::-webkit-scrollbar-thumb { background: #4a1030; }
body.dark .ca-result-body::-webkit-scrollbar-thumb:hover { background: #ec4899; }

body.dark .ca-placeholder-title { color: #f472b6; }
body.dark .ca-placeholder-desc { color: #7c4163; }
body.dark .ca-placeholder-tip { color: #7c4163; background: #280d1c; }

body.dark .ca-loading-text { color: #f472b6; }

body.dark .ca-result-card {
    background: linear-gradient(135deg, #280d1c 0%, #300f22 50%, #1e0a14 100%);
    border-color: #4a1030;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.dark .ca-result-card:hover {
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.55);
}

body.dark .ca-card-header { border-bottom-color: #4a1030; }
body.dark .ca-card-target { color: #f9a8d4; }
body.dark .ca-card-body { color: #f3e8ef; }
body.dark .ca-card-footer { border-top-color: #4a1030; }
body.dark .ca-deco-star:nth-child(2) { color: #f472b6; }

body.dark .ca-error-block { background: #2d0f1e; border-color: #7f1d1d; }
body.dark .ca-error-title { color: #f87171; }
body.dark .ca-error-hint { color: #b07090; }

body.dark .ca-modal-overlay { background: rgba(0, 0, 0, 0.65); }
body.dark .ca-modal { background: #1e0a14; }
body.dark .ca-modal-header { border-bottom-color: #4a1030; }
body.dark .ca-modal-header h3 { color: #f9a8d4; }
body.dark .ca-modal-close { color: #7c4163; }
body.dark .ca-modal-close:hover { background: #300f22; color: #f9a8d4; }
body.dark .ca-modal-body::-webkit-scrollbar-thumb { background: #4a1030; }
body.dark .ca-modal-body::-webkit-scrollbar-thumb:hover { background: #ec4899; }

body.dark .ca-example-card {
    border-color: #4a1030;
    background: #1e0a14;
}

body.dark .ca-example-card:hover {
    border-color: #ec4899;
    background: #280d1c;
}

body.dark .ca-example-title { color: #f9a8d4; }
body.dark .ca-example-badge { color: #f472b6; background: #280d1c; border-color: #4a1030; }
body.dark .ca-example-desc { color: #7c4163; }

/* ========== result-content Markdown 标签基础样式 ========== */
.result-content strong { font-weight: 700; }
.result-content em { font-style: italic; }
.result-content h2 { font-size: 16px; font-weight: 700; margin: 12px 0 6px; color: #831843; }
.result-content h3 { font-size: 15px; font-weight: 600; margin: 10px 0 5px; color: #9d174d; }
.result-content h4 { font-size: 14px; font-weight: 600; margin: 8px 0 4px; color: #be185d; }
.result-content h5 { font-size: 13px; font-weight: 600; margin: 6px 0 3px; color: #be185d; }
.result-content p { margin: 0 0 8px; line-height: 1.9; }
.result-content ul,
.result-content ol { margin: 4px 0 8px; padding-left: 20px; }
.result-content li { margin-bottom: 3px; line-height: 1.7; }
.result-content code {
    font-family: 'Courier New', monospace;
    background: #fdf2f8;
    color: #be185d;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
}
.result-content pre {
    background: #fdf2f8;
    border: 1px solid #fce7f3;
    border-radius: 6px;
    padding: 12px 14px;
    overflow-x: auto;
    margin: 8px 0;
}
.result-content pre code {
    background: none;
    color: #9d174d;
    padding: 0;
    font-size: 12px;
}
.result-content blockquote {
    margin: 0;
    padding: 8px 12px;
    border-left: 3px solid #ec4899;
    background: #fdf2f8;
    color: #831843;
    border-radius: 0 4px 4px 0;
    font-style: italic;
}
.result-content a {
    color: #be185d;
    text-decoration: none;
    border-bottom: 1px solid rgba(190, 24, 93, 0.3);
}
.result-content a:hover { border-bottom-color: #be185d; }

/* 暗黑模式 result-content */
body.dark .result-content h2 { color: #f9a8d4; }
body.dark .result-content h3 { color: #f472b6; }
body.dark .result-content h4,
body.dark .result-content h5 { color: #f9a8d4; }
body.dark .result-content code {
    background: #300f22;
    color: #f9a8d4;
}
body.dark .result-content pre {
    background: #280d1c;
    border-color: #4a1030;
}
body.dark .result-content pre code { color: #f472b6; }
body.dark .result-content blockquote {
    background: #280d1c;
    border-left-color: #ec4899;
    color: #f9a8d4;
}
body.dark .result-content a { color: #f472b6; border-bottom-color: rgba(244, 114, 182, 0.3); }
body.dark .result-content a:hover { border-bottom-color: #f472b6; }

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .ca-history-panel {
        width: 160px;
    }
}

@media (max-width: 700px) {
    .ca-main-content {
        flex-direction: column;
    }
    .ca-history-panel {
        width: 100%;
        height: 120px;
        border-right: none;
        border-bottom: 1px solid #fce7f3;
        flex-direction: row;
    }
    .ca-history-header {
        width: 100px;
        flex-shrink: 0;
        border-bottom: none;
        border-right: 1px solid #fce7f3;
        flex-direction: column;
        justify-content: center;
    }
    .ca-history-search { display: none; }
    .ca-history-list { flex-direction: row; padding: 0; display: flex; align-items: center; }
    .ca-input-panel { border-right: none; }
    .ca-container { height: unset; min-height: unset; }
    .ca-input-body { max-height: 420px; }
    .ca-result-body { min-height: 280px; }
}
