/**
 * 人物关系分析模块样式
 */

/* 模态框基础样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.fade-out {
    animation: fadeOut 0.2s ease forwards;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 520px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.2s ease;
}

/* 分析模态框头部 */
.analysis-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.analysis-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.analysis-modal-icon span {
    font-size: 28px;
}

.analysis-modal-header h3 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #1a1a2e;
    font-weight: 600;
}

.analysis-modal-subtitle {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.analysis-modal-points {
    margin: 8px 0 0;
    color: #888;
    font-size: 12px;
}

.analysis-modal-points span {
    color: #4f46e5;
    font-weight: 600;
}

/* 分析模式选项 */
.analysis-mode-option {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.analysis-mode-option:hover {
    border-color: #c7d2fe;
    background: #fafafa;
}

.analysis-mode-option.selected {
    border-color: #4f46e5;
    background: #f5f3ff;
}

.analysis-mode-option.selected.orange {
    border-color: #f59e0b;
    background: #fffbeb;
}

.analysis-mode-option.selected.green {
    border-color: #10b981;
    background: #f0fdf4;
}

.mode-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mode-option-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mode-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.analysis-mode-option.selected .mode-radio {
    border-color: #4f46e5;
}

.analysis-mode-option.selected.orange .mode-radio {
    border-color: #f59e0b;
}

.analysis-mode-option.selected.green .mode-radio {
    border-color: #10b981;
}

.mode-radio-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: transparent;
}

.analysis-mode-option.selected .mode-radio-dot {
    background: #4f46e5;
}

.analysis-mode-option.selected.orange .mode-radio-dot {
    background: #f59e0b;
}

.analysis-mode-option.selected.green .mode-radio-dot {
    background: #10b981;
}

.mode-info {
    flex: 1;
}

.mode-title {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.mode-subtitle {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.mode-points {
    font-weight: 700;
    color: #4f46e5;
    font-size: 16px;
    text-align: right;
}

.analysis-mode-option.selected.orange .mode-points {
    color: #f59e0b;
}

.analysis-mode-option.selected.green .mode-points {
    color: #10b981;
}

.mode-description {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    padding-left: 32px;
}

.recommend-tag {
    background: #4f46e5;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: 500;
}

.analysis-mode-option.orange .recommend-tag {
    background: #f59e0b;
}

.analysis-mode-option.green .recommend-tag {
    background: #10b981;
}


/* 章节范围选择器 */
.mode-range-selector {
    margin-top: 12px;
    padding-left: 32px;
    display: none;
}

.analysis-mode-option.selected .mode-range-selector {
    display: block;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #666;
}

.chapter-input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
}

.chapter-input:focus {
    outline: none;
    border-color: #4f46e5;
}

.range-btn {
    padding: 4px 8px;
    background: #f3f4f6;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.range-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

/* 模型选择器 */
.analysis-model-selector {
    margin: 20px 0 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.analysis-model-title {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 12px;
}

.analysis-model-options {
    display: flex;
    gap: 12px;
}

.analysis-model-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s;
}

.analysis-model-option:hover {
    border-color: #c7d2fe;
}

.analysis-model-option.selected {
    border-color: #4f46e5;
    background: #eff6ff;
}

.analysis-model-option .model-radio {
    width: 16px;
    height: 16px;
}

.analysis-model-option .model-radio-dot {
    width: 8px;
    height: 8px;
}

.analysis-model-option.selected .model-radio {
    border-color: #4f46e5;
}

.analysis-model-option.selected .model-radio-dot {
    background: #4f46e5;
}

.model-name {
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.model-name.primary {
    color: #1e40af;
}

.model-desc {
    font-size: 11px;
    color: #666;
}

/* 按钮 */
.analysis-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.btn-primary {
    padding: 12px 36px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.btn-primary.disabled,
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    padding: 12px 36px;
    background: #f3f4f6;
    color: #666;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* 加载动画 */
.loading-spinner {
    width: 64px;
    height: 64px;
    border: 4px solid #e2e8f0;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}


/* ========== 拟态编辑弹窗样式 ========== */
.neuro-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.2s ease;
}

.neuro-modal {
    background: linear-gradient(145deg, #f5f5f8, #ffffff);
    border-radius: 16px;
    box-shadow: 12px 12px 30px rgba(0, 0, 0, 0.15),
                -12px -12px 30px rgba(255, 255, 255, 0.9),
                inset 1px 1px 2px rgba(255, 255, 255, 0.8);
    max-width: 700px;
    width: 92%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.neuro-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(145deg, #e8e8eb, #f0f0f3);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: move;
    flex-shrink: 0;
}

.neuro-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #5c4d3d;
}

.neuro-modal-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    background: linear-gradient(145deg, #f0f0f3, #e6e6e9);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1), -2px -2px 5px rgba(255, 255, 255, 0.8);
    color: #666;
}

.neuro-modal-close:hover {
    color: #dc2626;
}

.neuro-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.neuro-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 20px;
    background: linear-gradient(145deg, #f5f5f8, #fafafa);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.neuro-btn-cancel {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: linear-gradient(145deg, #f0f0f3, #e6e6e9);
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.08), -3px -3px 8px rgba(255, 255, 255, 0.8);
    color: #666;
    font-size: 14px;
}

.neuro-btn-cancel:hover {
    background: linear-gradient(145deg, #e6e6e9, #dcdcdf);
}

.neuro-btn-save {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: linear-gradient(145deg, #8b5cf6, #7c3aed);
    box-shadow: 3px 3px 8px rgba(139, 92, 246, 0.3), -3px -3px 8px rgba(255, 255, 255, 0.8);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.neuro-btn-save:hover {
    background: linear-gradient(145deg, #7c3aed, #6d28d9);
}

.neuro-edit-textarea {
    width: 100%;
    min-height: 300px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.8;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}

.neuro-edit-textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.neuro-edit-item {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
}

.neuro-edit-item input,
.neuro-edit-item textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}

.neuro-edit-item textarea {
    min-height: 40px;
    resize: vertical;
}

.neuro-edit-item input:focus,
.neuro-edit-item textarea:focus {
    outline: none;
    border-color: #8b5cf6;
}

.neuro-add-btn {
    margin-top: 8px;
    background: #e0e7ff;
    color: #4338ca;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.neuro-add-btn:hover {
    background: #c7d2fe;
}

.neuro-delete-btn {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.neuro-delete-btn:hover {
    background: #fecaca;
}

.neuro-cat-section {
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.neuro-cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f1f5f9;
    cursor: pointer;
}

.neuro-cat-header h4 {
    margin: 0;
    font-size: 14px;
    color: #334155;
}

.neuro-cat-body {
    padding: 12px;
}

/* ========== 深色模式适配 ========== */
body.dark-mode .modal-content { background: #16213e; color: #e0e0e0; }
body.dark-mode .analysis-modal-header { color: #e0e0e0; }
