/* ============================================================
   去AI味窗口样式（view-deai）
   · 布局与交互复用 polish.css（.polish-* class）
   · 主题变量与首页一致（main.css: --brand / --card / --border …）
   · 本文件补充：改写结果正文排版、流式光标、朱雀 AI 率对比面板
   ============================================================ */

.deai-output-text {
    /* 字号由结果区「小/中/大」切换（--reading-fs 在 polish.css 里定义） */
    font-size: var(--reading-fs, 15px);
    line-height: 1.9;
    color: var(--text);
    word-break: break-word;
    max-width: 42em;
    margin: 0 auto;
}

/* 中文小说排版：首行缩进 2 字 + 段间距 */
.deai-output-text p {
    margin: 0 0 .8em;
    text-indent: 2em;
}
.deai-output-text p:last-child { margin-bottom: 0; }

.deai-output-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 2px;
    vertical-align: text-bottom;
    background: var(--brand);
    animation: deai-cursor-blink 1s steps(2, start) infinite;
}

@keyframes deai-cursor-blink {
    to { visibility: hidden; }
}

/* ---------- AI 率对比面板 ---------- */
/* 面板整体可收起，避免长期占用正文高度（正文优先） */
.deai-score-panel {
    flex-shrink: 0;
    max-height: 38%;
    overflow-y: auto;
    padding: 10px 16px 12px;
    border-top: 1px solid var(--border);
    background: var(--card-2);
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.deai-score-panel.collapsed { max-height: none; overflow: visible; padding-bottom: 10px; }
.deai-score-panel.collapsed .deai-score-body { display: none; }

.deai-score-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.deai-score-title { font-size: 13px; font-weight: 700; color: var(--text); }
/* 降幅徽标：降为绿色、升为红色，一眼看出改写是否有效 */
.deai-delta {
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.deai-delta-down { color: #1a7f37; background: #e8f7ed; }
.deai-delta-up { color: #b42318; background: #feeceb; }
.deai-delta-flat { color: var(--muted); background: #eef0f3; }
.deai-score-toggle { margin-left: auto; }

.deai-score-body { display: flex; flex-direction: column; gap: 9px; }

.deai-score-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.deai-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    padding: 6px 12px;
    border-radius: var(--r-card);
    color: #fff;
}
.deai-score-num { font-size: 22px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.deai-score-label { font-size: 11px; opacity: 0.92; margin-top: 2px; white-space: nowrap; }
.deai-score-good { background: #34c759; }
.deai-score-warn { background: #f6a13a; }
.deai-score-bad  { background: #e54d4d; }

/* 三色条占据本行剩余宽度，与两侧指标卡同一行 */
.deai-bar-wrap {
    flex: 1 1 200px;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.deai-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 20px;
    line-height: 1;
    color: var(--muted);
}
.deai-arrow small { font-size: 11px; white-space: nowrap; }
.deai-arrow-down { color: #34c759; }
.deai-arrow-up { color: #e54d4d; }

/* ---------- 三色横条 ---------- */
.deai-bar-track {
    display: flex;
    width: 100%;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    background: #eef0f3;
}
.deai-bar-seg { height: 100%; transition: width .2s; }
.deai-bar-human { background: #34c759; }
.deai-bar-suspect { background: #f6a13a; }
.deai-bar-ai { background: #e54d4d; }

.deai-bar-legend {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--muted);
    flex-wrap: wrap;
}
.deai-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.deai-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.deai-dot-human { background: #34c759; }
.deai-dot-suspect { background: #f6a13a; }
.deai-dot-ai { background: #e54d4d; }

/* ---------- 改写后残留的 AI 高风险段落（折叠，默认收起） ---------- */
.deai-advice-focus {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.deai-seg-details {
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    background: var(--card);
    overflow: hidden;
}
.deai-seg-details > summary {
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
    list-style: none;
}
.deai-seg-details > summary::-webkit-details-marker { display: none; }
.deai-seg-details > summary::before { content: '▸ '; color: var(--muted); }
.deai-seg-details[open] > summary { border-bottom: 1px solid var(--border); }

.deai-seg-list { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; }
.deai-seg {
    border-left: 3px solid #d1d5db;
    padding: 6px 10px;
    border-radius: 0 var(--r-card) var(--r-card) 0;
    background: var(--card);
}
.deai-seg-ai { border-left-color: #e54d4d; background: #fff5f5; }
.deai-seg-tag {
    font-size: 11px;
    font-weight: 700;
    color: #e54d4d;
    margin-bottom: 3px;
}
.deai-seg-text {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text);
    word-break: break-word;
}
.deai-quota-note{font-size:12px;line-height:1.6;color:var(--text-muted,#687970);margin:8px 0 12px}
