/* Shared approved PNG detail skin. Corners and rule endpoints use nine-slice. */
dialog.character-detail,body.preview-mode dialog.character-detail{--detail-ink:#173449;--detail-paper:#e8d9b9;--detail-muted:#52616a;position:fixed;inset:0;margin:auto;width:min(1240px,94vw);max-width:94vw;height:fit-content;max-height:88dvh;overflow:visible;border:0;border-radius:0;padding:48px 36px 30px;color:var(--detail-ink);background:none;box-shadow:none;filter:drop-shadow(0 20px 32px #0009);isolation:isolate}
dialog.character-detail[hidden],.character-detail [hidden]{display:none!important}
dialog.character-detail::backdrop{background:#07121bc4;backdrop-filter:blur(5px)}
dialog.character-detail::before{content:"";position:absolute;inset:-8px;border:38px solid transparent;border-image:url("../assets/ui/common/parchment-panel-v2.png") 145 155 140 155 fill /38px round;pointer-events:none;z-index:-1}
.character-detail h2.detail-dialog-title{position:absolute;top:-30px;left:50%;transform:translateX(-50%);z-index:1;display:grid;place-items:center;width:320px;max-width:88%;height:62px;box-sizing:border-box;margin:0;padding:10px 28px;border:0;background:url("../assets/ui/common/title-plaque-v3.png");background-position:50% 49%;background-size:100% 182%;background-repeat:no-repeat;color:#f6dbad;font:900 27px/1.2 "Noto Sans TC","Microsoft JhengHei",sans-serif;letter-spacing:5px;text-shadow:0 1px 1px #000}
.detail-layout{display:grid;grid-template-columns:minmax(0,min(30%,calc((88dvh - 160px)*.8))) minmax(0,1fr);gap:28px;align-items:start;max-height:calc(88dvh - 78px);min-height:0;overflow:hidden;padding:3px}
.detail-card{margin:0;min-width:0;position:relative;padding-bottom:3px}
.detail-portrait{position:relative;display:grid;place-items:center;aspect-ratio:4/5;min-height:0;width:100%;font-size:12px;color:#cbbd9e;border:0;background:#172a39;overflow:hidden}
.detail-portrait::after{content:"";position:absolute;inset:0;border:19px solid transparent;border-image:url("../assets/ui/character-details/v1/portrait-frame-v1.png") 90 /19px stretch;z-index:2;pointer-events:none}
.detail-portrait .character-image{inset:8px;width:calc(100% - 16px);height:calc(100% - 16px);object-fit:cover;object-position:50% 25%}
.detail-nameplate{position:relative;z-index:3;display:flex;align-items:center;justify-content:center;gap:10px;margin:-8px 1px 0;min-height:48px;padding:10px 25px;color:#f1dfba;background:none;isolation:isolate}
.detail-nameplate::before{content:"";position:absolute;inset:0;border:13px solid transparent;border-inline-width:34px;border-image:url("../assets/ui/character-details/v1/nameplate-v1.png") 75 300 fill /13px 34px stretch;z-index:-1;pointer-events:none}
#detail-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:700 23px/1.3 "PMingLiU",serif}
#detail-stars{display:inline-flex;align-items:center;flex:none;gap:1px;white-space:nowrap;line-height:1}
#detail-stars img{display:block;flex:none;width:clamp(9px,1.1vw,14px);height:clamp(9px,1.1vw,14px);object-fit:contain}
.detail-content{min-width:0;min-height:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px 28px;align-content:start;align-items:stretch;max-height:calc(88dvh - 84px);padding:0 4px 8px 12px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#17344966 transparent;touch-action:pan-y}
.detail-content:focus-visible{outline:1px solid #17344966;outline-offset:-1px}
.detail-content>section{position:relative;min-width:0;padding-left:10px}
.detail-content>section::before{content:"";position:absolute;left:-5px;top:0;bottom:0;width:6px;border-block:10px solid transparent;border-image:url("../assets/ui/character-details/v1/vertical-divider-v1.png") 90 0 fill /10px 0 stretch;opacity:.65;pointer-events:none}
.character-detail .detail-content h3{position:relative;isolation:isolate;margin:0 0 13px;padding:5px 18px;min-height:34px;color:#f2dfbb;font:700 18px/1.4 "PMingLiU",serif;letter-spacing:1px;background:none}
.character-detail .detail-content h3::before{content:"";position:absolute;inset:0;z-index:-1;border:0 solid transparent;border-inline-width:18px 46px;border-image:url("../assets/ui/character-details/v1/section-heading-v1.png") 0 300 0 110 fill /0 46px 0 18px stretch;pointer-events:none}
.character-detail .detail-stats{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 8px;font-size:13px;margin:0;padding:0 6px 0 14px}
.character-detail .detail-stats dt,.character-detail .detail-stats dd{margin:0;padding:6px 0;border-bottom:1px solid #17344926;line-height:1.6;overflow-wrap:anywhere}
.character-detail .detail-stats dt{color:var(--detail-muted);display:flex;align-items:center;gap:9px}
.character-detail .detail-stat-icon{display:block;order:-1;flex:0 0 22px;width:22px;height:22px;object-fit:contain;filter:brightness(0) saturate(100%) invert(18%) sepia(36%) saturate(711%) hue-rotate(161deg) brightness(91%) contrast(94%);pointer-events:none}
.character-detail .detail-stats dd{text-align:right;color:var(--detail-ink)}
.character-detail .detail-stats .detail-category-label{position:absolute;width:1px;height:1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.character-detail .detail-stats .detail-category-value{grid-column:1/-1;text-align:left;border:0;padding:5px 0;display:flex;align-items:center;gap:9px}
.character-detail .detail-stats .detail-category-end{position:relative;margin-bottom:9px;padding-bottom:17px}
.detail-category-end::after{content:"";position:absolute;left:-10px;right:0;bottom:0;height:7px;border:0 solid transparent;border-inline-width:10px;border-image:url("../assets/ui/character-details/v1/horizontal-divider-v1.png") 0 80 fill /0 10px stretch;opacity:.65;pointer-events:none}
.character-detail ul{list-style:none;margin:0;padding:0 8px 0 14px;font-size:14px;line-height:1.9;color:var(--detail-ink);white-space:pre-line;overflow-wrap:anywhere}
.character-detail li+li{margin-top:8px}
.character-detail #detail-statuses li,.character-detail #detail-laws li{position:relative;padding:5px 0 10px;background:none;border:0}
.status-art-icon{display:inline-flex;flex:none;width:26px;height:26px;align-items:center;justify-content:center;vertical-align:middle}
.status-art-icon>img{display:block;width:100%;height:100%;object-fit:contain;filter:none}
.status-art-icon>.ui-icon{display:inline-flex;width:100%;height:100%;align-items:center;justify-content:center}
.status-art-icon svg{width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8}
.character-detail #detail-statuses .detail-status-entry{display:flex;align-items:center;gap:8px}
.character-detail .detail-status-entry>.status-art-icon,.character-detail .detail-status-entry>.ui-icon{flex:none;width:32px;height:32px;padding:2px;box-sizing:border-box;background:#10202de8;border-radius:3px;color:#e8d4ae}
.character-detail .detail-status-entry>span:last-child{min-width:0;overflow-wrap:anywhere}
.character-detail #detail-statuses li+li::before,.character-detail #detail-laws li+li::before{content:"";position:absolute;left:0;right:0;top:-5px;height:5px;border:0 solid transparent;border-inline-width:8px;border-image:url("../assets/ui/character-details/v1/horizontal-divider-v1.png") 0 80 fill /0 8px stretch;opacity:.45;pointer-events:none}
.detail-content:has(#detail-state-section[hidden]) #detail-law-section{grid-column:1/-1}
@media(max-width:900px){.detail-layout{gap:20px}.detail-content{grid-template-columns:1fr;gap:18px}.detail-nameplate{gap:6px;padding-inline:19px}#detail-name{font-size:19px}#detail-stars{font-size:12px}.character-detail .detail-content h3{font-size:17px}}
@media(max-width:560px){dialog.character-detail,body.preview-mode dialog.character-detail{width:94vw;padding:40px 20px 20px;max-height:90dvh}dialog.character-detail::before{border-width:28px;border-image-width:28px;inset:-3px}.character-detail h2.detail-dialog-title{width:270px;height:54px;top:-26px;font-size:22px}.detail-layout{display:flex;flex-direction:column;align-items:stretch;gap:15px;max-height:calc(90dvh - 60px)}.detail-card{flex:none;width:min(200px,45vw,calc((90dvh - 260px)*.8));margin:0 auto}.detail-nameplate{min-height:39px;padding:7px 20px;gap:5px}.detail-nameplate::before{border-image-width:11px 27px}.detail-portrait::after{border-image-width:15px}#detail-name{font-size:18px}#detail-stars{font-size:11px}.detail-content{flex:1;min-height:80px;max-height:none;padding-left:8px}.character-detail .detail-content h3{font-size:17px}.character-detail .detail-stats{font-size:13px}}
