/* codex page */
.cx-root { position: absolute; inset: 0; }
.cx-gridview, .cx-detview { position: absolute; inset: 0; }
.cx-gridview { display: flex; flex-direction: column; gap: 8px; }
.cx-top { display: flex; align-items: center; gap: 10px; height: 62px; flex: none; }
.cx-seg { flex: none; gap: 2px; padding: 4px; }
.cx-seg button { min-width: 0; padding: 0 10px; font-size: 17px; white-space: nowrap; }
.cx-search { flex: 1; min-width: 100px; width: auto; }
.cx-count { flex: none; font-size: 17px; font-weight: 900; color: var(--ink); background: rgba(255, 247, 238, .8); border: 2px solid var(--gold); border-radius: 20px; padding: 6px 12px; color: #5b2d63; white-space: nowrap; }
.cx-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px 4px; align-content: start; padding: 4px 2px 20px; }
.cx-cell { background: transparent; border: 0; padding: 4px 2px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; min-height: 80px; }
.cx-cell:hover, .cx-cell.kfocus { background: rgba(255, 255, 255, .55); box-shadow: 0 0 0 3px var(--gold), 0 0 14px rgba(255, 215, 150, .9); }
.cx-cell:active { transform: scale(.95); }
.cx-thumb { position: relative; }
.cx-cell.unseen .tcard { filter: brightness(.82) saturate(.6); }
.cx-q { position: absolute; right: -4px; top: -6px; width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, var(--lav)); border: 2px solid var(--gold); color: var(--plum); font-weight: 900; font-size: 18px; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 10px rgba(255, 240, 200, .9); animation: cxTw 2s ease-in-out infinite; }
.cx-heart { position: absolute; left: -2px; bottom: -4px; font-size: 24px; color: #ff6fa0; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 2px 0 #fff; }
.cx-name { font-size: 17px; font-weight: 800; line-height: 1.15; text-align: center; max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink); text-shadow: 0 0 4px rgba(255, 255, 255, .9); }
body.night .cx-name { text-shadow: 0 0 4px rgba(20, 10, 40, .9); }
.cx-empty { grid-column: 1 / -1; text-align: center; padding: 60px 0; font-size: 22px; font-weight: 800; color: var(--ink); }
@keyframes cxTw { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.15); opacity: 1; } }

.cx-detview { display: flex; gap: 14px; }
.cx-detview.slide, .cx-gridview.slide { animation: cxIn .3s cubic-bezier(.3, 1.4, .5, 1) both; }
.cx-detview.swap .cx-panel { animation: cxSwap .25s ease-out both; }
@keyframes cxIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes cxSwap { from { opacity: .3; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.cx-left { width: 226px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 2px; }
.cx-cardbox { width: 200px; height: 300px; flex: none; filter: drop-shadow(0 8px 14px rgba(91, 45, 99, .35)); }
.cx-rseg { flex: none; }
.cx-rseg button { min-width: 90px; }
.cx-nav { display: flex; gap: 12px; }
.cx-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 456px; }
.cx-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: -8px; flex: none; }
.cx-title { font-size: 30px; font-weight: 900; color: var(--plum); line-height: 1.15; }
.cx-back { flex: none; width: 56px; height: 56px; }
.cx-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 6px; flex: none; }
.cx-chip { padding: 4px 14px; border-radius: 18px; background: linear-gradient(180deg, #efe4ff, #d7c4f5); border: 2px solid var(--lav-d); color: var(--plum); font-size: 17px; font-weight: 800; }
.cx-body { flex: 1; min-height: 0; padding-right: 4px; }
.cx-kw, .cx-sec { margin-bottom: 12px; }
.cx-sec-t { font-size: 19px; font-weight: 900; color: var(--lav-d); margin: 4px 0; }
.cx-sec-p { margin: 0; font-size: 19px; line-height: 1.6; color: var(--ink); }
.cx-sec.hl { background: linear-gradient(90deg, rgba(246, 182, 207, .4), rgba(246, 182, 207, 0)); border-left: 5px solid var(--pink-d); padding: 2px 8px; border-radius: 8px; }
.cx-sec.hl2 { background: linear-gradient(90deg, rgba(233, 201, 138, .4), rgba(233, 201, 138, 0)); border-left: 5px solid var(--gold-d); padding: 2px 8px; border-radius: 8px; }
.cx-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.cx-pill { padding: 3px 12px; border-radius: 16px; font-size: 17px; font-weight: 800; border: 2px solid var(--gold); color: var(--plum); }
.cx-pill.up { background: #ffe4ee; }
.cx-pill.rev { background: #e6dcfa; }
