/* 知时 2.0 · 溯源与核验 */
.trace-head { margin: 10px 0 8px; }
.trace-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.trace-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.trace-chip, .trace-badge {
  display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 13px; line-height: 1.2;
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line, #e3dccd); background: var(--card, #fffdf8); color: var(--ink, #2f3733);
}
.trace-chip { cursor: pointer; min-height: 32px; }
.trace-chip[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px currentColor; }
.trace-badge-mark, .trace-mark { font-weight: 700; font-family: ui-monospace, Menlo, monospace; }
.trace-chip.trace-consistent, .trace-badge.trace-consistent { color: #2f6b4f; border-color: #b9d5c5; background: #edf5f0; }
.trace-chip.trace-contradiction, .trace-badge.trace-contradiction { color: #a23a2c; border-color: #e6bdb5; background: #fbeeeb; }
.trace-chip.trace-unverified, .trace-badge.trace-unverified { color: #6b6455; border-color: #ddd5c3; background: #f5f1e7; }
.trace-scope-btn { min-height: 32px; padding: 5px 12px; font-size: 13px; }
.trace-caveat { margin: 6px 0 0; font-size: 12.5px; color: var(--muted, #8a7f6d); }

/* 语句标记：颜色之外同时有符号和下划线样式，不只靠颜色区分 */
.trace-s { cursor: pointer; border-radius: 3px; padding: 1px 2px; text-decoration-line: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.trace-s:hover, .trace-s:focus-visible { background: var(--primary-soft, #f3e6dd); outline: none; }
.trace-s:focus-visible { box-shadow: 0 0 0 2px var(--primary, #a5523f); }
.trace-s.trace-consistent { text-decoration-color: #5a9a7a; text-decoration-style: solid; }
.trace-s.trace-contradiction { text-decoration-color: #c2523f; text-decoration-style: wavy; }
.trace-s.trace-unverified { text-decoration-color: #b7ad98; text-decoration-style: dotted; }
.trace-mark { display: inline-block; margin-right: 3px; font-size: .78em; vertical-align: 1px; }
.trace-consistent > .trace-mark { color: #2f6b4f; }
.trace-contradiction > .trace-mark { color: #a23a2c; }
.trace-unverified > .trace-mark { color: #8a7f6d; }
[data-trace-filter="consistent"] .trace-s:not(.trace-consistent),
[data-trace-filter="contradiction"] .trace-s:not(.trace-contradiction),
[data-trace-filter="unverified"] .trace-s:not(.trace-unverified) { opacity: .28; }

.trace-reading { margin-top: 6px; }
.trace-reading-list { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 4px; }
.trace-reading-item { font-size: 14.5px; line-height: 1.75; }
[data-trace-filter="consistent"] .trace-reading-item:not([data-status="consistent"]),
[data-trace-filter="contradiction"] .trace-reading-item:not([data-status="contradiction"]),
[data-trace-filter="unverified"] .trace-reading-item:not([data-status="unverified"]) { display: none; }

/* 依据面板 */
.trace-sheet { max-width: 640px; }
.trace-quote { margin: 4px 0 10px; padding: 10px 12px; border-left: 3px solid var(--primary, #a5523f); background: var(--primary-soft, #f3e6dd); border-radius: 0 6px 6px 0; font-size: 15px; line-height: 1.7; }
.trace-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.trace-empty { margin: 10px 0; font-size: 14px; color: var(--ink-soft, #5c6660); }
.trace-claim { margin: 8px 0; padding: 10px 12px; border: 1px solid var(--line, #e3dccd); border-radius: 8px; background: var(--card, #fffdf8); }
.trace-claim-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.trace-row { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 8px; padding: 3px 0; font-size: 13.5px; line-height: 1.6; }
.trace-row-label { color: var(--muted, #8a7f6d); }
.trace-value { overflow-wrap: anywhere; }
.trace-fold { margin-top: 4px; font-size: 13.5px; }
.trace-fold summary { cursor: pointer; color: var(--primary-deep, #8a4030); }
.trace-feedback { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line, #e3dccd); }
.trace-feedback-kinds { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0; }
.trace-kind, .trace-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; min-height: 32px; cursor: pointer; }
.trace-note { width: 100%; box-sizing: border-box; margin: 4px 0 8px; padding: 8px 10px; font: inherit; font-size: 14px; border: 1px solid var(--line, #e3dccd); border-radius: 6px; background: var(--card, #fffdf8); color: inherit; }
.trace-scope-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line, #e3dccd); cursor: pointer; }
.trace-scope-item input { margin-top: 4px; }
.trace-scope-text { display: grid; gap: 2px; font-size: 14px; }
.trace-scope-desc { display: block; font-size: 12.5px; color: var(--muted, #8a7f6d); }
.trace-version { font-size: 12.5px; color: var(--muted, #8a7f6d); }
.trace-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.trace-rule-list li { margin-bottom: 6px; }
@media (max-width: 480px) { .trace-row { grid-template-columns: 1fr; gap: 0; } }
@media (prefers-color-scheme: dark) {
  .trace-chip.trace-consistent, .trace-badge.trace-consistent { color: #9fd0b6; border-color: #3c5c4c; background: #1f2d27; }
  .trace-chip.trace-contradiction, .trace-badge.trace-contradiction { color: #f0a497; border-color: #6a3a33; background: #33211e; }
  .trace-chip.trace-unverified, .trace-badge.trace-unverified { color: #c9c0ad; border-color: #4d483d; background: #2a2823; }
  .trace-consistent > .trace-mark { color: #9fd0b6; } .trace-contradiction > .trace-mark { color: #f0a497; } .trace-unverified > .trace-mark { color: #c9c0ad; }
}

.trace-study-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.trace-claim > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }
.gloss-term { text-decoration: underline dotted; text-underline-offset: .22em; cursor: help; }
.gloss-term:focus-visible { outline: 2px solid var(--accent, #a5523f); outline-offset: 3px; }
.gloss-pop { position: absolute; z-index: 2000; padding: 1rem; border: 1px solid #bca995; border-radius: .65rem; background: var(--card, #fffaf2); color: var(--ink, #302f29); box-shadow: 0 6px 24px #0003; box-sizing: border-box; }
.gloss-pop p { margin: .6rem 0 0; line-height: 1.65; }
.gloss-list dt { font-weight: bold; margin-top: .8rem; }
.gloss-list dd { margin: .3rem 0 .8rem; line-height: 1.65; }
.guide-card { border: 1px solid #d5cabb; border-radius: .8rem; padding: 1rem; margin-bottom: 1.5rem; }
.guide-card summary { cursor: pointer; font-weight: bold; }
.guide-steps { padding-left: 1.5rem; }
.guide-steps li { margin: .75rem 0; }
.guide-steps strong,.guide-steps span { display: block; }
.trace-plain { opacity: .8; font-size: .9em; line-height: 1.65; margin-top: .3rem; }
.trace-reading-heading { display:flex; gap:1rem; flex-wrap:wrap; align-items:center; }
