/* =============================================
   利弊分析工具 - pros_and_cons_analysis.css
   三栏布局：历史 | 配置 | 结果
   主题色：靛蓝 (indigo)，利 绿色，弊 红色
   ============================================= */

/* ========== 主容器 ========== */
.pca-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 620px;
    background: #f3f1fb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(67, 56, 202, 0.10);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.pca-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;
}

/* ========== 顶部工具栏 ========== */
.pca-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 12px;
    min-height: 38px;
    background: linear-gradient(135deg, #312e81 0%, #4f46e5 60%, #6d28d9 100%);
    color: #fff;
    flex-wrap: wrap;
    gap: 6px;
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.4);
    flex-shrink: 0;
}

.pca-toolbar .toolbar-group {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.pca-toolbar .toolbar-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #4338ca;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.5;
}

.pca-toolbar .toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.pca-toolbar .toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.pca-toolbar .toolbar-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

/* 危险/取消按钮 */
.pca-toolbar .toolbar-btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.40);
}

.pca-toolbar .toolbar-btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.50);
}

/* 主操作按钮 */
.pca-toolbar .toolbar-btn-primary {
    background: linear-gradient(135deg, #059669 0%, #065f46 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.45);
}

.pca-toolbar .toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.55);
}

/* AI分析按钮 loading 流光动画 */
.pca-toolbar .toolbar-btn-primary.pca-btn-loading {
    background: linear-gradient(90deg, #059669 0%, #34d399 35%, #059669 65%, #065f46 100%);
    background-size: 200% 100%;
    animation: pcaBtnShimmer 1.4s ease-in-out infinite;
    cursor: not-allowed;
}

@keyframes pcaBtnShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 工具栏标题 */
.pca-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.5px;
    margin-right: 4px;
}

/* ========== 三栏主内容区 ========== */
.pca-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f3f1fb;
}

/* ========== 左栏：历史记录 ========== */
.pca-history-panel {
    width: 210px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e0ddf5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(to bottom, #faf9ff 0%, #f3f1fb 100%);
    border-bottom: 1px solid #e0ddf5;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #3730a3;
}

.history-count {
    font-size: 11px;
    color: #818cf8;
    font-weight: 400;
}

.history-clear-btn {
    background: #eef2ff;
    border: none;
    color: #4f46e5;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.history-clear-btn:hover { background: #e0e7ff; }

/* 历史搜索框 — 使用 margin-bottom 代替 border-bottom */
.history-search {
    padding: 7px;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #3730a3;
    background: #faf9ff;
}

.history-search input::placeholder { color: #c7d2fe; }

.history-search input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 5px;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 2px; }
.history-list::-webkit-scrollbar-thumb:hover { background: #f97316; }

.history-item {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s;
    margin-bottom: 3px;
    border: 1px solid transparent;
}

.history-item:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}

.history-item.active {
    background: #e0e7ff;
    border-color: #a5b4fc;
}

.history-item-main { flex: 1; min-width: 0; }

.history-item-topic {
    font-size: 13px;
    font-weight: 600;
    color: #3730a3;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-meta {
    font-size: 10px;
    color: #818cf8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item-badge {
    background: #e0e7ff;
    color: #4f46e5;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
}

.history-item-del {
    background: none;
    border: none;
    color: #a5b4fc;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.15s;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0;
}

.history-item:hover .history-item-del { opacity: 1; }
.history-item:hover .history-item-del:hover { color: #ef4444; background: #fef2f2; }

.history-empty {
    text-align: center;
    color: #a5b4fc;
    font-size: 12px;
    padding: 24px 8px;
    line-height: 1.8;
}

/* ========== 中栏：输入配置面板 ========== */
.pca-input-panel {
    width: 310px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e0ddf5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 12px 14px 10px;
    border-bottom: 1px solid #e0ddf5;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #faf9ff 0%, #f3f1fb 100%);
}

.panel-header h3 {
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 600;
    color: #3730a3;
}

.panel-tip {
    font-size: 11px;
    color: #818cf8;
    display: block;
}

.pca-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 20px;
}

.pca-input-body::-webkit-scrollbar { width: 4px; }
.pca-input-body::-webkit-scrollbar-track { background: transparent; }
.pca-input-body::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 2px; }
.pca-input-body::-webkit-scrollbar-thumb:hover { background: #f97316; }

/* 字段分组 */
.pca-field-group {
    margin-bottom: 14px;
}

.pca-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #4338ca;
    margin-bottom: 5px;
}

.required-mark { color: #ef4444; }
.optional-mark { color: #818cf8; font-weight: 400; }

/* 主题输入框 */
.pca-topic-input {
    width: 100%;
    padding: 9px 12px;
    border: 2px solid #c7d2fe;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    color: #1e1b4b;
    background: #faf9ff;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.pca-topic-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: #fff;
}

.pca-topic-input::placeholder {
    font-size: 12px;
    color: #a5b4fc;
    font-weight: 400;
}

.pca-topic-input.shake {
    animation: inputShake 0.4s ease;
    border-color: #ef4444;
}

@keyframes inputShake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-6px); }
    75%       { transform: translateX(6px); }
}

/* 背景信息 textarea */
.pca-context-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid #c7d2fe;
    border-radius: 6px;
    font-size: 12px;
    color: #3730a3;
    background: #faf9ff;
    outline: none;
    transition: all 0.2s;
    resize: vertical;
    min-height: 70px;
    box-sizing: border-box;
    line-height: 1.6;
    font-family: inherit;
}

.pca-context-textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
    background: #fff;
}

.pca-context-textarea::placeholder { color: #a5b4fc; }

/* 字符计数 */
.pca-char-counter {
    text-align: right;
    font-size: 10px;
    color: #a5b4fc;
    margin-top: 3px;
    transition: color 0.25s ease;
}

/* 选项分组 */
.pca-option-group {
    margin-bottom: 14px;
}

/* 视角 2x2 网格 */
.pca-perspective-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.pca-perspective-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 6px;
    border: 1.5px solid #c7d2fe;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.18s;
    background: #faf9ff;
    user-select: none;
}

.pca-perspective-option:hover {
    border-color: #6366f1;
    color: #4338ca;
    background: #eef2ff;
}

.pca-perspective-option.selected {
    border-color: #6366f1;
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
}

.pca-opt-icon {
    font-size: 18px;
    margin-bottom: 3px;
    line-height: 1;
}

.pca-opt-name {
    font-size: 11px;
    font-weight: 600;
}

/* 深度选项 — 横向三列 */
.pca-depth-options {
    display: flex;
    gap: 6px;
}

.pca-depth-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    border: 1.5px solid #c7d2fe;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.18s;
    background: #faf9ff;
    user-select: none;
}

.pca-depth-option:hover {
    border-color: #6366f1;
    background: #eef2ff;
}

.pca-depth-option.selected {
    border-color: #6366f1;
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
}

.pca-opt-hint {
    font-size: 10px;
    color: #818cf8;
    margin-top: 2px;
    display: block;
}

.pca-depth-option.selected .pca-opt-hint { color: rgba(255, 255, 255, 0.75); }

/* 使用说明 */
.pca-tips-box {
    background: linear-gradient(135deg, #faf9ff 0%, #eef2ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    color: #3730a3;
    line-height: 1.7;
    margin-top: 4px;
}

.pca-tips-box p { margin: 0 0 5px; font-weight: 600; font-size: 12px; }
.pca-tips-box ul { margin: 0; padding-left: 16px; }
.pca-tips-box li { margin-bottom: 2px; }

.pca-tips-box kbd {
    display: inline-block;
    padding: 1px 5px;
    background: #e0e7ff;
    border: 1px solid #a5b4fc;
    border-radius: 3px;
    font-size: 11px;
    font-family: monospace;
    color: #4338ca;
}

/* ========== 右栏：分析结果 ========== */
.pca-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f7f6fd;
    min-width: 0;
}

.pca-result-header {
    padding: 10px 16px;
    border-bottom: 1px solid #e0ddf5;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #faf9ff 0%, #f3f1fb 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pca-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #3730a3;
}

.result-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-meta-topic {
    font-size: 13px;
    font-weight: 700;
    color: #4338ca;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-depth-badge {
    background: #e0e7ff;
    color: #4338ca;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.pca-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
}

.pca-result-body::-webkit-scrollbar { width: 5px; }
.pca-result-body::-webkit-scrollbar-track { background: transparent; }
.pca-result-body::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 3px; }
.pca-result-body::-webkit-scrollbar-thumb:hover { background: #f97316; }

/* 占位提示 */
.result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #a5b4fc;
    text-align: center;
    padding: 40px;
    min-height: 200px;
}

.placeholder-icon {
    font-size: 56px;
    margin-bottom: 14px;
    opacity: 0.65;
    animation: pcaIconPulse 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes pcaIconPulse {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50%       { opacity: 0.80; transform: scale(1.08); }
}
.placeholder-title { font-size: 16px; font-weight: 600; color: #818cf8; margin: 0 0 10px; }
.placeholder-desc { font-size: 13px; color: #a5b4fc; margin: 4px 0; line-height: 1.6; }

/* 加载中 */
.result-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    min-height: 200px;
}

.loading-dots {
    display: flex;
    gap: 8px;
}

.loading-dots span {
    width: 11px;
    height: 11px;
    background: #6366f1;
    border-radius: 50%;
    animation: pcaDotBounce 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 pcaDotBounce {
    0%, 80%, 100% { transform: scale(0.65); opacity: 0.45; }
    40%            { transform: scale(1.1); opacity: 1; }
}

.loading-text { font-size: 13px; color: #818cf8; margin: 0; }

/* 加载中显示当前分析主题 */
.loading-topic {
    font-size: 13px;
    color: #4338ca;
    font-weight: 600;
    margin: 4px 0 0;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 结果内容容器 */
.result-content {
    animation: pcaFadeInUp 0.35s ease;
    min-height: 0;
}

@keyframes pcaFadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   分析结果卡片样式（Java后端渲染的HTML）
   ============================================= */

/* 外层卡片 */
.pca-result-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(67, 56, 202, 0.08);
    overflow: hidden;
}

/* 主题标题行 */
.pca-result-topic {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #312e81 0%, #4f46e5 60%, #6d28d9 100%);
}

.pca-result-topic-label {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 90px);
}

.pca-depth-tag {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 3px 9px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    white-space: nowrap;
    flex-shrink: 0;
}

/* 通用section标题 */
.pca-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #4338ca;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pca-section-icon { font-size: 14px; }

/* 议题概述 */
.pca-summary {
    padding: 14px 18px;
    border-bottom: 1px solid #e8e5f8;
    background: #faf9ff;
}

.pca-summary-text {
    margin: 0;
    font-size: 13px;
    color: #3730a3;
    line-height: 1.8;
}

/* 利弊双栏 */
.pca-analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid #e8e5f8;
}

@media (max-width: 900px) {
    .pca-analysis-grid {
        grid-template-columns: 1fr;
    }
}

/* 利弊面板基础 */
.pca-pros-panel,
.pca-cons-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pca-pros-panel { border-right: 1px solid #e8e5f8; }

/* 面板头部 */
.pca-panel-header {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    border-bottom: 2px solid transparent;
    flex-shrink: 0;
}

.pca-pros-header {
    background: linear-gradient(to right, #f0fdf4, #dcfce7);
    color: #15803d;
    border-bottom-color: #86efac;
}

.pca-cons-header {
    background: linear-gradient(to right, #fef2f2, #fee2e2);
    color: #b91c1c;
    border-bottom-color: #fca5a5;
}

.pca-panel-icon { font-size: 16px; }
.pca-panel-title { flex: 1; }

.pca-item-count {
    font-size: 11px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.07);
    padding: 1px 6px;
    border-radius: 10px;
}

/* 要点列表区域 */
.pca-items-list {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 单个要点 */
.pca-item {
    padding: 10px 12px;
    border-radius: 6px;
    border-left: 3px solid transparent;
    transition: background 0.15s;
}

.pca-item-pros {
    background: #f0fdf4;
    border-left-color: #4ade80;
}

.pca-item-cons {
    background: #fef2f2;
    border-left-color: #f87171;
}

.pca-item-pros:hover { background: #dcfce7; }
.pca-item-cons:hover { background: #fee2e2; }

/* 要点头部 */
.pca-item-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.pca-item-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pca-item-pros .pca-item-dot { background: #16a34a; }
.pca-item-cons .pca-item-dot { background: #dc2626; }

.pca-item-title {
    flex: 1;
    font-size: 13px;
    font-weight: 700;
}

.pca-item-pros .pca-item-title { color: #14532d; }
.pca-item-cons .pca-item-title { color: #7f1d1d; }

/* 重要性徽章 */
.pca-importance-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    flex-shrink: 0;
    font-weight: 600;
}

.importance-high {
    background: #fef9c3;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.importance-medium {
    background: #e0e7ff;
    color: #3730a3;
    border: 1px solid #a5b4fc;
}

.importance-low {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

/* 要点描述 */
.pca-item-desc {
    margin: 0;
    font-size: 12px;
    line-height: 1.75;
    padding-left: 12px;
}

.pca-item-pros .pca-item-desc { color: #166534; }
.pca-item-cons .pca-item-desc { color: #991b1b; }

/* 关键决策因素 */
.pca-key-factors {
    padding: 12px 18px;
    border-bottom: 1px solid #e8e5f8;
    background: #faf9ff;
}

.pca-factors-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 4px;
}

.pca-factor-tag {
    padding: 4px 12px;
    background: #e0e7ff;
    border: 1px solid #c7d2fe;
    border-radius: 20px;
    font-size: 12px;
    color: #3730a3;
    font-weight: 500;
    transition: all 0.18s;
    cursor: default;
}

.pca-factor-tag:hover {
    background: #c7d2fe;
    border-color: #818cf8;
    color: #1e1b4b;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.20);
}

/* 综合建议与结论 */
.pca-recommendation {
    padding: 14px 18px;
}

.pca-recommendation-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.pca-verdict-badge {
    font-size: 13px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    flex-shrink: 0;
}

.verdict-recommended .pca-verdict-badge {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.35);
}

.verdict-not-recommended .pca-verdict-badge {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
}

.verdict-neutral .pca-verdict-badge {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
}

.pca-verdict-reason {
    font-size: 12px;
    color: #64748b;
    font-style: italic;
    flex: 1;
    min-width: 0;
}

.pca-recommendation-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.8;
    padding: 10px 14px;
    border-radius: 6px;
}

.verdict-recommended .pca-recommendation-text {
    background: #f0fdf4;
    color: #14532d;
    border-left: 3px solid #4ade80;
}

.verdict-not-recommended .pca-recommendation-text {
    background: #fef2f2;
    color: #7f1d1d;
    border-left: 3px solid #f87171;
}

.verdict-neutral .pca-recommendation-text {
    background: #eef2ff;
    color: #1e1b4b;
    border-left: 3px solid #818cf8;
}

/* 字符计数接近上限预警 */
.pca-char-counter.near-limit { color: #f59e0b !important; }
.pca-char-counter.at-limit   { color: #ef4444 !important; font-weight: 600; }

/* 结果头部“重新分析”快捷按钮 */
.pca-reanalyze-btn {
    padding: 3px 10px;
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(99, 102, 241, 0.35);
}

.pca-reanalyze-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.45);
}

.pca-reanalyze-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* 错误状态重试按钮 */
.pca-error-retry-btn {
    margin-top: 12px;
    padding: 7px 22px;
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
}

.pca-error-retry-btn:hover {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.45);
}

.pca-error-card .error-tip {
    font-size: 12px;
    color: #94a3b8;
    margin: 4px 0 0;
}

/* 错误卡片 */
.pca-error-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.pca-error-card .error-icon { font-size: 36px; margin-bottom: 10px; }
.pca-error-card .error-msg { font-size: 14px; color: #dc2626; margin: 0; font-weight: 600; }

/* ========== 示例导入模态框 ========== */
.pca-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 27, 75, 0.45);
    backdrop-filter: blur(2px);
    z-index: 10000;
    display: none;
}

.pca-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(67, 56, 202, 0.22);
    width: 600px;
    max-width: 96vw;
    max-height: 90vh;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.pca-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #312e81 0%, #4f46e5 100%);
    color: #fff;
    flex-shrink: 0;
}

.pca-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.pca-modal-close {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.pca-modal-close:hover { background: rgba(255, 255, 255, 0.35); }

.pca-modal-body {
    overflow-y: auto;
    padding: 16px;
}

.pca-modal-body::-webkit-scrollbar { width: 5px; }
.pca-modal-body::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 3px; }
.pca-modal-body::-webkit-scrollbar-thumb:hover { background: #f97316; }

.example-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.example-card {
    padding: 12px 14px;
    border: 1.5px solid #c7d2fe;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s;
    background: #faf9ff;
}

.example-card:hover {
    border-color: #6366f1;
    background: #eef2ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.18);
}

.example-card-icon { font-size: 24px; margin-bottom: 6px; display: block; }

.example-card-topic {
    font-size: 14px;
    font-weight: 700;
    color: #3730a3;
    margin-bottom: 4px;
}

.example-card-meta {
    font-size: 11px;
    color: #818cf8;
    margin-bottom: 5px;
}

.example-card-context {
    font-size: 11px;
    color: #64748b;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== 响应式适配 ========== */
@media (max-width: 1100px) {
    .pca-input-panel { width: 280px; }
    .pca-history-panel { width: 185px; }
}

@media (max-width: 860px) {
    .pca-history-panel { display: none; }
    .pca-input-panel { width: 260px; }
}

@media (max-width: 640px) {
    .pca-main-content { flex-direction: column; }
    .pca-input-panel { width: 100%; border-right: none; border-bottom: 1px solid #e0ddf5; max-height: 45%; }
    .example-grid { grid-template-columns: 1fr; }
}

/* ========== 打印样式 ========== */
@media print {
    .pca-toolbar,
    .pca-history-panel,
    .pca-input-panel,
    .pca-modal-overlay,
    .pca-modal,
    #pcaResultLoading,
    #pcaResultPlaceholder,
    #pcaResultError,
    .result-meta-row { display: none !important; }

    .pca-container {
        position: static !important;
        height: auto !important;
        box-shadow: none;
        background: #fff;
    }

    .pca-main-content {
        display: block;
        overflow: visible;
    }

    .pca-result-panel {
        width: 100%;
        overflow: visible;
    }

    .pca-result-body {
        overflow: visible;
        padding: 0;
    }

    .pca-result-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .pca-analysis-grid {
        grid-template-columns: 1fr 1fr;
    }
}
