/* 朕识人、朕知事：小注、识人卡、心事。新词带下划线和小金点，学会了就收起来。 */

/* ——小注：挂在词上—— */
.nt { cursor: help; border-radius: 2px; transition: background 0.15s; }
.nt:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.nt.fresh { text-decoration: underline dotted color-mix(in srgb, var(--zhu-bright) 70%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

/* 读数、灯、剑、钱袋子：本来就在那儿的东西，只加一枚小金点 */
[data-note] { cursor: help; }
.chip, .coin, .flames, .plaque, .p-kind { position: relative; }
[data-fresh]::after {
  content: ""; position: absolute; right: -2px; top: -2px; width: 7px; height: 7px; border-radius: 50%; pointer-events: none;
  background: var(--gold-bright); box-shadow: 0 0 0 2px rgba(11, 8, 6, 0.85), 0 0 8px rgba(242, 207, 122, 0.9);
  animation: ntDot 2.4s ease-in-out infinite;
}
.sword[data-fresh]::after { right: 4px; top: 0; }
.plaque[data-fresh]::after { right: 4px; top: 4px; }
@keyframes ntDot { 50% { transform: scale(0.7); opacity: 0.65; } }

/* ——小签—— */
.note-pop {
  position: fixed; z-index: 19; width: min(330px, calc(100vw - 20px)); padding: 12px 14px 12px; border-radius: 4px;
  background: linear-gradient(180deg, #241811, #150e0a); border: 1px solid var(--gold-dim); color: var(--text);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), inset 0 0 0 3px rgba(0, 0, 0, 0.3);
  font-size: 13.5px; line-height: 1.7; user-select: text; -webkit-user-select: text;
}
.note-pop::before { content: ""; position: absolute; left: var(--ax, 50%); width: 10px; height: 10px; margin-left: -5px; background: #221710; border: 1px solid var(--gold-dim); transform: rotate(45deg); }
.note-pop.below::before { top: -6px; border-right: 0; border-bottom: 0; }
.note-pop.above::before { bottom: -6px; border-left: 0; border-top: 0; background: #160f0a; }
.note-pop p { margin: 0; }
.np-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.np-head b { font: 400 20px/1.3 var(--f-brush); color: var(--gold-bright); letter-spacing: 0.1em; }
.np-now { font-weight: 600; color: var(--text); font-size: 14px; }
.np-now.warn { color: var(--zhu-bright); }
.np-w { color: #e2d4b8; }
.np-w.dim { color: var(--dim); font-size: 12.5px; margin-top: 2px; }
/* 今天的说法：小签顶上一行，正文里生词后面的括注 */
.np-today { margin: 0 0 6px; padding: 4px 8px; border-radius: 2px; background: rgba(201, 161, 74, 0.12); color: var(--gold-bright); font-size: 13px; }
.np-today em { margin-right: 8px; font-style: normal; font-size: 11.5px; color: var(--faint); letter-spacing: 0.1em; }
.nt-now { font-size: 0.88em; opacity: 0.72; }
.np-econ { margin-top: 6px !important; padding: 5px 8px; border-left: 2px solid var(--gold); background: rgba(201, 161, 74, 0.08); color: var(--gold-bright); font-size: 13px; }
.np-row { display: grid; grid-template-columns: 3.4em 1fr; gap: 6px; margin-top: 4px !important; font-size: 12.5px; }
.np-row em { font-style: normal; color: var(--faint); }
.np-row.up span { color: #9fc79a; }
.np-row.down span { color: #e6a090; }
.np-trend { display: grid; grid-template-columns: 4.4em 1fr; gap: 6px; margin-top: 6px !important; font-size: 12px; }
.np-trend em { font-style: normal; color: var(--faint); }
.np-trend i { font-style: normal; color: var(--dim); white-space: nowrap; }
.np-trend i.now { color: var(--text); font-weight: 600; }
.np-trend b { margin: 0 4px; color: var(--faint); font-weight: 400; }
.np-news { margin-top: 6px; padding: 4px 8px; border-left: 2px solid rgba(239, 228, 204, 0.18); font-size: 12px; color: var(--dim); }
.np-news em { display: block; font-style: normal; color: var(--faint); font-size: 11px; letter-spacing: 0.2em; }
.np-seen { margin-top: 6px !important; font-size: 12px; color: var(--faint); font-style: italic; }
.np-j { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px !important; padding-top: 8px; border-top: 1px dashed rgba(201, 161, 74, 0.25); color: #f0dcae; }
.np-j .jj-head { margin-top: 1px; }
.np-link { margin-top: 6px !important; text-align: right; }

/* ——群臣名册：派系一眼看得到，“识”翻识人卡—— */
.fac { display: inline-block; margin-right: 5px; padding: 0 4px; border-radius: 2px; font-style: normal; font-size: 10px; line-height: 15px; vertical-align: 1px; letter-spacing: 0.05em; background: rgba(239, 228, 204, 0.1); color: var(--dim); }
.fac.f-yd { background: rgba(179, 38, 30, 0.28); color: #f3b3a8; }
.fac.f-ql { background: rgba(111, 154, 138, 0.28); color: #b9dccd; }
.fac.f-nt { background: rgba(160, 130, 200, 0.24); color: #d7c6ee; }
.fac.f-yw { background: rgba(201, 161, 74, 0.26); color: var(--gold-bright); }
.fac.f-jw { background: rgba(220, 140, 60, 0.26); color: #f2c08a; }
.fac.f-gc { background: rgba(184, 190, 196, 0.16); color: var(--steel); }
.tok.off { opacity: 0.55; }
.tok.off:hover { background: rgba(239, 228, 204, 0.035); border-color: rgba(201, 161, 74, 0.14); }
.tok.gone.off { opacity: 0.3; }
.tok-i {
  position: absolute; right: 5px; bottom: 5px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid rgba(201, 161, 74, 0.45); background: rgba(11, 8, 6, 0.75); color: var(--gold); font: 11px/1 var(--f-serif);
  opacity: 0.75; transition: opacity 0.2s, transform 0.2s var(--spring), background 0.2s;
}
.tok:hover .tok-i, .tok-i:focus-visible { opacity: 1; }
.tok-i:hover { transform: scale(1.15); background: var(--zhu); color: #fff; border-color: var(--zhu-bright); }
.tok .tt { padding-right: 20px; }

/* ——奏本：署名点得开，按钮底下写后果—— */
.p-who { padding: 0 2px; border: 0; border-bottom: 1px dashed rgba(42, 30, 21, 0.45); background: transparent; color: #2a1e15; font: 600 15px var(--f-serif); margin-left: 4px; }
.p-who:hover { color: var(--zhu); border-bottom-color: var(--zhu); }

/* ——召对：名牌点得开识人卡—— */
.nameplate.can-know { cursor: pointer; }
.nameplate.can-know::after { content: "识"; align-self: center; margin-left: 2px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(242, 207, 122, 0.6); color: var(--gold-bright); font: 11px/1 var(--f-serif); }
.nameplate.can-know:hover { filter: brightness(1.12); }

/* ——识人卡—— */
.modal-wrap.dossier-wrap .modal-box { width: min(560px, 100%); perspective: 900px; }
.dossier { font-size: 14px; }
.ds-head { display: flex; gap: 14px; align-items: center; }
.ds-av { flex: none; width: 76px; height: 76px; border-radius: 50%; overflow: hidden; border: 2px solid var(--gold-dim); background: #1d140e; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); }
.ds-av img, .ds-av svg { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; display: block; }
.ds-av svg { transform: scale(1.9) translateY(18%); }
.ds-av img.av-own { object-position: 50% 50%; }
.ds-id { min-width: 0; }
.ds-id h3 { margin: 0; font: 400 30px/1.2 var(--f-brush); color: var(--gold-bright); letter-spacing: 0.1em; }
.ds-status { margin-left: 10px; padding: 1px 8px; font: 12px var(--f-serif); letter-spacing: 0.1em; border-radius: 2px; background: rgba(179, 38, 30, 0.3); color: #ffd2c8; vertical-align: 6px; }
.ds-title { margin: 2px 0 4px; color: var(--dim); font-size: 13px; line-height: 1.5; }
.ds-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; font-size: 12px; color: var(--dim); }
.ds-tags .fac { font-size: 11.5px; line-height: 18px; padding: 0 6px; }
.ds-dress { color: var(--paper, #efe4cc); opacity: 0.85; }
.ds-favor { padding: 0 6px; border: 1px solid rgba(201, 161, 74, 0.4); border-radius: 2px; color: var(--gold-bright); }
.ds-post { margin: 14px 0 0; padding: 8px 12px; border-left: 3px solid var(--gold-dim); background: rgba(239, 228, 204, 0.04); color: #e2d4b8; line-height: 1.7; }
.ds-post em, .ds-ug em, .ds-party em { display: inline-block; margin-right: 8px; font-style: normal; font-size: 12px; color: var(--faint); letter-spacing: 0.15em; }
.ds-view { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; padding: 10px 12px; border-radius: 3px; background: linear-gradient(180deg, rgba(122, 23, 18, 0.32), rgba(122, 23, 18, 0.14)); border: 1px solid rgba(215, 57, 47, 0.25); }
.ds-view p { margin: 0; color: #f6e4bd; line-height: 1.75; }
.ds-ug { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.ds-ug p { margin: 0; padding: 6px 10px; border-radius: 2px; background: rgba(239, 228, 204, 0.04); line-height: 1.6; }
.ds-ug em { display: block; margin: 0 0 2px; }
.dossier h4 { margin: 16px 0 6px !important; font-size: 16px !important; }
.dossier h4 small { margin-left: 8px; font: 11px var(--f-serif); color: var(--faint); letter-spacing: 0.05em; }
.ds-rels { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; }
.ds-rel em { margin-right: 4px; font-style: normal; font-size: 12px; color: var(--faint); }
.ds-rel.foe em { color: #e6a090; }
.ds-who { padding: 0 2px; border: 0; border-bottom: 1px dashed rgba(201, 161, 74, 0.5); background: transparent; color: var(--text); font-weight: 600; }
.ds-who:hover { color: var(--gold-bright); border-bottom-color: var(--gold-bright); }
.ds-who small { font-weight: 400; color: var(--dim); }
.ds-party { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.ds-asks ul, .ds-last ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ds-ask { width: 100%; text-align: left; padding: 7px 10px; border: 1px solid rgba(201, 161, 74, 0.18); border-radius: 3px; background: rgba(239, 228, 204, 0.035); line-height: 1.6; transition: border-color 0.2s, background 0.2s; }
.ds-ask:hover:not([data-done]) { border-color: rgba(215, 57, 47, 0.55); background: rgba(179, 38, 30, 0.14); }
.ds-ask[data-done] { opacity: 0.6; cursor: default; }
.ds-ask b { font-weight: 600; color: var(--paper); }
.ds-ask span { display: block; font-size: 12.5px; color: var(--dim); }
.ds-ask small { margin-left: 6px; font-size: 11px; color: var(--faint); }
.ds-money { margin-left: 6px; font-style: normal; font-size: 12px; padding: 0 5px; border-radius: 2px; }
.ds-money.down { background: rgba(179, 38, 30, 0.25); color: #f3b3a8; }
.ds-money.up { background: rgba(80, 140, 90, 0.25); color: #b5dcb0; }
.ds-last li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; border-bottom: 1px dashed rgba(239, 228, 204, 0.08); }
.ds-last li em { flex: none; font-style: normal; color: var(--gold); font-size: 12px; }
.ds-cards { margin: 12px 0 0; padding: 6px 10px; border-left: 3px solid #5a3a78; background: rgba(60, 30, 80, 0.25); color: #d7c6ee; font-size: 13px; }

.ds-log ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ds-log li { display: flex; gap: 10px; font-size: 13px; line-height: 1.6; padding: 2px 0; }
.ds-log li em { flex: none; width: 4.5em; font-style: normal; color: var(--faint); font-size: 12px; }
.ds-log li span { color: #e2d4b8; }

/* ——召对：传召时朕先想一想；话头点一下填进对话框—— */
.ld-brief { display: flex; gap: 10px; align-items: flex-start; max-width: min(520px, 86vw); margin: 0; padding: 10px 14px; border: 1px solid rgba(215, 57, 47, 0.25); border-radius: 3px; background: rgba(122, 23, 18, 0.22); color: #f0dfb8; letter-spacing: 0.04em; line-height: 1.75; font-size: 14px; }
.aud-openers { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.aud-openers em { font-style: normal; font-size: 12px; color: var(--faint); letter-spacing: 0.15em; margin-right: 2px; }
.ao-q { padding: 3px 10px; border: 1px solid rgba(201, 161, 74, 0.35); border-radius: 999px; background: rgba(239, 228, 204, 0.05); color: #e9d6a8; font-size: 13px; line-height: 1.5; text-align: left; transition: border-color 0.15s, background 0.15s; }
.ao-q:hover { border-color: var(--gold-bright); background: rgba(201, 161, 74, 0.14); }

/* ——降旨的常见写法、密查的线索—— */
.ed-tpls, .inv-clues { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.inv-clues { justify-content: center; max-width: min(680px, 94vw); }
.ed-tpls em, .inv-clues em { font-style: normal; font-size: 12px; color: var(--faint); letter-spacing: 0.15em; margin-right: 2px; }
.tpl { padding: 3px 12px; border: 1px solid rgba(201, 161, 74, 0.35); border-radius: 999px; background: rgba(0, 0, 0, 0.3); color: #e9d6a8; font-size: 13px; transition: border-color 0.15s, background 0.15s, transform 0.15s var(--spring); }
.tpl:hover { border-color: var(--gold-bright); background: rgba(201, 161, 74, 0.14); transform: translateY(-1px); }
.tpl.lev { border-color: rgba(150, 110, 200, 0.5); color: #d7c6ee; }
.tpl.on { border-color: var(--zhu-bright); background: rgba(179, 38, 30, 0.25); }
.tpl-hint { margin-left: 6px; font-size: 12px; color: var(--dim); }

/* ——朕的心事：御案空着时的小笺，章节卡末尾也亮一下—— */
.desk-empty { justify-content: flex-start; padding-top: clamp(16px, 5vh, 50px); }
.desk-empty:has(.agenda) .desk-empty-seal { width: 84px; height: 84px; font-size: 30px; border-width: 3px; }
.desk-empty:has(.agenda) > p { margin: 0; }
.agenda-slot { width: min(520px, calc(100% - 32px)); pointer-events: auto; }
.agenda {
  position: relative; padding: 14px 18px 12px; border-radius: 3px; color: var(--paper-ink); text-align: left;
  background: linear-gradient(180deg, rgba(243, 233, 210, 0.97), rgba(232, 217, 184, 0.97));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), inset 0 0 40px rgba(130, 90, 40, 0.18); transform: rotate(-0.4deg);
}
.agenda::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(179, 38, 30, 0.2); pointer-events: none; }
.agenda h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font: 400 20px/1.2 var(--f-brush); color: var(--zhu); letter-spacing: 0.2em; }
.agenda ol { margin: 0; padding: 0; list-style: none; counter-reset: ag; display: flex; flex-direction: column; gap: 8px; }
.agenda li { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 0 0 8px 22px; border-bottom: 1px dashed rgba(42, 30, 21, 0.15); counter-increment: ag; }
.agenda li:last-child { border-bottom: 0; padding-bottom: 2px; }
.agenda li::before { content: counter(ag, cjk-ideographic); position: absolute; left: 0; top: 1px; font: 14px var(--f-brush); color: var(--zhu); }
.ag-t { flex: 1 1 260px; font-size: 14.5px; line-height: 1.7; color: #2a1e15; }
.ag-go { flex: none; margin-left: auto; padding: 2px 10px; border: 1px solid rgba(179, 38, 30, 0.45); border-radius: 999px; background: rgba(255, 255, 255, 0.35); color: var(--zhu); font-size: 12.5px; letter-spacing: 0.05em; transition: background 0.15s, transform 0.15s var(--spring); }
.ag-go:hover { background: rgba(179, 38, 30, 0.12); transform: translateX(2px); }
.ag-tip { margin: 8px 0 0; font-size: 12px; color: #8a7458; }
.ag-sit { margin: 0 0 10px; padding: 0 0 8px; border-bottom: 1px solid rgba(179, 38, 30, 0.18); font-size: 13.5px; line-height: 1.75; color: #4a3826; }
.ag-sit em { margin-right: 8px; padding: 0 5px; border: 1px solid rgba(179, 38, 30, 0.4); border-radius: 2px; font-style: normal; font-size: 11.5px; color: var(--zhu); letter-spacing: 0.1em; }
.ch-agenda { width: min(640px, 100%); }
.agenda.still { transform: none; }

/* ——朝局图：各派各占一角，朕在当中—— */
.modal-wrap.chart-wrap .modal-box { width: min(1080px, 100%); }
.chart h3 { margin: 0 0 6px !important; text-align: center; }
.cm-sit { display: flex; gap: 10px; align-items: flex-start; margin: 0 auto 8px; max-width: 46em; color: #e2d4b8; font-size: 13.5px; line-height: 1.7; }
.cm-scroll { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
.cm-map { position: relative; width: min(100%, calc((100vh - 250px) * 1.47)); min-width: 640px; margin: 0 auto; aspect-ratio: 1000 / 680; border-radius: 4px; background: radial-gradient(ellipse at 50% 48%, rgba(122, 23, 18, 0.18), rgba(0, 0, 0, 0) 60%), rgba(239, 228, 204, 0.025); }
.cm-map svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cm-l path { fill: none; stroke: rgba(201, 161, 74, 0.45); stroke-width: 1.6; vector-effect: non-scaling-stroke; transition: stroke 0.2s, opacity 0.2s; }
.cm-l.foe path { stroke: rgba(215, 57, 47, 0.55); stroke-dasharray: 6 5; }
.cm-l text { font: 13px var(--f-serif); fill: var(--gold-bright); text-anchor: middle; dominant-baseline: middle; paint-order: stroke; stroke: #120c08; stroke-width: 4px; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.cm-l.foe text { fill: #f3b3a8; }
.cm-map.focus .cm-l { opacity: 0.12; }
.cm-map.focus .cm-l.hl { opacity: 1; }
.cm-map.focus .cm-l.hl path { stroke-width: 2.4; }
.cm-l.hl text { opacity: 1; }
.cm-seat { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; }
.cm-seat span { font: 18px var(--f-brush); color: var(--zhu-bright); letter-spacing: 0.2em; }
.cm-camp { position: absolute; transform: translate(-50%, -50%); padding: 1px 10px; border-radius: 999px; font-size: 13px; letter-spacing: 0.2em; white-space: nowrap; background: rgba(239, 228, 204, 0.08); color: var(--dim); }
.cm-camp.f-yd { background: rgba(179, 38, 30, 0.3); color: #f3b3a8; }
.cm-camp.f-ql { background: rgba(111, 154, 138, 0.3); color: #b9dccd; }
.cm-camp.f-nt { background: rgba(160, 130, 200, 0.26); color: #d7c6ee; }
.cm-camp.f-yw { background: rgba(201, 161, 74, 0.28); color: var(--gold-bright); }
.cm-camp.f-jw { background: rgba(220, 140, 60, 0.28); color: #f2c08a; }
.cm-n { position: absolute; transform: translate(-50%, -50%); width: 7.2%; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 0; border: 0; background: transparent; color: var(--text); transition: opacity 0.2s, transform 0.2s var(--spring); }
.cm-n:hover, .cm-n:focus-visible { transform: translate(-50%, -50%) scale(1.08); z-index: 2; }
.cm-av { display: block; width: 68%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 2px solid rgba(184, 190, 196, 0.5); background: #1a120c; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); }
.cm-av img, .cm-av svg { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.cm-av.f-yd { border-color: #c4473c; }
.cm-av.f-ql { border-color: #6f9a8a; }
.cm-av.f-nt { border-color: #9a82c8; }
.cm-av.f-yw { border-color: var(--gold); }
.cm-av.f-jw { border-color: #d88c3c; }
.cm-n b { font-size: 12.5px; font-weight: 600; white-space: nowrap; text-shadow: 0 1px 3px #000; }
.cm-n small { margin-top: -1px; padding: 0 4px; border-radius: 2px; font-size: 10px; line-height: 14px; background: rgba(179, 38, 30, 0.45); color: #f6e4bd; white-space: nowrap; }
.cm-n.gone { opacity: 0.45; filter: grayscale(0.8); }
.cm-n.gone small { background: rgba(80, 80, 80, 0.6); }
.cm-n.spare { opacity: 0.75; filter: grayscale(0.35); }
.cm-n.spare small { background: rgba(80, 110, 90, 0.6); }
.cm-map.focus .cm-n:not(.hl) { opacity: 0.3; }
.cm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 10px 0 0; font-size: 12px; color: var(--dim); }
.cm-legend em { margin-left: auto; font-style: normal; color: var(--faint); }
.lg-tie, .lg-foe { display: inline-block; width: 26px; height: 0; border-top: 2px solid rgba(201, 161, 74, 0.6); }
.lg-foe { margin-left: 8px; border-top: 2px dashed rgba(215, 57, 47, 0.7); }

/* ——设置：小注—— */
.set-row select { padding: 4px 8px; border: 1px solid rgba(201, 161, 74, 0.35); border-radius: 2px; background: rgba(0, 0, 0, 0.35); color: var(--text); font: inherit; font-size: 13px; }

@media (max-width: 860px) {
  .desk-empty { padding-top: 10px; gap: 10px; }
  .desk-empty:has(.agenda) .desk-empty-seal, .desk-empty:has(.agenda) > p { display: none; }
  .agenda-slot { width: calc(100% - 20px); }
  .agenda { padding: 12px 14px 10px; }
  .ag-t { font-size: 14px; }
  .ds-ug { grid-template-columns: 1fr; }
  .ds-av { width: 60px; height: 60px; }
  .ds-id h3 { font-size: 24px; }
}
