:root {
    color-scheme: light;
    --ink: #1d3435;
    --muted: #536765;
    --faint: #637675;
    --sea: #12383d;
    --deep: #102e33;
    --gold: #a27a3f;
    --paper: #f5f4ed;
    --white: #fffeF9;
    --line: #dcded2;
    --green: #246553;
    --serif: "Spectral", "Noto Serif TC", "Songti TC", "PMingLiU", "MingLiU", serif;
    --sans: "DM Sans", "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
    --mono: "IBM Plex Mono", Consolas, monospace;
    font-family: var(--sans);
    color: var(--ink);
    background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: default; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #bd7e2e; outline-offset: 3px; }
[hidden] { display: none !important; }
.wrap { width: min(1240px, calc(100% - 8vw)); margin-inline: auto; }
.icon, .section-title::before, .fact-egg::before, .fact-level::before, .area-tag::before, .art-placeholder::before, .detail-empty::before {
    display: inline-block; flex: none; width: 1.12em; height: 1.12em;
    background: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}
.skip-link { position: absolute; z-index: 4; top: 6px; left: 10px; padding: 10px 18px; background: white; transform: translateY(-170%); }
.skip-link:focus { transform: none; }
.masthead { background: var(--deep); color: #f5f2df; border-bottom: 1px solid #456263; }
.mast-inner, .site-nav, .brand, .site-nav a, .brand-seal, .cover-stats, .cover-stats > span, .cat-label, .category, .index-title, .index-title h3, .filter-box, .search-box, .catalog-head, .catalog-head h2, .connection, .section-heading, .section-title, .detail-facts, .detail-facts > span, .area-tag, .site-footer .wrap, .back-index { display: flex; align-items: center; }
.mast-inner { height: 66px; justify-content: space-between; gap: 16px; }
.brand { gap: 11px; white-space: nowrap; }
.brand-seal { width: 38px; height: 38px; color: #f1d9a0; justify-content: center; border: 1px solid #9d9469; border-radius: 7px; background: #21474a; }
.brand-seal .icon { width: 26px; height: 26px; }
.brand-wordmark { display: grid; gap: 1px; }
.brand-wordmark b { font-family: var(--serif); font-size: 18px; line-height: 1.15; letter-spacing: .13em; }
.brand-wordmark small { font-family: Georgia, serif; font-size: 9px; letter-spacing: .24em; line-height: 1.15; color: #d7c596; }
.site-nav { height: 100%; gap: 28px; }
.site-nav a { height: 100%; gap: 8px; color: #d8e2da; font-size: 13px; font-weight: 600; position: relative; }
.site-nav .nav-active { color: #f6d591; }
.site-nav .nav-active::after { content: ""; position: absolute; bottom: 0; height: 2px; background: #dfba74; inset-inline: 0; }
.site-nav a:hover { color: #fff5d4; }
.cover { position: relative; overflow: hidden; isolation: isolate; background: #173c40; color: #fbf6e6; border-bottom: 3px solid #bda574; }
.cover-art { position: absolute; inset: 0 0 0 auto; width: 83%; z-index: -1; background: url("../image/atlas-cover.webp") right 5% / cover no-repeat; mask-image: linear-gradient(90deg,transparent,#000 33%); }
.cover-inner { padding: 35px 0 42px; min-height: 227px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.cover h1 { font: 800 clamp(40px, 4.15vw, 63px)/1.13 var(--serif); letter-spacing: .055em; margin: 0; color: #fff6de; text-shadow: 0 2px 14px #143c3c80; }
.cover p { font-size: 15px; letter-spacing: .04em; margin: 9px 0 20px; color: #eef2df; }
.cover-stats { gap: 20px; color: #f0e9d4; font-size: 13px; }
.cover-stats > span { gap: 7px; }
.cover-stats > span + span { border-left: 1px solid #7e958c; padding-left: 20px; }
.cover-stats .icon { color: #e0c88f; width: 16px; height: 16px; }
.cover-stats b { font-family: Georgia, serif; font-size: 21px; line-height: 1; color: #ffe4aa; font-variant-numeric: tabular-nums; }
.cover-stats small { font-size: 12px; }
.page-body { position: relative; margin-top: -15px; padding-bottom: 40px; }
.categories { display: grid; grid-template-columns: auto repeat(8, minmax(0,1fr)); align-items: center; gap: 3px; padding: 9px; background: #fffef8; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 15px #183b3510; }
.cat-label, .category { justify-content: center; gap: 7px; white-space: nowrap; font-size: 14px; }
.cat-label { font-weight: 650; font-size: 13px; letter-spacing: .02em; color: var(--muted); padding: 0 17px 0 9px; margin-right: 5px; border-right: 1px solid var(--line); }
.cat-label .icon { width: 15px; height: 15px; }
.category { min-height: 39px; padding: 4px 6px; font-weight: 650; border-radius: 5px; }
.category .icon { color: var(--sigil); width: 19px; height: 19px; }
.category:hover { background: #f2f2e9; }
.category[aria-current="page"] { background: var(--sea); color: #fff7df; box-shadow: inset 0 0 0 1px #223e3f; }
.category[aria-current="page"] .icon { color: #edd096; }
.cat-dragon { --sigil: #a0603b; } .cat-demon { --sigil: #806185; }
.cat-beast { --sigil: #9b6e36; } .cat-bird { --sigil: #47797e; }
.cat-bug { --sigil: #7e823f; } .cat-plant { --sigil: #547d57; }
.cat-mystery { --sigil: #7c6597; } .cat-machine { --sigil: #647282; }
.catalog-head { justify-content: space-between; gap: 12px; margin: 24px 0 13px; }
.catalog-head h2 { gap: 10px; margin: 0; font: 800 27px/1.25 var(--serif); letter-spacing: .045em; }
.catalog-mark { width: 6px; height: 18px; border-radius: 1px; background: var(--gold); transform: skewY(-18deg); }
.connection { flex-wrap: wrap; justify-content: flex-end; gap: 8px; font-size: 12px; color: var(--muted); }
#data-status { display: inline-flex; align-items: center; gap: 7px; }
#data-status[data-state]::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #aa8551; }
#data-status[data-state="ready"]::before { background: #438467; box-shadow: 0 0 0 3px #dce9d9; }
#data-status[data-state="error"]::before { background: #a95d43; }
#data-retry { border: 1px solid #9caea2; background: var(--white); border-radius: 4px; padding: 3px 9px; font-weight: 700; }
.atlas-layout { display: grid; align-items: start; grid-template-columns: clamp(265px,26%,326px) minmax(0,1fr); gap: 21px; }
.index-panel, #pet-detail { background: var(--white); border: 1px solid #d5d9cb; border-radius: 8px; box-shadow: 0 2px 7px #173f3509; }
.index-panel { position: sticky; top: 12px; min-width: 0; }
.index-tools { padding: 16px 17px 12px; border-bottom: 1px solid var(--line); }
.index-title { justify-content: space-between; gap: 7px; margin-bottom: 13px; }
.index-title h3, .section-title { margin: 0; gap: 8px; font-size: 17px; line-height: 1.35; letter-spacing: .02em; }
.index-title h3 .icon { color: #91713e; }
#list-count, .section-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.search-box { gap: 8px; padding: 0 10px; border: 1px solid #cbd2c7; border-radius: 5px; background: #fbfbf6; color: var(--faint); }
.search-box input { width: 100%; min-width: 0; height: 37px; border: 0; background: transparent; font-size: 13px; outline: 0; }
.search-box input::placeholder { color: #66756e; opacity: 1; }
.search-box:focus-within { border-color: #3d7a69; outline: 2px solid #b8d2bb; }
.filter-box { margin-top: 9px; width: fit-content; max-width: 100%; position: relative; gap: 6px; color: var(--muted); font-size: 12px; }
.filter-box select { background: transparent; border: 0; appearance: none; padding: 5px 18px 5px 0; font-weight: 650; }
.filter-box .i-down { position: absolute; right: 1px; pointer-events: none; width: 13px; height: 13px; }
#pet-list { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c8cebf transparent; max-height: min(595px,60vh); padding: 5px 7px 7px; }
.pet-entry { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 11px; position: relative; width: 100%; padding: 7px 9px; text-align: left; border: 1px solid transparent; border-bottom-color: #e8e9df; border-radius: 4px; background: transparent; }
.pet-entry:hover { background: #f1f3ea; }
.pet-entry[aria-current="true"] { background: #e7efe3; border-color: #bcceba; }
.pet-entry[aria-current="true"]::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: #437d68; }
.entry-copy { display: grid; gap: 1px; min-width: 0; }
.entry-name { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.entry-id, .entry-level { font: 11px/1.4 var(--mono); color: var(--muted); }
.entry-level { white-space: nowrap; }
.pet-art { flex: none; display: grid; place-items: center; overflow: hidden; position: relative; isolation: isolate; }
.pet-art img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; padding: 5%; }
.list-art { width: 44px; height: 42px; background: #f4f1e6; border: 1px solid #dfdfd0; border-radius: 5px; }
.art-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #667367; font-size: 10px; line-height: 1.3; }
.art-placeholder::before { content: ""; --icon: var(--i-image); width: 16px; height: 16px; opacity: .7; }
.list-art .art-placeholder { font-size: 8px; }
.detail-column { min-width: 0; }
#pet-detail { overflow: hidden; scroll-margin-top: 14px; }
#pet-detail:empty { display: none; }
.detail-identity { display: flex; align-items: center; gap: 21px; position: relative; isolation: isolate; padding: 19px 25px; border-bottom: 1px solid #d8dfd1; background: linear-gradient(105deg,#eaf0e3 0%, #f4f5eb 71%, #e8eee0); }
.detail-identity::after { content: ""; position: absolute; z-index: -1; pointer-events: none; width: 145px; aspect-ratio: 1; right: 3%; bottom: -10px; opacity: .065; background-color: #44694e; -webkit-mask: var(--i-compass) center / contain no-repeat; mask: var(--i-compass) center / contain no-repeat; }
.detail-art { width: 96px; height: 96px; border: 1px solid #c6cdb4; outline: 1px solid #fff9; outline-offset: -5px; border-radius: 9px; background: radial-gradient(ellipse,#fbf8df 0%,#efeccf 53%,#dbdfc4 100%); }
.identity-copy { min-width: 0; }
.detail-id { font-size: 11px; letter-spacing: .075em; font-weight: 700; color: #617159; }
.detail-name { margin: 2px 0 8px; font: 800 clamp(26px,2.35vw,37px)/1.18 var(--serif); letter-spacing: .03em; overflow-wrap: anywhere; }
.detail-facts { flex-wrap: wrap; gap: 7px; }
.detail-facts > span { gap: 5px; font-size: 12px; line-height: 1.45; font-weight: 650; border: 1px solid #d3d9c7; background: #fffef4c9; border-radius: 4px; padding: 2px 7px; }
.fact-level::before, .fact-egg::before { content: ""; width: 12px; height: 12px; }
.fact-level::before { --icon: var(--i-layers); color: #887349; }
.fact-egg::before { --icon: var(--i-egg); }
.fact-egg[data-egg="true"] { color: #27634c; background: #e0ecda; border-color: #bfd2b6; }
.recipe-section, .area-section { padding: 19px 24px 21px; }
.section-heading { gap: 9px; margin-bottom: 12px; }
.section-title { font-weight: 750; }
.section-title::before { content: ""; color: #99763d; }
.recipe-section .section-title::before { --icon: var(--i-flask); }
.area-section .section-title::before { --icon: var(--i-pin); }
.section-count { background: #f0efe5; border-radius: 4px; font-size: 11px; font-weight: bold; padding: 1px 6px; }
.recipe-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-block: 0 10px; }
.recipe-tools-hint { flex: 1 1 12em; margin: 0; color: var(--muted); font-size: 13px; }
.recipe-actions { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.recipe-tool {
    min-height: 35px; padding: 4px 10px; border: 1px solid #bdcabe; border-radius: 5px;
    background: var(--white); color: #355a49; font-size: 13px; font-weight: 650;
}
.recipe-tool:hover:enabled { border-color: #6d947b; background: #eef4ea; }
.recipe-tool:disabled { color: #78877f; background: #f4f5ed; }
.recipe-export-feedback { flex: 1 0 100%; margin: 0; color: var(--muted); font-size: 13px; }
.recipe-export-feedback:empty { display: none; }
html.recipe-dialog-open { overflow: hidden; }
.recipe-dialog[open] {
    position: fixed; inset: 0; display: flex; flex-direction: column; gap: 10px;
    width: calc(100% - 36px); height: calc(100% - 36px); height: calc(100dvh - 36px);
    max-width: none; max-height: none; margin: auto; padding: 18px 20px; border: 1px solid #bdcabe;
    border-radius: 10px; background: var(--white); color: var(--ink);
}
.recipe-dialog::backdrop { background: #122f32ce; }
.recipe-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.recipe-dialog-head h2 { margin: 0; font: 750 22px/1.25 var(--serif); }
.recipe-dialog-close { background: #315e4d; color: white; }
.recipe-dialog-close:hover:enabled { background: #234c3b; }
.recipe-dialog .recipe-tools { margin: 0; }
.recipe-dialog-body { flex: 1; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.level-planner {
    margin: 0 0 16px; padding: 13px 15px; border: 1px solid #cfdbcb; border-inline-start: 3px solid #50806b;
    border-radius: 6px; background: #f1f5eb;
}
.planner-field { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; }
.planner-label { color: #254e40; font-weight: 750; }
.planner-input {
    width: 8em; padding: 5px 9px; min-height: 36px; border: 1px solid #99b4a4;
    border-radius: 4px; background: var(--white); font-variant-numeric: tabular-nums;
}
.planner-input[aria-invalid="true"] { border-color: #a14c37; }
.planner-feedback { margin: 9px 0 6px; color: #496052; font-size: 13px; }
.graph-notice { margin: 0 0 6px; color: #77572a; font-size: 12px; }
.graph-retry { margin-inline-start: 6px; padding: 2px 6px; color: #315e49; background: var(--white); border: 1px solid #bec9b6; border-radius: 3px; }
.planner-help { font-size: 12px; color: #45614f; }
.planner-notice { color: #735227; }
.planner-help summary { cursor: pointer; font-weight: 700; }
.planner-help p { margin: 6px 0 0; max-width: 60em; }
.area-section { border-top: 1px solid #e1e3d7; }
.area-list { display: flex; flex-wrap: wrap; gap: 6px; }
.area-tag { gap: 5px; border: 1px solid #d9dfd2; background: #f6f7ee; color: #405b4e; border-radius: 4px; padding: 3px 8px; font-size: 13px; }
.area-tag::before { content: ""; --icon: var(--i-pin); width: 12px; height: 12px; }
.section-empty, .empty-list, .empty-message { margin: 0; font-size: 14px; color: var(--muted); }
.empty-list { padding: 16px 8px; }
.detail-empty { min-height: 205px; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 25px; text-align: center; }
.detail-empty::before { content: ""; --icon: var(--i-book); color: #92a18d; width: 35px; height: 35px; }
.back-index { display: none; }
.site-footer { color: var(--muted); border-top: 1px solid #d7dccf; }
.site-footer .wrap { min-height: 62px; gap: 9px; font-size: 12px; }
.site-footer .icon { color: #9a7845; }
.footer-rule { height: 12px; width: 1px; background: #c8cdbd; }
@media (max-width: 1040px) {
    .wrap { width: calc(100% - 40px); }
    .categories { grid-template-columns: repeat(8,minmax(0,1fr)); }
    .cat-label { display: none; }
    .atlas-layout { gap: 15px; }
    .recipe-section, .area-section, .detail-identity { padding-inline: 17px; }
}
@media (max-width: 800px) {
    .wrap { width: calc(100% - 32px); }
    .mast-inner { height: 57px; }
    .site-nav { gap: 18px; }
    .cover-inner { min-height: 194px; padding: 28px 0 31px; }
    .cover-art { width: 100%; background-size: cover; background-position: right top; }
    .cover p { font-size: 14px; }
    .categories { gap: 2px; }
    .category { font-size: 12px; gap: 4px; }
    .category .icon { width: 16px; height: 16px; }
    .atlas-layout { grid-template-columns: 1fr; }
    .index-panel { position: static; scroll-margin-top: 12px; }
    .index-tools { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 12px; align-items: center; padding: 12px 14px; }
    .index-title { grid-column: 1/-1; margin: 0; }
    .filter-box { margin: 0; }
    #pet-list { max-height: 176px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 3px 6px; }
    .pet-entry { gap: 6px; }
    .back-index { display: flex; width: fit-content; gap: 5px; margin: 12px 0 0 auto; color: #3f5e51; font-size: 13px; }
    .catalog-head { margin-top: 20px; }
}
@media (max-width: 600px) {
    .wrap { width: calc(100% - 24px); }
    .brand-seal { width: 32px; height: 32px; }
    .brand-seal .icon { width: 22px; height: 22px; }
    .brand { gap: 7px; }
    .brand-wordmark b { font-size: 16px; }
    .brand-wordmark small { font-size: 8px; }
    .site-nav { gap: 13px; }
    .site-nav a { gap: 4px; font-size: 12px; }
    .site-nav .nav-active .icon { display: none; }
    .cover-inner { min-height: 174px; padding: 22px 2px 29px; }
    .cover-art { mask-image: none; background-size: cover, auto 100%; background-position: center, 60% center; background-image: linear-gradient(90deg,rgba(12,41,42,.94),rgba(12,42,42,.76) 38%,rgba(20,49,46,.21) 78%),url("../image/atlas-cover.webp"); }
    .cover h1 { font-size: clamp(33px,8.8vw,43px); }
    .cover p { margin: 7px 0 13px; font-size: 12px; letter-spacing: 0; }
    .cover-stats { gap: 11px; font-size: 12px; }
    .cover-stats > span { gap: 4px; }
    .cover-stats > span + span { padding-left: 11px; }
    .cover-stats b { font-size: 18px; }
    .cover-stats .icon { width: 13px; height: 13px; }
    .page-body { margin-top: -10px; padding-bottom: 24px; }
    .categories { grid-template-columns: repeat(4,minmax(0,1fr)); padding: 5px; }
    .category { min-height: 36px; gap: 6px; font-size: 13px; }
    .catalog-head h2 { font-size: 23px; gap: 7px; }
    .catalog-head { margin: 17px 0 10px; }
    .connection { font-size: 11px; }
    .atlas-layout { gap: 12px; }
    #pet-list { max-height: 138px; }
    .pet-entry { grid-template-columns: 33px minmax(0,1fr); padding: 6px 5px; align-content: center; column-gap: 6px; row-gap: 0; }
    .list-art { width: 33px; height: 35px; grid-row: 1/3; }
    .entry-name { font-size: 13px; }
    .entry-copy { display: contents; }
    .entry-id { display: none; }
    .entry-level { grid-column: 2; font-size: 10px; }
    .index-title h3,.section-title { font-size: 16px; }
    .detail-identity { gap: 14px; padding: 13px; }
    .detail-art { width: 76px; height: 76px; }
    .detail-identity::after { width: 103px; }
    .recipe-section,.area-section { padding: 14px 13px; }
    .recipe-tools-hint { flex-basis: 100%; }
    .recipe-tool { font-size: 12px; }
    .recipe-dialog[open] { width: 100%; height: 100%; height: 100dvh; padding: 10px; border: 0; border-radius: 0; }
    .section-heading { margin-bottom: 9px; }
    .site-footer .wrap { min-height: 48px; }
}
@media (max-width: 365px) {
    .site-nav { gap: 10px; }
    .site-nav .icon { display: none; }
    .search-box { padding-inline: 7px; }
    .index-tools { padding-inline: 10px; gap: 7px; }
}
