/* Map navigation convention: original red location pin before the label. */
a.ffrs-map-link>.ffrs-map-icon{display:inline-block!important;width:14px!important;height:16px!important;max-width:none;object-fit:contain!important;vertical-align:-3px;margin:0 .35em 0 0!important;padding:0!important;flex:0 0 14px;filter:none!important;border:0!important;border-radius:0!important;background:none!important;box-shadow:none!important}
a.ffrs-map-link::before{display:none!important}

.summon-backlinks{border-top:1px solid #cbd5c1;margin-top:18px;padding-top:14px}.summon-backlinks h3{font-size:18px;color:#314f3d}.summon-backlinks .pills{display:flex;gap:7px;flex-wrap:wrap}.summon-backlinks .pills a{display:inline-flex;background:#e7eddf;border:1px solid #c9d4bf;border-radius:4px;padding:6px 10px;font-size:14px;color:#31503e}

[hidden]{display:none!important}

.mainline-backlinks{margin-top:20px;padding-top:15px;border-top:1px solid #c7d1bb}.mainline-backlinks h3{font-size:18px!important;color:#314f3c;margin:0 0 12px;text-align:left!important}.mainline-backlink-list{display:flex;gap:8px;flex-wrap:wrap}.mainline-backlink-list a{display:flex;flex-direction:column;gap:3px;padding:8px 11px;border:1px solid #c6d2b8;background:#edf2e2;border-radius:4px;color:#33543e}.mainline-backlink-list strong{font-size:14px}.mainline-backlink-list small{font-size:12px;color:#4c6451}
/* Shared list headings stay below global navigation while their list scrolls. */
.item-list-head,.quest-list-head,.skill-list-head,.skill-columns{position:sticky!important;top:var(--ffrs-header-height,80px);z-index:20;background:#eceee3!important;box-shadow:0 1px 0 #cbd5bf}
body[data-page="items"] .list-table,body[data-page="skills"] .skill-list,.quest-list{overflow:visible!important}
.data-table thead,.reward-table thead,.scope-table thead{position:sticky;top:var(--ffrs-header-height,80px);z-index:20;background:#eceee3}
.character-equip thead,.source-table thead,dialog thead{top:0}
.table-wrap:has(>.data-table){overflow:visible}
@media(max-width:1000px){body[data-page="items"] .list-table,body[data-page="skills"] .skill-list{overflow-x:auto!important;max-height:calc(100dvh - var(--ffrs-header-height,80px) - 24px)}body[data-page="items"] .item-list-head,body[data-page="skills"] .skill-list-head{top:0}}

/* A nested horizontal scroller has its own top edge; a page-header offset would overlap row one. */
.item-list-head.ffrs-contained-head,.shop-list-head.ffrs-contained-head,.quest-list-head.ffrs-contained-head,.skill-list-head.ffrs-contained-head,.skill-columns.ffrs-contained-head,thead.ffrs-contained-head{top:0!important}

/* Dialog controls remain above tables; headings in the dialog scroller start below the toolbar. */
dialog > .dialog-top,dialog > .dialog-bar{z-index:40!important;isolation:isolate}
dialog .ffrs-dialog-head{top:var(--ffrs-dialog-header-height,0px)!important}

.ffrs-back-to-top{position:fixed;right:max(22px,env(safe-area-inset-right));bottom:calc(24px + env(safe-area-inset-bottom));z-index:900;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;width:48px;height:52px;padding:4px;border:1px solid #b6c6ae;border-radius:8px;background:#fffef8;color:#294c3b;box-shadow:0 3px 14px #18332f24;cursor:pointer;font:12px/1.2 sans-serif}
.ffrs-back-to-top[hidden]{display:none!important}.ffrs-back-to-top>span:first-child{font-size:24px;line-height:1}.ffrs-back-to-top:hover{background:#eaf0e3;border-color:#6c8a62}.ffrs-back-to-top:focus-visible{outline:3px solid #76986b;outline-offset:3px}
@media(max-width:600px){.ffrs-back-to-top{right:12px;bottom:calc(16px + env(safe-area-inset-bottom));width:44px;height:48px}}

/* Source-index relationships stay out of the public detail presentation. */
#edges-out,#edges-in,.relationship-head,.relationship-head + .edge-list{display:none!important}

.resistance-values>span>b{display:flex;flex-direction:column;align-items:center;gap:4px}
.resistance-icon{display:inline-block;width:20px!important;height:20px!important;object-fit:contain;vertical-align:middle;flex-shrink:0;image-rendering:pixelated}
.resistance-symbol{box-sizing:border-box;border:1px solid #a7b3a0;border-radius:50%;background:#e5eadd;color:#354837;font:700 17px/18px sans-serif;text-align:center}
.resist-list>.tag .resistance-icon{margin-right:5px}

/* Let resistance icons lead while keeping labels and values readable. */
.resistance-values .resistance-icon,.resist-list .resistance-icon{width:28px!important;height:28px!important}
.resistance-values>span>b{font-size:10px!important;line-height:1.4;gap:3px}
.resistance-values>span>small{font-size:10px!important;line-height:1.5}
.resist-list>.tag{font-size:11px!important}
.resistance-values .resistance-symbol,.resist-list .resistance-symbol{font-size:23px;line-height:26px}

.ffrs-cross-detail{position:fixed;inset:0;width:100vw;max-width:none;height:100dvh;max-height:none;padding:0;border:0;margin:0;background:transparent;overflow:hidden}.ffrs-cross-detail::backdrop{background:#20342fb3}.ffrs-cross-detail iframe{width:100%;height:100%;border:0;background:transparent}.ffrs-cross-close{position:absolute;right:12px;top:12px;width:32px;height:32px;border:1px solid #c8d1c1;border-radius:50%;background:#fffdf7;color:#263e36;font-size:24px;cursor:pointer}

/* Session-aware navigation, hidden before permissions are loaded. */
[data-min-role][hidden]{display:none!important}.ffrs-account-link{font-size:12px;max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:inherit;text-decoration:none;padding:8px}.ffrs-header-inner{gap:12px}

@media(max-width:600px){.ffrs-account-link{font-size:0;max-width:40px;padding:6px;flex-shrink:0}.ffrs-account-link::after{content:"账号";font-size:12px}.ffrs-header-inner{gap:6px}.ffrs-menu-toggle{padding:6px 8px}}

/* Same search controller as the home page, presented in the current page. */
.ffrs-search-dialog{width:min(680px,calc(100vw - 32px));max-height:80vh;box-sizing:border-box;padding:24px;border:1px solid #c5d3da;border-radius:10px;background:#fffefa;color:#243e42;overflow:auto}
.ffrs-search-dialog::backdrop{background:#132c3a88}
.ffrs-search-dialog h2{margin:0 0 18px;font-size:22px}
.search-dialog-close{float:right;border:0;background:transparent;font-size:25px;cursor:pointer}
.global-search-field{display:flex;gap:10px;margin:10px 0}
.global-search-field input{min-width:0;flex:1;padding:12px;border:1px solid #9ab0b9;border-radius:4px;font:inherit}
.ffrs-search-dialog button{cursor:pointer}
.global-search-field button{padding:10px 22px;background:#2d514b;color:white;border:0;border-radius:4px}
#global-site-suggestion-list>button{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px;border:0;border-bottom:1px solid #dce3dd;background:transparent;text-align:left;color:inherit}
#global-site-suggestion-list>button>span{display:flex;gap:12px;align-items:center}
#global-site-suggestion-list>button:hover,#global-site-suggestion-list>button[aria-selected=true]{background:#eaf1e7}
#global-site-suggestion-list img{object-fit:contain}
#global-suggestion-status,#global-search-status{font-size:12px;color:#607572}
#global-search-categories{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0}
#global-search-categories button{padding:5px 8px;border:1px solid #cad7cc;background:#f5f7f2}
#global-search-categories button[aria-pressed=true]{background:#dce8db}
#global-search-categories small{margin-left:5px}
#global-search-result-list>a{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid #dce3dd;color:inherit;text-decoration:none}
#global-search-result-list img{object-fit:contain}
#global-search-result-list .search-result-copy{display:grid;gap:4px}
#global-search-result-list small,#global-search-result-list .search-result-copy>span{font-size:12px}

/* Shared resistance semantics, including dynamically rendered dialogs. */
[data-resistance]{border-radius:4px;padding:6px!important;border:1px solid transparent}
[data-resistance="normal"]{background:#f0f3f4!important;color:#53616b!important}
[data-resistance="weak"]{background:#fff0df!important;border-color:#dc812f!important;color:#a63b10!important;box-shadow:inset 0 0 0 1px #edb473}
[data-resistance="resist"]{background:#e8f0fc!important;color:#285b92!important;border-color:#b3cbe7!important}
[data-resistance="immune"]{background:#eee9f7!important;color:#624489!important;border-color:#cfc0e6!important}
[data-resistance="absorb"]{background:#e3f3e9!important;color:#246c46!important;border-color:#a9d5bc!important}
[data-resistance] small{color:inherit!important}
.resistance-value-weak{font-size:15px!important;font-weight:800!important;line-height:1.4;color:#a63b10!important}

/* Compact non-modal search, anchored below the header control. */
.ffrs-search-popover{position:fixed;top:calc(var(--ffrs-header-height,72px) + 8px);right:20px;width:min(460px,calc(100vw - 24px));max-height:calc(100dvh - 100px);overflow:auto;box-sizing:border-box;padding:16px;background:#fffefa;border:1px solid #c5d3da;border-radius:8px;box-shadow:0 10px 32px #18344326;z-index:2000;color:#243e42}
.ffrs-search-popover h2{font-size:16px;margin:0 0 10px}.ffrs-search-popover label{font-size:12px}.ffrs-search-popover .global-search-field{margin:8px 0}.ffrs-search-popover .global-search-field input{width:0}.ffrs-search-popover .search-dialog-close{font-size:20px}.ffrs-search-popover button{cursor:pointer}.ffrs-search-popover #global-site-suggestions{position:static}.ffrs-search-popover #global-site-suggestion-list button{gap:12px}.ffrs-search-popover #global-site-suggestion-list small{white-space:nowrap}
@media(min-width:851px){.ffrs-global-header .ffrs-header-inner{max-width:1680px;gap:16px;padding:0 24px}.ffrs-global-header .ffrs-primary-nav{gap:14px}.ffrs-primary-nav>a,.ffrs-nav-group>summary{font-size:12px;gap:4px}}
@media(min-width:851px) and (max-width:1200px){.ffrs-brand-text{display:none}.ffrs-global-header .ffrs-primary-nav{gap:10px}.ffrs-global-header .ffrs-header-inner{gap:10px;padding:0 12px}}

.ffrs-nav-separator{width:1px;height:20px;background:#ccd4da;flex:0 0 1px;margin:0 3px}.ffrs-primary-nav a.ffrs-map-link>.ffrs-map-icon{display:none!important}@media(max-width:850px){.ffrs-nav-separator{display:block;width:100%;height:1px;margin:6px 0}}

.translation-badge{display:inline-block;font:600 10px/1.5 sans-serif!important;padding:0 4px;margin-left:5px;vertical-align:middle;white-space:nowrap;border:1px solid #dab565;border-radius:3px;background:#fff1c8;color:#80531b}

.ffrs-footer-policy{display:block;flex:0 0 100%;width:100%;box-sizing:border-box;margin:18px auto 0;padding:14px 20px;text-align:center;color:#687384;font-size:13px;line-height:1.8;border-radius:8px;background:repeating-linear-gradient(45deg,#edf1f6,#edf1f6 5px,#e9eef5 5px,#e9eef5 6px)}
.ffrs-footer-policy a{color:#285fa0;text-decoration:underline;text-underline-offset:3px;white-space:nowrap}
footer:has(>.ffrs-footer-policy){flex-wrap:wrap}
.terms-content{max-width:900px;margin:40px auto;padding:0 24px;line-height:1.9}.terms-content h2{margin-top:28px}.terms-content li{margin:8px 0}

/* Keep the policy centered in the existing footer row. */
footer:has(>.ffrs-footer-policy){display:flex;align-items:center;flex-wrap:wrap;gap:16px}
footer>.ffrs-footer-policy{order:0;flex:1 1 320px;width:auto;margin:0;padding:0;background:none;border-radius:0;font-size:12px}
footer>.ffrs-footer-policy~*{order:1}
footer:has(>.ffrs-footer-policy)>:first-child{order:-1}
footer:has(>.ffrs-footer-policy)>:not(:first-child):not(.ffrs-footer-policy){order:1}
