/* 江湖錄（features/codex，web/codex.js）：俠客頁「江湖錄」那一頁。只用 style.css 的色票；深色模式跟著色票走，圖壓暗一點 */
.cx-seg { display: flex; gap: 3px; padding: 3px; margin: 0 0 12px; background: var(--card-2); border-radius: 12px; }
.cx-seg button { position: relative; flex: 1; min-height: 44px; border: 0; border-radius: 9px; background: transparent; font: 700 16px var(--kai); letter-spacing: .12em; color: var(--ink-2); }
.cx-seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.cx-seg .dot, .cx-chips .dot, .cx-qy .dot, .cx-cell .dot, .cx-yc .dot, .cx-sec .dot { position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.cx-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; position: relative; margin: 16px 0 8px; padding-left: 8px; border-left: 3px solid var(--ink);
  font: 700 16px/1.3 var(--kai); letter-spacing: .12em; }
.cx-sec small { font: 400 12px var(--sans); letter-spacing: 0; color: var(--ink-2); margin-right: 18px; }
.cx-empty { margin: 8px 0; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; font: 400 15px/1.7 var(--kai); color: var(--ink-2); }

/* 一件奇遇（列表的一行） */
.cx-qy { position: relative; display: flex; gap: 10px; align-items: stretch; width: 100%; min-height: 76px; margin: 0 0 8px; padding: 8px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); color: var(--ink); font: inherit; }
.cx-qy .th { flex: none; width: 66px; border-radius: 8px; overflow: hidden; background: var(--card-2); display: grid; place-items: center; }
.cx-qy .th img { width: 100%; height: 100%; object-fit: cover; }
.cx-qy .sil { font: 700 22px var(--kai); color: var(--ink-2); opacity: .6; }
.cx-qy .bd { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.cx-qy .nm { font: 700 17px/1.3 var(--kai); }
.cx-qy .nm em { margin-left: 6px; font: 400 12px var(--sans); font-style: normal; color: var(--ink-2); }
.cx-qy .nx { font-size: 13px; line-height: 1.45; color: var(--ink); }
.cx-qy .nx b { color: var(--accent); }
.cx-qy .lf { font-size: 12px; color: var(--ink-2); }
.cx-qy .go { align-self: center; padding: 0 2px; font-size: 20px; color: var(--ink-2); }
.cx-qy.done .nx { color: var(--ink-2); }
.cx-ghosts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cx-ghost { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 6px 4px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; }
.cx-ghost b { font: 700 15px var(--kai); letter-spacing: .12em; color: var(--ink-2); opacity: .75; }
.cx-ghost small { font-size: 12px; line-height: 1.3; color: var(--ink-2); overflow-wrap: anywhere; }
.cx-qy.ghost { background: transparent; border-style: dashed; box-shadow: none; min-height: 60px; }
.cx-qy.ghost .th { background: color-mix(in srgb, var(--line) 70%, var(--card)); }
.cx-qy.ghost .nm, .cx-qy.ghost .nx { color: var(--ink-2); }
.cx-pip { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
/* 幕的進度：一截一截的墨痕（Joy 2026-11-22「很討厭 ooo 的進度呈現方式，看起來很廉價」：全遊戲不用小圓圈排進度） */
.cx-pip i { width: 14px; height: 4px; border-radius: 1px 3px 3px 1px; background: color-mix(in srgb, var(--ink-2) 26%, transparent); transform: skewX(-18deg); }
.cx-pip i.f { background: var(--ink); }
.cx-pip i.c { background: var(--accent); }

/* 朱印 */
.cx-seal { display: inline-grid; place-items: center; padding: 2px 5px; border: 2px solid var(--accent); border-radius: 4px; transform: rotate(-4deg);
  font: 700 12px/1.1 var(--kai); color: var(--accent); background: var(--card); white-space: nowrap; }
.cx-seal.solid { background: var(--accent); color: var(--accent-ink); }

/* 一件奇遇（點進去） */
.cx-back { min-height: 44px; padding: 0 4px; border: 0; background: none; font: 700 15px var(--kai); color: var(--ink-2); letter-spacing: .06em; }
.cx-hero { position: relative; height: 168px; margin: 0 0 12px; border-radius: 12px; overflow: hidden; background: var(--card-2); }
.cx-hero.short { height: 130px; }
.cx-hero img { width: 100%; height: 100%; object-fit: cover; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.cx-plaque { position: absolute; top: 10px; right: 10px; writing-mode: vertical-rl; padding: 10px 6px; border: 2px solid #b7862b; border-radius: 4px;
  background: #5a3b22; color: #f1d9a4; font: 700 17px/1 var(--kai); letter-spacing: .2em; }
.cx-hero-l { position: absolute; left: 10px; right: 64px; bottom: 8px; display: flex; align-items: center; gap: 8px; }
.cx-hero-l i { min-width: 0; font: 400 14px/1.35 var(--kai); font-style: normal; color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cx-now { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; padding: 10px 12px; background: var(--card); border: 1.5px solid var(--accent); border-radius: 12px; }
.cx-now .k { font: 700 12px var(--sans); letter-spacing: .08em; color: var(--accent); }
.cx-now .w { font: 700 17px/1.4 var(--kai); }
.cx-now .t { font-size: 13px; color: var(--ink-2); }
.cx-now .btn, .cx-stay + .btn { min-height: 44px; }
.cx-stay { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 8px; padding: 10px 12px; background: var(--card-2); border-radius: 12px; }
.cx-stay .por { flex: none; width: 60px; height: 60px; border-radius: 50%; overflow: hidden; border: 2px solid var(--gold); background: var(--card); }
.cx-stay .por img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.cx-stay b { font: 700 18px var(--kai); }
.cx-stay p { margin: 2px 0; font: 700 14px/1.55 var(--kai); }
.cx-stay small { display: block; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.cx-stay + .btn { width: 100%; margin: 0 0 4px; }
.cx-acts { position: relative; padding-left: 18px; }
.cx-acts::before { content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; border-left: 2px dotted var(--line); }
.cx-act { position: relative; display: flex; gap: 8px; align-items: center; width: 100%; min-height: 56px; padding: 6px 0; border: 0; border-bottom: 1px dashed var(--line);
  background: none; text-align: left; font: inherit; color: var(--ink); }
.cx-act:last-child { border-bottom: 0; }
.cx-act::before { content: ""; position: absolute; left: -17px; top: 50%; margin-top: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); }
.cx-act.cur::before { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.cx-act .n { flex: none; width: 40px; font: 700 12px var(--kai); color: var(--ink-2); }
.cx-act .x { flex: 1; min-width: 0; }
.cx-act .x b { display: block; font: 700 15px var(--kai); }
.cx-act .x small { display: block; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.cx-act .x q { quotes: none; color: var(--ink); }
.cx-act .r { flex: none; font-size: 13px; color: var(--kuai); }
.cx-ends { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cx-end { position: relative; display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 3 / 4; max-width: 100%; padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); font: inherit; color: var(--ink); }
.cx-end img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cx-end span { position: relative; padding: 4px 2px; text-align: center; font: 700 13px/1.2 var(--kai); background: color-mix(in srgb, var(--card) 82%, transparent); }
/* 還沒走到的收法：暈了墨、還沒題字的箋，右上一方空印 */
.cx-end.off { border-color: color-mix(in srgb, var(--ink-2) 35%, var(--line));
  background: radial-gradient(62% 44% at 36% 38%, color-mix(in srgb, var(--ink) 17%, transparent), transparent 72%),
    radial-gradient(44% 32% at 68% 60%, color-mix(in srgb, var(--ink) 12%, transparent), transparent 74%),
    radial-gradient(30% 20% at 50% 84%, color-mix(in srgb, var(--ink) 8%, transparent), transparent 76%),
    color-mix(in srgb, var(--line) 30%, var(--card)); }
.cx-end.off em { position: absolute; inset: 0 0 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font: 700 21px/1.1 var(--kai); font-style: normal; color: color-mix(in srgb, var(--ink) 42%, transparent); }
.cx-end.off em i { font-style: normal; }
.cx-end.off::after { content: ""; position: absolute; top: 6px; right: 6px; width: 13px; height: 13px; border: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 3px; transform: rotate(-6deg); }
.cx-end.off span { background: transparent; color: var(--ink-2); font-weight: 400; font-size: 12px; }

.cx-endmore { margin: 0 0 6px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; font: 400 15px/1.6 var(--kai); letter-spacing: .04em; color: var(--ink-2); }

/* 重讀一幕 */
.cx-paper { position: relative; padding: 14px 14px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; font: 400 16px/1.9 var(--kai); }
.cx-paper h4 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; font: 700 19px/1.3 var(--kai); letter-spacing: .14em; }
.cx-paper p { margin: 0 0 10px; }
.cx-pick { margin: 6px 0 10px; padding: 6px 10px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); font-weight: 700; }
.cx-pick small { display: block; font: 700 11px var(--sans); letter-spacing: .1em; color: var(--accent); }
.cx-paper .cx-unpick { padding-top: 8px; border-top: 1px dashed var(--line); font: 13px/1.6 var(--sans); color: var(--ink-2); }

/* 圖鑑 */
.cx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.cx-chips button { position: relative; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); font: 600 14px var(--sans); color: var(--ink-2); }
.cx-chips.cats button { font: 700 15px var(--kai); letter-spacing: .1em; }
.cx-chips.grp { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cx-chips.grp button { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 48px; padding: 2px 4px; border-radius: 12px; font: 700 14px/1.2 var(--kai); }
.cx-chips.grp small { font: 400 11px var(--sans); color: var(--ink-2); }
.cx-chips button.on { border-color: var(--ink); background: var(--card-2); color: var(--ink); }
.cx-chips button .dot { top: 4px; right: 4px; }
.cx-count { display: flex; align-items: baseline; gap: 4px; }
.cx-count b { font: 700 24px/1 var(--serif); }
.cx-count small { font-size: 13px; color: var(--ink-2); }
.cx-bar { height: 6px; margin: 6px 0 12px; border-radius: 3px; background: var(--card-2); overflow: hidden; }
.cx-bar i { display: block; height: 100%; background: var(--gold); }
.cx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cx-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 8px 4px 6px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.cx-cell .im { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; overflow: hidden; background: var(--card-2); }
.cx-cell .im img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.cx-cell b { max-width: 100%; font: 700 14px/1.25 var(--kai); text-align: center; overflow-wrap: anywhere; }
.cx-cell small { max-width: 100%; font-size: 11px; color: var(--ink-2); text-align: center; overflow-wrap: anywhere; }
.cx-cell.off { background: transparent; border-style: dashed; }
.cx-cell.off .im { background: color-mix(in srgb, var(--line) 70%, var(--card)); }
.cx-cell.off .im::after { content: ""; width: 34px; height: 44px; border-radius: 17px 17px 6px 6px; background: color-mix(in srgb, var(--ink-2) 35%, transparent); }
.cx-cell.off b { color: var(--ink-2); }
.cx-grid.sq .im { border-radius: 10px; }
.cx-grid.sq .im img { object-fit: contain; object-position: center; }
.cx-grid.sq .cx-cell.off .im::after { width: 40px; height: 30px; border-radius: 6px; }
.cx-cell .glyph { font: 700 30px var(--kai); color: var(--ink-2); }
.cx-ygrid { display: grid; grid-template-columns: 28px repeat(4, minmax(0, 1fr)); gap: 4px; margin: 0 0 12px; }
.cx-ygrid .h { align-self: center; text-align: center; font: 700 14px var(--kai); color: var(--ink-2); }
.cx-yc { position: relative; display: grid; place-items: center; min-height: 44px; padding: 2px; border: 1px dashed var(--line); border-radius: 8px; text-align: center;
  font: 700 13px/1.2 var(--kai); color: var(--ink-2); overflow-wrap: anywhere; }
.cx-yc.on { --c: var(--kuai); border: 1.5px solid var(--c); background: color-mix(in srgb, var(--c) 14%, var(--card)); color: var(--c); }
.cx-yc.on.gang { --c: var(--gang); } .cx-yc.on.kuai { --c: var(--kuai); } .cx-yc.on.rou { --c: var(--rou); } .cx-yc.on.man { --c: var(--man); }
.cx-yc .dot { top: 2px; right: 2px; }
.cx-kv { display: flex; gap: 10px; align-items: center; margin: 0 0 8px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.cx-kv b { font: 700 17px var(--kai); }
.cx-kv small { display: block; font-size: 12px; color: var(--ink-2); }

@media (prefers-color-scheme: dark) {
  .cx-hero img, .cx-qy .th img, .cx-end img, .cx-stay .por img { filter: brightness(.78) saturate(.85); }
}

/* 江湖頁「進行中」（Config.codex.tracker）：狀態列底下一行＋右邊一顆印記；點印記從底下拉起全部 */
.cx-track { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.cx-tk-main { flex: 1; min-width: 0; min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 6px 10px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; color: var(--ink); font: inherit; box-shadow: var(--shadow); }
.cx-tk-tag { flex: none; padding: 2px 4px; border: 1.5px solid var(--accent); border-radius: 4px; color: var(--accent); font: 700 11px/1.1 var(--kai); transform: rotate(-4deg); background: var(--card); }
.cx-tk-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cx-tk-t b { font: 700 15px/1.3 var(--kai); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-tk-t small { font-size: 12px; line-height: 1.4; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-tk-all { position: relative; flex: none; width: 48px; height: 48px; display: grid; place-items: center; border: 2px solid var(--accent); border-radius: 6px;
  background: var(--card); color: var(--accent); font: 700 16px/1 var(--kai); transform: rotate(-4deg); }
.cx-tk-all em { position: absolute; top: -8px; right: -8px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--ink-2); color: var(--paper);
  font: 700 12px/20px var(--sans); font-style: normal; text-align: center; transform: rotate(4deg); }
.cx-tk-all em.new { background: var(--accent); color: var(--accent-ink); }
.cx-tk-sheet h3 { font: 700 18px var(--kai); letter-spacing: .14em; margin: 0; }
.cx-tk-row { display: flex; align-items: center; gap: 8px; min-height: 56px; border-bottom: 1px dashed var(--line); }
.cx-tk-row:last-child { border-bottom: 0; }
.cx-tk-pin { flex: none; width: 32px; min-height: 44px; border: 0; background: transparent; color: var(--line); font-size: 14px; }
.cx-tk-pin.on { color: var(--gold, var(--accent)); }
.cx-tk-go { flex: none; min-width: 48px; min-height: 44px; border: 1px solid var(--accent); border-radius: 10px; background: transparent; color: var(--accent); font: 700 16px var(--kai); }
.cx-tk-more { margin: 10px 0 0; text-align: center; }
.cx-tk-more .linkish { min-height: 44px; font: 700 15px var(--kai); letter-spacing: .08em; }
.cx-tk-main.idle { border-left-color: var(--line); }
.cx-tk-main.idle .cx-tk-tag { border-color: var(--ink-2); color: var(--ink-2); }
.cx-tk-waits { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; margin-top: 6px; padding: 0 4px; border: 0; border-top: 1px solid var(--line);
  background: transparent; color: var(--ink-2); font: 700 14px var(--kai); letter-spacing: .08em; }
.cx-tk-row.wait { padding-left: 40px; opacity: .78; }
.cx-tk-row.wait .cx-tk-tag { border-color: var(--ink-2); color: var(--ink-2); }
.cx-tk-none { margin: 8px 0; color: var(--ink-2); font: 400 14px/1.6 var(--kai); }
.cx-act.lost .x small { color: var(--ink-2); }

/* 本週卡收起來時「進行中」上面那一條細的兩軍態勢（Joy 11/13）：一行，左官右黃，點了拉起這一季在打什麼 */
.cx-tug { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; margin: 0 0 4px; padding: 0 4px; border: 0; background: none; color: var(--ink-2); font: inherit; text-align: left; cursor: pointer; }
.cx-tug-bar { position: relative; flex: 1 1 auto; height: 6px; border-radius: 3px; background: var(--gold); }
.cx-tug-bar > i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 3px 0 0 3px; background: var(--kuai); }
.cx-tug-bar > u { position: absolute; top: -4px; width: 3px; height: 14px; margin-left: -1.5px; background: var(--card); border: 1px solid var(--ink); border-radius: 2px; }
.cx-tug > b { flex: none; font: 700 14px var(--kai, var(--serif)); color: var(--ink); }
.cx-tug > b.side-guan { color: var(--kuai); }
.cx-tug > b.side-huang { color: var(--gold); }
.cx-tug-go { flex: none; color: var(--ink-2); }
.cx-tug-end { flex: none; margin: 0 -4px; font: 700 13px var(--kai, var(--serif)); font-variant-numeric: tabular-nums; }
.cx-tug-end.side-guan { color: var(--kuai); }
.cx-tug-end.side-huang { color: var(--gold); }

/* 收滿這一頁給的頭銜（數字那一行右邊）：還沒拿到是淡的、寫「收滿得」；拿到了是朱印、寫「已得」 */
.cx-ttl { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-family: var(--kai, var(--serif)); }
.cx-ttl small { font-size: 12px; color: var(--ink-2); }
.cx-ttl:not(.got) .ttl-seal { opacity: 0.45; border-style: dashed; }

/* 圖鑑沒解鎖的格（Joy 11/22：不放「？」，畫成有質感的佔位）：暈了墨的底，淡楷書兩個字（人物照舊剪影＋地名，名字寫「未見」） */
.cx-cell.off .im, .cx-yc.off { background:
    radial-gradient(60% 46% at 38% 40%, color-mix(in srgb, var(--ink) 16%, transparent), transparent 72%),
    radial-gradient(42% 32% at 66% 62%, color-mix(in srgb, var(--ink) 11%, transparent), transparent 74%),
    color-mix(in srgb, var(--line) 30%, var(--card)); }
.cx-grid.sq .cx-cell.off .im::after { content: none; }
.cx-cell.off b { font-weight: 400; letter-spacing: .2em; color: color-mix(in srgb, var(--ink) 45%, transparent); }
.cx-cell.off small { min-height: 1em; }
.cx-yc.off { border: 1px solid color-mix(in srgb, var(--ink-2) 30%, var(--line)); font-weight: 400; letter-spacing: .15em; color: color-mix(in srgb, var(--ink) 40%, transparent); }
.cx-yc.none { border: 0; }
.cx-act .x b.off { font-weight: 400; letter-spacing: .2em; color: color-mix(in srgb, var(--ink) 45%, transparent); }
