/* ========== 评语助手 - 主容器 ========== */
.ca-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f0f4f8;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 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;
}

/* ========== 顶部工具栏 ========== */
.ca-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 12px rgba(58, 123, 213, 0.4), inset 0 1px 0 rgba(255,255,255,0.15);
    flex-shrink: 0;
    min-height: 48px;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ca-toolbar-title {
    flex: 1;
    justify-content: center;
}

.toolbar-title-text {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toolbar-btn {
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #3a7bd5;
    transition: all 0.25s ease;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.toolbar-btn:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
    color: #2563c0;
}

.toolbar-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ========== 主内容区 ========== */
.ca-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f0f4f8;
    gap: 0;
}

/* ========== 左侧输入面板 ========== */
.ca-input-panel {
    width: 360px;
    min-width: 300px;
    max-width: 420px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
}

.input-panel-header {
    padding: 14px 18px 12px;
    background: linear-gradient(to bottom, #fafbfc 0%, #f4f6f9 100%);
    border-bottom: 1px solid #e8ecf0;
    flex-shrink: 0;
}

.input-panel-header h3 {
    margin: 0 0 2px 0;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.panel-tip {
    font-size: 11px;
    color: #90a0b7;
}

.input-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px 28px;
    scrollbar-width: thin;
    scrollbar-color: #c8d0db transparent;
}

.input-panel-body::-webkit-scrollbar {
    width: 5px;
}

.input-panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.input-panel-body::-webkit-scrollbar-thumb {
    background: #c8d0db;
    border-radius: 3px;
}

.input-panel-body::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* ========== 表单元素 ========== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 7px;
    letter-spacing: 0.2px;
}

.form-label.required::before {
    content: '*';
    color: #ef4444;
    font-size: 13px;
    line-height: 1;
}

.optional-tag {
    font-size: 10px;
    font-weight: 400;
    color: #a0aec0;
    background: #f7f8fa;
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid #e8ecf0;
}

.char-count {
    font-size: 10px;
    font-weight: 400;
    color: #a0aec0;
    margin-left: auto;
}

.char-count.warning {
    color: #f59e0b;
}

.char-count.danger {
    color: #ef4444;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #2d3748;
    background: #fafbfc;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: #3a7bd5;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.1);
}

.form-input::placeholder {
    color: #bdc8d8;
    font-size: 12px;
}

.form-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #2d3748;
    background: #fafbfc;
    outline: none;
    resize: vertical;
    min-height: 64px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    line-height: 1.5;
    font-family: inherit;
}

.form-textarea:focus {
    border-color: #3a7bd5;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.1);
}

.form-textarea::placeholder {
    color: #bdc8d8;
    font-size: 12px;
}

/* ========== 输入校验失败样式 ========== */
.form-input.input-error,
.form-textarea.input-error {
    border-color: #ef4444 !important;
    background: #fff5f5 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
    transition: all 0.2s ease;
}

/* ========== 场景选择器 ========== */
.scene-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.scene-btn {
    padding: 8px 6px;
    background: #f7f8fa;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #5a6a7e;
    transition: all 0.2s ease;
    text-align: center;
}

.scene-btn:hover {
    background: #eef2f9;
    border-color: #b8c7e0;
    color: #3a7bd5;
}

.scene-btn.active {
    background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 2px 8px rgba(58, 123, 213, 0.3);
    font-weight: 600;
}

/* ========== 表现等级选择器 ========== */
.level-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.level-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    background: #f7f8fa;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px;
    color: #5a6a7e;
}

.level-btn:hover {
    background: #eef2f9;
    border-color: #b8c7e0;
}

.level-btn.active {
    background: linear-gradient(135deg, #3a7bd5 0%, #5b9ef4 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 2px 8px rgba(58, 123, 213, 0.3);
}

.level-icon {
    font-size: 16px;
    line-height: 1;
}

.level-text {
    font-size: 11px;
    font-weight: 500;
}

/* ========== 语气风格选择器 ========== */
.style-selector {
    display: flex;
    gap: 7px;
}

.style-btn {
    flex: 1;
    padding: 7px 4px;
    background: #f7f8fa;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 500;
    color: #5a6a7e;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
}

.style-btn:hover {
    background: #eef2f9;
    border-color: #b8c7e0;
    color: #3a7bd5;
}

.style-btn.active {
    background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 2px 8px rgba(58, 123, 213, 0.3);
}

/* ========== 字数选择器 ========== */
.wc-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wc-btn {
    padding: 5px 12px;
    background: #f7f8fa;
    border: 1.5px solid #e2e8f0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #5a6a7e;
    transition: all 0.2s ease;
}

.wc-btn:hover {
    background: #eef2f9;
    border-color: #b8c7e0;
    color: #3a7bd5;
}

.wc-btn.active {
    background: #3a7bd5;
    border-color: #3a7bd5;
    color: white;
    box-shadow: 0 1px 4px rgba(58, 123, 213, 0.3);
}

/* ========== 生成数量选择器 ========== */
.count-selector {
    display: flex;
    gap: 8px;
}

.count-btn {
    flex: 1;
    padding: 6px 4px;
    background: #f7f8fa;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #5a6a7e;
    transition: all 0.2s ease;
    text-align: center;
}

.count-btn:hover {
    background: #eef2f9;
    border-color: #b8c7e0;
    color: #3a7bd5;
}

.count-btn.active {
    background: #3a7bd5;
    border-color: #3a7bd5;
    color: white;
    box-shadow: 0 1px 4px rgba(58, 123, 213, 0.3);
}

/* ========== 快捷标签 ========== */
.quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}

.q-tag {
    padding: 3px 9px;
    background: #eef4ff;
    border: 1px solid #c3d9f7;
    border-radius: 12px;
    font-size: 11px;
    color: #3a7bd5;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.q-tag:hover {
    background: #3a7bd5;
    color: white;
    border-color: #3a7bd5;
    transform: translateY(-1px);
}

/* 已添加到输入框的快捷标签 */
.q-tag.q-tag-added {
    background: #3a7bd5;
    color: white;
    border-color: #2563c0;
    opacity: 0.65;
    cursor: default;
    transform: none;
}

/* 重复添加时的闪烁反馈 */
.q-tag.q-tag-exists {
    animation: tagShake 0.4s ease;
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

@keyframes tagShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* ========== 生成/取消按钮 ========== */
.form-actions {
    padding-top: 4px;
    margin-bottom: 4px;
}

.generate-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 3px 12px rgba(58, 123, 213, 0.35);
    letter-spacing: 0.5px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(58, 123, 213, 0.55);
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.generate-btn .btn-icon {
    font-size: 16px;
}

/* Ctrl+Enter 快捷键提示 */
.btn-shortcut-hint {
    font-size: 0.78em;
    opacity: 0.72;
    font-weight: 400;
    letter-spacing: 0;
    background: rgba(255, 255, 255, 0.18);
    padding: 1px 6px;
    border-radius: 3px;
    transition: transform 0.2s ease;
    white-space: nowrap;
}

.generate-btn:hover .btn-shortcut-hint {
    transform: scale(1.06);
    opacity: 0.9;
}

@media (max-width: 600px) {
    .btn-shortcut-hint { display: none; }
}

.cancel-btn {
    width: 100%;
    padding: 12px;
    background: #fff0f0;
    border: 1.5px solid #fca5a5;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #ef4444;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cancel-btn:hover {
    background: #fee2e2;
    border-color: #ef4444;
}

/* 草稿暂存提示 */
.draft-saved-hint {
    text-align: center;
    font-size: 11px;
    color: #10b981;
    font-weight: 500;
    margin-top: 6px;
    height: 16px;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    letter-spacing: 0.2px;
}

.draft-saved-hint.show {
    opacity: 1;
}

/* 取消按钮 - 生成中流光动画 */
.cancel-btn.shimmer {
    overflow: hidden;
    position: relative;
}
.cancel-btn.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: cancelShimmer 2s ease-in-out infinite;
}
@keyframes cancelShimmer {
    to { left: 150%; }
}

/* ========== 右侧输出面板 ========== */
.ca-output-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    overflow: hidden;
    min-width: 0;
}

.output-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 18px;
    background: linear-gradient(to bottom, #fafbfc 0%, #f4f6f9 100%);
    border-bottom: 1px solid #e8ecf0;
    flex-shrink: 0;
}

.output-panel-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.output-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-count-badge {
    padding: 2px 10px;
    background: linear-gradient(135deg, #e0f0ff 0%, #d4eaff 100%);
    color: #3a7bd5;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #b8d9f7;
}

.re-generate-btn {
    padding: 5px 12px;
    background: #eef2f9;
    border: 1px solid #c3d4e8;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #3a7bd5;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.re-generate-btn:hover {
    background: #3a7bd5;
    color: white;
    border-color: #3a7bd5;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(58, 123, 213, 0.25);
}

/* ========== 空状态 ========== */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    text-align: center;
    color: #94a3b8;
}

.empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(58, 123, 213, 0.15));
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 10px;
}

.empty-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.8;
    margin-bottom: 24px;
}

.empty-scene-tips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.scene-tip-card {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 12px;
    color: #64748b;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
    cursor: default;
}

.scene-tip-card:hover {
    background: #eef4ff;
    border-color: #c3d9f7;
    color: #3a7bd5;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(58, 123, 213, 0.12);
}

.scene-tip-icon {
    font-size: 16px;
}

/* ========== 加载状态 ========== */
.loading-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    text-align: center;
    min-height: 300px;
    height: 100%;
}

.loading-rings {
    position: relative;
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
}

.loading-ring {
    position: absolute;
    border-radius: 50%;
    border: 3px solid transparent;
    animation: spin 1.5s linear infinite;
}

.loading-ring:nth-child(1) {
    width: 64px; height: 64px;
    border-top-color: #3a7bd5;
    animation-duration: 1.0s;
}

.loading-ring:nth-child(2) {
    width: 48px; height: 48px;
    top: 8px; left: 8px;
    border-top-color: #00d2ff;
    animation-duration: 1.3s;
    animation-direction: reverse;
}

.loading-ring:nth-child(3) {
    width: 32px; height: 32px;
    top: 16px; left: 16px;
    border-top-color: #3a7bd5;
    animation-duration: 0.9s;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.loading-sub {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 16px;
}

.loading-dots {
    display: flex;
    gap: 6px;
}

.loading-dots span {
    width: 7px;
    height: 7px;
    background: #3a7bd5;
    border-radius: 50%;
    animation: bounce 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 bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
    30% { transform: translateY(-10px); opacity: 1; }
}

/* ========== 结果列表 ========== */
.result-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: #c8d0db transparent;
}

.result-list::-webkit-scrollbar {
    width: 5px;
}

.result-list::-webkit-scrollbar-track {
    background: transparent;
}

.result-list::-webkit-scrollbar-thumb {
    background: #c8d0db;
    border-radius: 3px;
}

.result-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* ========== 评语卡片 ========== */
.comment-card {
    background: white;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #c3d9f7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease;
    overflow: hidden;
    animation: cardIn 0.35s ease both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-card:hover {
    box-shadow: 0 4px 18px rgba(58, 123, 213, 0.14);
    border-color: #c3d9f7;
    border-left-color: #3a7bd5;
    transform: translateY(-1px);
}

.comment-card.favorited {
    border-color: #fbbf24;
    border-left-color: #f59e0b;
    box-shadow: 0 4px 16px rgba(251, 191, 36, 0.18);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(to right, #f4f8ff, #f8fbff);
    border-bottom: 1px solid #eef2f9;
}

.card-number {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-index {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #3a7bd5, #00d2ff);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.card-word-count {
    font-size: 11px;
    color: #94a3b8;
    padding: 2px 7px;
    background: #f1f5f9;
    border-radius: 10px;
}

.card-actions {
    display: flex;
    gap: 6px;
}

.card-btn {
    padding: 4px 10px;
    border-radius: 5px;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    font-size: 11px;
    color: #64748b;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 3px;
}

.card-btn:hover {
    background: #eef4ff;
    border-color: #3a7bd5;
    color: #3a7bd5;
}

.card-btn.favorite-btn.active {
    background: #fff8e1;
    border-color: #fbbf24;
    color: #d97706;
}

.card-btn.copy-btn:active {
    transform: scale(0.95);
}

.card-body {
    padding: 14px 16px;
}

.comment-text {
    font-size: 14px;
    line-height: 1.85;
    color: #2d3748;
    word-break: break-word;
    white-space: pre-wrap;
}

/* ========== 错误状态 ========== */
.error-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    text-align: center;
}

.error-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.error-text {
    font-size: 14px;
    color: #ef4444;
    margin-bottom: 16px;
    max-width: 300px;
    line-height: 1.5;
}

.retry-btn {
    padding: 8px 24px;
    background: #fff0f0;
    border: 1.5px solid #fca5a5;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #ef4444;
    transition: all 0.2s;
}

.retry-btn:hover {
    background: #fee2e2;
    border-color: #ef4444;
}

/* ========== 历史记录弹窗 ========== */
.ca-history-modal-content {
    width: 620px;
    max-width: 92vw;
    max-height: 82vh;
}

.history-modal-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-clear-all-btn {
    padding: 4px 12px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.45);
    border-radius: 5px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-clear-all-btn:hover {
    background: rgba(239, 68, 68, 0.55);
    border-color: rgba(239, 68, 68, 0.8);
}

/* 工具栏历史按钮徽章 */
.history-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ef4444;
    color: white;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 3px;
    line-height: 1;
    vertical-align: middle;
}

/* 历史列表容器 */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 历史空状态 */
.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
}

.history-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.7;
}

.history-empty-text {
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
}

.history-empty-sub {
    font-size: 12px;
    color: #94a3b8;
}

/* 历史条目卡片 */
.history-item {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    transition: all 0.2s ease;
    animation: cardIn 0.25s ease both;
}

.history-item:hover {
    border-color: #c3d9f7;
    background: #f0f6ff;
    box-shadow: 0 3px 12px rgba(58, 123, 213, 0.1);
}

/* 历史条目头部 */
.hi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
    gap: 8px;
}

.hi-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
}

.hi-scene {
    font-size: 12px;
    font-weight: 600;
    color: #3a7bd5;
    background: #e8f1fd;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.hi-name {
    font-size: 12px;
    font-weight: 600;
    color: #2d3748;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 8px;
    white-space: nowrap;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hi-subject {
    font-size: 11px;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 8px;
    white-space: nowrap;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hi-level {
    font-size: 11px;
    color: #64748b;
}

.hi-right {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.hi-count {
    font-size: 11px;
    color: #3a7bd5;
    background: #e0f0ff;
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
}

.hi-date {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
}

.hi-delete-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: white;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
}

.hi-delete-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #ef4444;
}

/* 历史条目预览 */
.hi-preview {
    font-size: 12px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 8px;
    padding: 7px 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #eef2f9;
    word-break: break-all;
}

/* 历史条目底部 */
.hi-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.hi-strengths {
    font-size: 11px;
    color: #94a3b8;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hi-restore-btn {
    flex-shrink: 0;
    padding: 4px 14px;
    background: #3a7bd5;
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.hi-restore-btn:hover {
    background: #2563c0;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(58, 123, 213, 0.3);
}

/* ========== 示例导入弹窗 ========== */
.ca-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.ca-modal.show {
    display: flex;
}

.ca-modal-content {
    background: white;
    border-radius: 12px;
    width: 540px;
    max-width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalIn 0.25s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10001;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92) translateY(-20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.ca-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
    color: white;
}

.ca-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.ca-modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ca-modal-close:hover {
    background: rgba(255,255,255,0.35);
}

.ca-modal-body {
    overflow-y: auto;
    padding: 18px;
    flex: 1;
}

.ca-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    backdrop-filter: blur(3px);
}

.ca-modal-overlay.show {
    display: block;
}

/* ========== 示例网格 ========== */
.example-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.example-card {
    padding: 14px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.example-card:hover {
    border-color: #3a7bd5;
    background: #eef4ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(58, 123, 213, 0.15);
}

.example-card-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.example-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
}

.example-card-desc {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.5;
}

/* ========== Toast 提示 ========== */
.ca-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(44, 56, 74, 0.92);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    z-index: 20000;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.ca-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ca-toast.success { border-left: 3px solid #10b981; }
.ca-toast.error   { border-left: 3px solid #ef4444; }
.ca-toast.info    { border-left: 3px solid #3a7bd5; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .ca-main-content {
        flex-direction: column;
    }

    .ca-input-panel {
        width: 100%;
        max-width: 100%;
        height: 50vh;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .example-grid {
        grid-template-columns: 1fr;
    }

    .ca-toolbar-title {
        display: none;
    }
}
