/* Image-first additions: real source sprites, labelled category symbols, unchanged data. */
.site-nav a{gap:8px}.site-nav .icon{width:17px;height:17px}.global-search button{display:grid;place-items:center;min-width:48px}.menu-toggle .icon{width:22px;height:22px}.back-arrow{display:inline-flex;transform:rotate(180deg)}.reset{min-width:44px;justify-content:center}.view-modes{display:flex;gap:4px;border:1px solid var(--control);padding:3px;border-radius:6px;background:var(--paper);flex-shrink:0}.view-modes button{display:grid;place-items:center;width:44px;height:44px;border-radius:4px}.view-modes button[aria-pressed="true"]{background:var(--ink);color:var(--paper)}.view-modes button:hover:not([aria-pressed="true"]){background:var(--soft)}.view-modes .icon{width:19px;height:19px}.item-families{display:flex;gap:8px;margin-bottom:18px;flex-wrap:wrap}.item-families a{display:flex;align-items:center;justify-content:center;gap:10px;min-height:56px;min-width:80px;padding:10px 16px;background:var(--paper);border:1px solid var(--line);border-radius:6px;font-size:14px}.item-families a:hover{border-color:var(--control)}.item-families a[aria-current]{border-color:var(--ink);outline:1px solid var(--ink);outline-offset:-2px}.item-families img{object-fit:contain;image-rendering:pixelated;width:32px;height:32px}.item-families .icon{width:24px;height:24px}.entry-thumb{display:inline-grid;place-items:center;flex-shrink:0;position:relative;width:48px;height:48px;border-radius:4px;overflow:hidden}.entry-thumb img{width:35px;height:auto;max-width:100%;object-fit:contain;image-rendering:pixelated}.entry-thumb .art-fallback{display:none}.entry-thumb.image-failed .art-fallback{display:grid;place-items:center}.symbolic-thumb{background:var(--soft);color:var(--muted)}.symbolic-thumb>.icon,.art-fallback>.icon{width:24px;height:24px}.map-thumb{background:#242a24}.route-preview{display:block;width:100%;height:100%}.record-identity{display:flex;align-items:center;gap:14px;min-width:0}.record-identity .record-name{min-width:0}.row-fact{display:flex;align-items:center;justify-content:flex-end;gap:7px}.row-fact .icon{width:15px;height:15px;color:var(--muted)}
.item-gallery{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.item-gallery .item-card{display:flex;flex-direction:column;align-items:stretch;border:1px solid var(--line);background:var(--paper);border-radius:8px;padding:18px 20px;gap:0;min-height:258px;overflow:hidden}.item-gallery .item-card:hover{border-color:var(--control)}.item-card-top{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:var(--muted)}.tier{display:flex;align-items:center;gap:6px;white-space:nowrap}.tier i{width:8px;height:8px;border:1px solid #949b90;border-radius:50%;background:#fff}.tier[data-tier="黃色"] i{background:#eac354;border-color:#9a771c}.tier[data-tier="紫色"] i{background:#987da9;border-color:#77598c}.tier[data-tier="藍色"] i{background:#6c9cc5;border-color:#426f95}.item-art{height:106px;display:flex;align-items:center;justify-content:center;position:relative}.entry-thumb.gallery{width:86px;height:86px;background:none}.entry-thumb.gallery img{width:70px;height:auto;max-height:80px;max-width:80px}.entry-thumb.gallery.symbolic-thumb>.icon{width:40px;height:40px;color:#7d897b}.no-original{position:absolute;bottom:12px;right:2px;color:var(--muted)}.no-original .icon{width:15px;height:15px}.item-gallery .record-name strong{font-size:15px;font-weight:500;line-height:1.55;min-height:24px;overflow-wrap:anywhere}.card-stats{display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;margin:12px 0 16px;min-height:23px}.stat{display:inline-flex;align-items:center;gap:5px;white-space:nowrap;font-size:13px}.stat>.icon{width:15px;height:15px;color:var(--muted)}.stat b{font-weight:500}.stat-code{font-size:11px;color:var(--muted)}.item-card-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid var(--line);padding-top:12px;margin-top:auto;font-size:13px}.price,.item-role{display:inline-flex;gap:7px;align-items:center}.price>.icon,.item-role>.icon{width:15px;height:15px;color:var(--muted)}.item-card-foot>.icon{width:16px;height:16px}.item-gallery .item-card:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.relation-link{grid-template-columns:42px minmax(0,1fr) 18px;gap:12px;padding:10px 12px}.relation-link>.entry-thumb{width:40px;height:40px;grid-column:1;grid-row:1}.relation-copy{grid-column:2;grid-row:1;min-width:0;display:flex;flex-direction:column;gap:3px}.relation-copy>.relation-type{display:block;padding:0;background:none;font-size:11px;line-height:1.4;color:var(--muted)}.relation-copy strong{font-size:14px;font-weight:500;overflow-wrap:anywhere}.relation-link>.icon{grid-column:3;grid-row:1}.relation-group{margin-bottom:16px}.related-panel>h2{margin-bottom:22px}.visual-overview{margin-bottom:24px}.visual-overview.sprite{display:grid;grid-template-columns:150px minmax(0,1fr);gap:26px;align-items:center}.visual-overview.sprite .detail-intro{margin-bottom:14px}.visual-overview.no-art{margin-bottom:0}.visual-overview.map,.visual-overview.region{display:flex;flex-direction:column;gap:20px}.visual-overview.map .detail-intro,.visual-overview.region .detail-intro{margin-bottom:0}.entry-figure{margin:0;min-width:0}.entry-figure figcaption{color:var(--muted);font-size:11px;line-height:1.6;margin-top:8px}.enlarge-image{position:relative;display:grid;place-items:center;width:100%;min-height:145px;padding:16px;background:var(--soft);border:1px solid var(--line);border-radius:6px;cursor:zoom-in;overflow:hidden}.enlarge-image .pixel-art{image-rendering:pixelated;width:105px;height:auto;max-width:100%;max-height:120px;object-fit:contain}.expand-mark{position:absolute;right:6px;bottom:6px;display:grid;place-items:center;width:25px;height:25px;border-radius:4px;background:var(--paper);color:var(--ink)}.expand-mark .icon{width:15px;height:15px}.detail-stats{display:flex;flex-wrap:wrap;gap:12px 20px}.detail-stats .stat{font-size:17px}.detail-stats .stat-code{font-size:12px}.detail-stats .icon{width:18px;height:18px}.entry-figure.map-figure,.entry-figure.region-figure{width:100%}.map-figure .enlarge-image{height:280px;background:#242a24;padding:16px}.region-figure .enlarge-image{height:260px;padding:10px}.region-art{height:100%;max-height:240px;width:100%;object-fit:contain}.map-preview .map-thumbnail{height:210px;padding:16px}.map-preview-text .type-label{font-size:12px}.preview-coords{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:var(--muted);margin-top:12px}.preview-coords span{display:inline-flex;align-items:center;gap:5px}.preview-coords>.icon{width:14px;height:14px}.preview-coords span>.icon{width:13px;height:13px}
#image-dialog{width:min(860px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:24px;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink);box-shadow:0 16px 60px #0003}#image-dialog::backdrop{background:#151b17b3}#image-dialog>header{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:16px}#image-dialog h2{font-size:20px;margin:0}#close-image{display:grid;place-items:center;width:44px;height:44px;border:1px solid var(--control);background:var(--paper);flex-shrink:0}.lightbox-picture{display:grid;place-items:center;min-height:200px;max-height:65dvh;padding:24px;background:var(--soft);border-radius:6px;overflow:hidden}.lightbox-picture.map{height:60dvh;background:#242a24;padding:20px}.lightbox-picture.sprite{min-height:260px}.lightbox-picture.sprite img{image-rendering:pixelated;width:168px;height:auto;max-width:60%}.lightbox-picture.region img{max-width:100%;max-height:55dvh;object-fit:contain}.lightbox-caption{margin:16px 0 8px;font-size:14px}.image-source{display:inline-flex;align-items:center;gap:6px;min-height:36px;font-size:13px;text-decoration:underline;text-underline-offset:4px}.lightbox-note{font-size:12px;color:var(--muted);margin-top:8px;margin-bottom:0}.media-error{font-size:14px;padding:12px;color:var(--warn)}
@media(max-width:1200px){.item-gallery{grid-template-columns:repeat(3,minmax(0,1fr))}.item-families a{min-width:70px;padding:8px 12px}.item-families{gap:6px}.visual-overview.sprite{grid-template-columns:130px minmax(0,1fr);gap:18px}.enlarge-image .pixel-art{width:90px}.preview-coords{flex-wrap:wrap;justify-content:flex-start}}
@media(max-width:900px){.site-nav a{gap:5px;font-size:12px}.site-nav .icon{width:15px;height:15px}.item-gallery{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.item-gallery .item-card{padding:14px}.item-families a{flex:1;min-width:58px;flex-direction:column;gap:5px;padding:8px}.item-families{flex-wrap:nowrap}.item-families a .icon{height:24px;margin-block:4px}.item-families a span{font-size:12px}.record-identity{grid-column:1;grid-row:1}.visual-overview.sprite{display:block}.sprite-figure{width:160px;margin:0 0 20px}.row-fact{grid-column:2;grid-row:1/3}.card-stats{gap:6px 9px}.stat-code{font-size:11px}.relation-link{grid-template-columns:38px minmax(0,1fr) 16px;gap:8px}.relation-link>.entry-thumb{width:36px;height:36px}}
@media(max-width:650px){.site-nav a{gap:10px;font-size:14px}.site-nav .icon{width:18px;height:18px}.menu-toggle{padding:0;width:44px}.view-modes{position:absolute;right:0;top:21px}.page-head:has(.view-modes){position:relative;padding-right:112px}.page-head:has(.view-modes) p{margin-right:-112px;padding-top:6px}.page-head:has(.view-modes) h1{font-size:24px}.view-modes button{width:44px;height:44px}.item-families{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:4px;overflow-x:auto;margin-inline:-16px;padding-inline:16px;grid-auto-flow:column;grid-auto-columns:minmax(52px,1fr);grid-template-columns:repeat(9,minmax(52px,1fr));scrollbar-width:thin;margin-bottom:14px}.item-families a{min-width:52px;padding:6px 5px;min-height:68px}.item-families img{width:30px;height:30px}.item-families a span{font-size:11px}.item-families .icon{width:22px;height:22px}.item-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.item-gallery .item-card{padding:13px;min-height:248px}.item-card-top{font-size:11px}.item-art{height:100px}.entry-thumb.gallery{width:76px;height:76px}.entry-thumb.gallery img{width:70px;max-width:72px;max-height:72px}.item-gallery .record-name strong{font-size:14px}.card-stats{margin:10px 0 12px;min-height:23px;gap:6px 10px}.stat{font-size:12px}.stat-code{font-size:11px}.card-stats .stat-code{display:none}.item-card-foot{font-size:12px;gap:6px}.price{gap:5px}.item-card-foot>.icon{width:15px}.record-identity{grid-column:1;grid-row:1;gap:10px}.record-identity>.entry-thumb{width:36px;height:36px}.record-identity>.entry-thumb img{max-width:35px}.record-list .record-row{grid-template-columns:minmax(0,1fr) 76px}.row-fact{grid-column:1;grid-row:3;justify-content:flex-start}.row-state{grid-column:2;grid-row:3}.row-action{grid-column:2;grid-row:1}.relation-link{grid-template-columns:40px minmax(0,1fr) 18px;gap:10px}.relation-link>.entry-thumb{width:40px;height:40px}.visual-overview.sprite{display:grid;grid-template-columns:105px minmax(0,1fr);gap:16px}.sprite-figure{width:auto;margin:0}.enlarge-image{min-height:115px;padding:12px}.enlarge-image .pixel-art{width:70px}.entry-figure figcaption{font-size:11px}.visual-overview.sprite .detail-intro{font-size:14px;line-height:1.8}.detail-stats{gap:8px 12px}.detail-stats .stat{font-size:15px}.detail-stats .stat-code{font-size:11px}.detail-stats .icon{width:16px;height:16px}.map-figure .enlarge-image{height:230px}.region-figure .enlarge-image{height:200px}.map-preview .map-thumbnail{height:220px}.preview-coords{font-size:12px;justify-content:space-between}.lightbox-picture{padding:14px}#image-dialog{padding:16px}.lightbox-picture.sprite{min-height:220px}.lightbox-note{font-size:12px}.map-preview h2{font-size:18px}.filter-toggle{min-width:52px}.filters .query-label{flex-basis:calc(100% - 64px)}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}

.view-modes button{border:0;background:transparent;color:inherit;cursor:pointer}
