/* One reading column gives the cover, heading and Markdown the same edges. */
.article-main>.shell{width:calc(100% - var(--feed-left) - var(--feed-right));max-width:800px;margin-inline:auto}
.article-main .article-cover{width:100%;max-width:none;margin:24px 0 28px}
.article-main .article-header{width:100%;max-width:none;margin:0 0 32px}
.article-main .article-header h1{font-size:36px;line-height:1.6;margin:12px 0 18px;overflow-wrap:anywhere}
.article-main .article-header>p{line-height:1.9}
.article-main .article-byline{margin-top:20px}
.article-main .article-layout{display:block;width:100%;margin:0}
.article-main .article-layout>.prose{width:100%;margin:0}
.article-main .cms-article-actions{margin:12px 0 20px}
.article-main .mobile-toc{display:block;margin:0 0 28px;font-size:16px}
.article-main .mobile-toc details{padding:14px 18px;border:1px solid var(--line);border-radius:5px;background:var(--cream)}
.article-main .mobile-toc summary{font-weight:700;cursor:pointer}
.article-main .mobile-toc ol{margin:12px 0 0;padding-left:24px}
.article-main .mobile-toc li{line-height:1.8;margin:6px 0}
.article-main .cms-markdown .article-inline-figure{display:block;margin:24px 0 12px;padding:10px;background:#fff;border:1px solid #bfa888;border-radius:5px;line-height:0}
.article-main .cms-markdown .article-inline-figure img{display:block;width:100%;height:auto}
.article-main .cms-markdown .article-inline-figure+p>em{font-style:normal;font-size:14px}
/* Keep article tables legible on both published and editing views. */
.article-main .cms-markdown table,.cms-preview-panel .cms-markdown table{display:block;max-width:100%;overflow-x:auto;border-collapse:collapse;margin:24px 0;font-size:16px}
.article-main .cms-markdown th,.article-main .cms-markdown td,.cms-preview-panel .cms-markdown th,.cms-preview-panel .cms-markdown td{border:1px solid #907457;padding:10px 12px;text-align:left;vertical-align:top}
.article-main .cms-markdown th,.cms-preview-panel .cms-markdown th{background:#e5d2b3;font-weight:700}
html[data-theme="dark"] :is(.article-main .cms-markdown th,.article-main .cms-markdown td,.cms-preview-panel .cms-markdown th,.cms-preview-panel .cms-markdown td){border-color:#bca384}
html[data-theme="dark"] :is(.article-main .cms-markdown th,.cms-preview-panel .cms-markdown th){background:#4d392a}
/* Strong chapter bands, inset section panels and a simple detail rule. */
.article-main .prose h2,.cms-markdown h2.article-heading{margin:72px 0 32px;padding:24px 28px;border:0;border-bottom:6px solid #b28a67;border-radius:4px;background:#4d2b1d;color:#fff;font-size:28px;font-weight:800;line-height:1.65;overflow-wrap:anywhere;scroll-margin-top:110px}
.article-main .prose h3,.cms-markdown h3.article-heading{margin:48px 0 24px;padding:16px 20px;border:0;border-left:6px solid #70472e;background:#e9d9bd;color:#24170f;font-size:23px;font-weight:800;line-height:1.7;overflow-wrap:anywhere;scroll-margin-top:110px}
.article-main .prose h4,.cms-markdown h4.article-heading{margin:32px 0 18px;padding:5px 0 5px 15px;border:0;border-left:4px solid #976d47;background:transparent;color:#24170f;font-size:20px;font-weight:800;line-height:1.7;overflow-wrap:anywhere;scroll-margin-top:110px}
.article-main .prose h2 *,.cms-markdown h2.article-heading *{color:inherit}
html[data-theme="dark"] :is(.article-main .prose h2,.cms-markdown h2.article-heading),html[data-theme="dark"] :is(.article-main .prose h2,.cms-markdown h2.article-heading) *{color:#fff!important}
html[data-theme="dark"] :is(.article-main .prose h3,.cms-markdown h3.article-heading){background:#3b2c20;border-left-color:#c39b76}
html[data-theme="dark"] :is(.article-main .prose h4,.cms-markdown h4.article-heading){border-left-color:#c39b76}
@media(max-width:600px){.article-main .prose h2,.cms-markdown h2.article-heading{margin:52px 0 26px;padding:20px 18px;font-size:23px}.article-main .prose h3,.cms-markdown h3.article-heading{margin:36px 0 20px;padding:13px 15px;font-size:21px}.article-main .prose h4,.cms-markdown h4.article-heading{font-size:18px;padding-left:12px}}
@media(max-width:850px){.article-main>.shell{width:auto;max-width:none;margin-left:var(--feed-left);margin-right:var(--feed-right)}.article-main .article-header h1{font-size:30px}}
@media(max-width:600px){.article-main .article-cover{margin:20px 0 24px}.article-main .article-header{margin-bottom:28px}.article-main .article-header h1{font-size:28px;line-height:1.65}.article-main .mobile-toc details{padding:12px 14px}}
.cms-markdown img[src*="/genshin-wiki-"]{display:block;max-width:min(100%,320px);height:auto;margin:1.5rem auto .5rem;border-radius:8px}

/* Shared article outline, including the editor preview. */
.article-toc{margin:0 0 38px;padding:16px 20px 20px;border:1px solid #c9b496;border-top:12px solid #70472e;background:#fff9ed;color:#302015;font-size:16px;line-height:1.65}
.article-toc details{padding:0}
.article-toc summary{display:flex;justify-content:center;align-items:baseline;gap:8px;cursor:pointer;font-size:21px;font-weight:800;list-style:none}
.article-toc summary::-webkit-details-marker{display:none}
.article-toc .toc-toggle{color:#8a422b;font-size:14px;font-weight:700}
.article-toc details[open] .toc-toggle::after{content:'[閉じる]'}
.article-toc details:not([open]) .toc-toggle::after{content:'[開く]'}
.article-toc .article-toc-list{list-style:none!important;margin:12px 0 0!important;padding:0!important}
.article-toc .article-toc-list .article-toc-list{margin:0 0 0 22px!important;padding:0!important}
.article-toc .article-toc-list li{list-style:none!important;margin:0!important;padding:0!important}
.article-toc .article-toc-list a{display:flex;align-items:baseline;gap:8px;padding:5px 3px;border-bottom:1px dotted #d8c8ad;color:#302015;text-decoration:none;font-weight:400;overflow-wrap:anywhere}
.article-toc .article-toc-list a::before{content:'●';flex:none;color:#8a422b;font-size:12px}
.article-toc .article-toc-list>li[data-toc-level='1']>a{font-weight:800}
.article-toc .article-toc-list>li[data-toc-level='1']>a::before{content:'▶';display:inline-grid;place-items:center;width:15px;height:15px;border-radius:50%;background:#4d2b1d;color:white;font-size:9px;line-height:1}
.article-toc .article-toc-list a:hover{text-decoration:underline;background:#f2e4cc}
.article-toc :is(a,summary):focus-visible{outline:3px solid #70472e;outline-offset:2px}
html[data-theme="dark"] .article-toc{background:#2b251e;border-color:#88775e;border-top-color:#b28a67}
html[data-theme="dark"] .article-toc .article-toc-list a{border-bottom-color:#71614e}
html[data-theme="dark"] .article-toc .article-toc-list a:hover{background:#493827}
html[data-theme="dark"] .article-toc .article-toc-list>li[data-toc-level='1']>a::before{background:#805b3d}
@media(max-width:600px){.article-toc{padding:14px 14px 16px}.article-toc .article-toc-list .article-toc-list{margin-left:16px!important}.article-toc summary{font-size:19px}}

/* Compact character portraits retain their original source captions. */
.cms-markdown .character-gallery{display:flex;flex-wrap:wrap;align-items:flex-start;gap:12px;margin:24px 0 32px}
.cms-markdown .character-card{width:120px;max-width:calc(50% - 6px);margin:0;padding:7px;background:#fff9ed;border:1px solid #c9b496;border-radius:5px;box-sizing:border-box}
.article-main .cms-markdown .character-card .article-inline-figure,.cms-markdown .character-card .article-inline-figure{display:block;width:100%;margin:0;padding:0;line-height:0;background:#eee2cc;border:0;border-radius:3px;overflow:hidden}
.cms-markdown .character-card .article-inline-figure:after{display:none}
.article-main .cms-markdown .character-card img,.cms-markdown .character-card img{display:block;width:100%;height:auto;aspect-ratio:1;max-width:none;margin:0;object-fit:cover;object-position:top;border-radius:3px}
.cms-markdown .character-card figcaption{margin:5px 0 0;font-size:11px;line-height:1.45;overflow-wrap:anywhere}
.cms-markdown .character-card figcaption strong{display:block;font-size:14px;line-height:1.4}
.cms-markdown .character-card figcaption>span{display:block;margin-top:3px}
.cms-markdown .character-card figcaption a{font-size:inherit}
html[data-theme="dark"] .cms-markdown .character-card{background:#2b251e;border-color:#88775e}
html[data-theme="dark"] .cms-markdown .character-card .article-inline-figure{background:#4d392a}

/* Place image credits together at the end of the article. */
.cms-markdown .image-sources{margin:56px 0 28px;padding:0 18px 14px;border:1px solid #c9b496;background:#fff9ed;border-radius:5px}
.article-main .prose .image-sources h2,.cms-markdown .image-sources h2{margin:0 -18px 12px;padding:12px 18px;border:0;border-bottom:3px solid #b28a67;background:#4d2b1d;color:#fff;font-size:19px;line-height:1.5}
.cms-markdown .image-sources ul{margin:0;padding-left:1.3em}
.cms-markdown .image-sources li{margin:8px 0;font-size:14px;line-height:1.7;overflow-wrap:anywhere}
html[data-theme="dark"] .cms-markdown .image-sources{background:#2b251e;border-color:#88775e}

/* Responsive tier chart: portraits stay compact and names remain readable. */
.cms-markdown .tier-chart{margin:24px 0 34px;border:1px solid #b99d7d;border-radius:5px;overflow:hidden;background:#fffaf0}
.cms-markdown .tier-row{display:grid;grid-template-columns:68px minmax(0,1fr);border-bottom:1px solid #d8c8ad}
.cms-markdown .tier-row:last-child{border-bottom:0}
.cms-markdown .tier-rank{display:grid;place-items:center;padding:8px 4px;background:#70472e;color:#fff;font-size:20px;font-weight:800}
.cms-markdown .tier-row:nth-child(2) .tier-rank{background:#8b5635}.cms-markdown .tier-row:nth-child(3) .tier-rank{background:#976b40}.cms-markdown .tier-row:nth-child(4) .tier-rank{background:#806b4e}.cms-markdown .tier-row:nth-child(5) .tier-rank{background:#607261}.cms-markdown .tier-row:nth-child(6) .tier-rank{background:#536c72}.cms-markdown .tier-row:nth-child(n+7) .tier-rank{background:#69635b}
.cms-markdown .tier-characters{display:flex;flex-wrap:wrap;gap:8px;align-content:start;padding:10px;min-width:0}
.cms-markdown .tier-character{position:relative;width:76px;min-width:0;text-align:center;line-height:1.2;background:#eee2cc;border:1px solid #c9b496;border-radius:4px;overflow:hidden}
.article-main .cms-markdown .tier-character img,.cms-markdown .tier-character img{display:block;width:100%;height:auto;aspect-ratio:1;object-fit:cover;margin:0;max-width:none;border:0;border-radius:0}
.cms-markdown .tier-name{display:block;min-height:29px;padding:4px 2px;color:#302015;font-size:11px;font-weight:700;overflow-wrap:anywhere}
.cms-markdown .tier-constellation{position:absolute;top:2px;left:2px;background:#39291fe8;color:white;font-size:10px;line-height:1;padding:2px;border-radius:2px}
html[data-theme="dark"] .cms-markdown .tier-chart{background:#2b251e;border-color:#88775e}
html[data-theme="dark"] .cms-markdown .tier-row{border-color:#71614e}html[data-theme="dark"] .cms-markdown .tier-character{background:#3d3023;border-color:#88775e}
@media(max-width:600px){.cms-markdown .tier-row{grid-template-columns:48px minmax(0,1fr)}.cms-markdown .tier-rank{font-size:16px}.cms-markdown .tier-characters{gap:6px;padding:7px}.cms-markdown .tier-character{width:65px}.cms-markdown .tier-name{font-size:10px}}

/* Full-screen image viewer uses the page's existing article images. */
.image-viewer{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:48px 56px;border:0;background:transparent;overflow:auto;box-sizing:border-box}
.image-viewer[open]{display:flex;align-items:center;justify-content:center}
.image-viewer::backdrop{background:rgba(21,16,12,.88)}
.image-viewer>img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;background:#fff;box-shadow:0 8px 36px #0008}
.image-viewer-close{position:fixed;right:16px;top:16px;display:grid;place-items:center;width:44px;height:44px;padding:0;border:1px solid #fff;border-radius:50%;background:#302015;color:#fff;font:32px/1 sans-serif;cursor:pointer}
.image-viewer-close:focus-visible{outline:3px solid #fff;outline-offset:3px}
@media(max-width:600px){.image-viewer{padding:60px 16px 24px}}

.cms-markdown .tier-character .tier-image{display:block;line-height:0;cursor:zoom-in;background:transparent;padding:0}
.cms-markdown .tier-character .tier-character-link{display:block;line-height:0;cursor:pointer;background:transparent;padding:0}
.character-detail .character-info-icon{display:block;flex:0 0 40px;width:40px;height:40px;object-fit:contain;margin:0;border:0;border-radius:5px;background:#eee2cc}
.character-detail .character-info-icon[hidden]{display:none}
.character-material-name{display:flex;align-items:center;gap:8px;min-width:0}
.character-effect-list{list-style:none;padding:0!important}
.character-effect-list li{display:flex;align-items:flex-start;gap:10px;margin:.75em 0}
.character-detail .character-effect-list .character-info-icon{background:#664532}

.image-viewer-icon>img{width:min(70vw,360px);height:auto}
.cms-markdown table .article-inline-figure,.article-main .cms-markdown table .article-inline-figure{display:inline-block;vertical-align:middle;width:54px;min-width:54px;margin:2px 6px 2px 0;padding:0;border:1px solid #bfa888;background:#eee2cc;border-radius:4px;overflow:hidden;line-height:0}
.cms-markdown table .article-inline-figure img{width:100%;height:auto;aspect-ratio:1;object-fit:cover}
.cms-markdown table .article-inline-figure:after{display:none}

/* Filters use the same warm palette as the article outline. */
.tier-controls[hidden],.tier-row[hidden],.tier-character[hidden],.tier-empty[hidden]{display:none!important}
.tier-controls{margin:20px 0 12px;border:1px solid #c9b496;border-radius:5px;background:#fff9ed;overflow:hidden}
.tier-role-buttons{display:flex;flex-wrap:wrap;gap:6px;padding:10px;background:#e9d9bd}
.tier-filter-row{display:flex;align-items:flex-start;gap:12px;padding:9px 12px;border-top:1px solid #e1d1ba;font-size:14px}
.tier-filter-row>span{min-width:76px;padding-top:6px;font-weight:800}
.tier-filter-row>div{display:flex;flex-wrap:wrap;gap:6px}
.tier-controls button{min-height:36px;padding:6px 13px;border:1px solid #ad9174;border-radius:4px;background:#fffdf7;color:#382318;font:inherit;font-weight:700;cursor:pointer}
.tier-controls button[aria-pressed="true"]{background:#70402a;border-color:#70402a;color:white}
.tier-controls button:focus-visible{outline:3px solid #c67543;outline-offset:2px}
.tier-filter-note{margin:0!important;padding:4px 12px 12px;font-size:13px;line-height:1.6}
.tier-result{margin:12px 0!important;font-size:14px;font-weight:700}
.tier-empty{padding:16px;background:#fff9ed;border:1px solid #c9b496}
html[data-theme="dark"] .tier-controls,html[data-theme="dark"] .tier-empty{background:#2b251e;border-color:#88775e}
html[data-theme="dark"] .tier-role-buttons{background:#48362a}
html[data-theme="dark"] .tier-controls button{background:#3d3023;color:#fff;border-color:#aa9075}
html[data-theme="dark"] .tier-controls button[aria-pressed="true"]{background:#a35f3c;color:#fff}
@media(max-width:600px){.tier-role-buttons{gap:5px}.tier-controls button{padding:6px 9px;font-size:13px}.tier-filter-row{display:block}.tier-filter-row>span{display:block;padding:0 0 6px}}

.weapon-controls[hidden],.weapon-row[hidden],.weapon-card[hidden],.weapon-empty[hidden]{display:none!important}
.weapon-controls{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:18px 0;padding:12px;border:1px solid #c9b496;border-radius:5px;background:#fff9ed}
.weapon-controls>span{font-weight:800}.weapon-controls>div{display:flex;flex-wrap:wrap;gap:6px}.weapon-controls small{font-size:12px}
.weapon-controls button{min-height:36px;padding:6px 12px;border:1px solid #ad9174;border-radius:4px;background:#fffdf7;color:#382318;font:inherit;font-size:14px;font-weight:700;cursor:pointer}
.weapon-controls button[aria-pressed="true"]{background:#70402a;border-color:#70402a;color:white}.weapon-controls button:focus-visible{outline:3px solid #c67543;outline-offset:2px}
.weapon-result{margin:12px 0!important;font-size:14px;font-weight:700}.weapon-chart{border:1px solid #b99d7d;border-radius:5px;overflow:hidden;background:#fffaf0}
.weapon-row{display:grid;grid-template-columns:68px minmax(0,1fr);border-bottom:1px solid #d8c8ad}.weapon-row:last-child{border-bottom:0}
.weapon-rank{display:grid;place-items:center;background:#70472e;color:#fff;font-size:20px;font-weight:800}.weapon-row:nth-child(2) .weapon-rank{background:#8b5635}.weapon-row:nth-child(3) .weapon-rank{background:#976b40}.weapon-row:nth-child(4) .weapon-rank{background:#806b4e}.weapon-row:nth-child(5) .weapon-rank{background:#607261}
.weapon-entries{display:flex;flex-wrap:wrap;align-content:start;gap:8px;padding:10px}.weapon-card{width:108px;min-width:0;overflow:hidden;border:1px solid #c9b496;border-radius:4px;background:#f3e8d4;text-align:center;line-height:1.25}
.weapon-art{display:flex;align-items:center;justify-content:center;height:65px;background:#e5d3b7;color:#75492f}.weapon-art svg{width:52px;height:52px}.weapon-art a{display:block;height:100%}.weapon-art img{display:block;width:65px;height:65px;object-fit:cover;margin:0!important;border-radius:0!important}
.weapon-card strong{display:block;padding:5px 3px 2px;font-size:12px;overflow-wrap:anywhere}.weapon-meta{display:block;padding:0 2px 5px;font-size:10px;color:#6a4b34}.weapon-empty{padding:16px;background:#fff9ed;border:1px solid #c9b496}
html[data-theme="dark"] .weapon-controls,html[data-theme="dark"] .weapon-chart,html[data-theme="dark"] .weapon-empty{background:#2b251e;border-color:#88775e}html[data-theme="dark"] .weapon-controls button{background:#3d3023;color:#fff;border-color:#aa9075}html[data-theme="dark"] .weapon-controls button[aria-pressed="true"]{background:#a35f3c;color:#fff}html[data-theme="dark"] .weapon-card{background:#3d3023;border-color:#88775e}html[data-theme="dark"] .weapon-meta{color:#e2c5a7}
@media(max-width:600px){.weapon-row{grid-template-columns:48px minmax(0,1fr)}.weapon-rank{font-size:16px}.weapon-entries{gap:6px;padding:7px}.weapon-card{width:86px}.weapon-controls button{padding:6px 9px;font-size:13px}}
.article-main .cms-markdown .article-reference,.article-main .cms-markdown .article-reference:hover{color:inherit;background:transparent;font-weight:inherit;text-decoration:underline;text-underline-offset:.15em}
html[data-theme="dark"] .article-main .cms-markdown .article-reference,html[data-theme="dark"] .article-main .cms-markdown .article-reference:hover{color:inherit!important}
.article-main .share-row{display:none}
.character-profile{display:flex;align-items:center;gap:1.25rem;margin:2rem 0;padding:1.3rem;background:#fffaf0;border:1px solid #c8a780;border-radius:.5rem}
.character-profile img{width:100px;height:100px;object-fit:cover;border-radius:.4rem;background:#eadcc5}
.character-profile h1{margin:.4rem 0;font-size:clamp(1.7rem,4vw,2.5rem)}
.character-profile p{margin:0}
.character-toc{padding:1rem 1.3rem;background:#fff9ed;border-top:.4rem solid #74503b;border-radius:.25rem}
.character-toc ul{margin:.4rem 0 0;padding-left:1.4rem;columns:2}
.character-toc li{break-inside:avoid;margin:.2rem 0}
.character-pending{padding:.8rem 1rem;border-left:.25rem solid #b18a5d;background:#fff8e9}
.character-table-wrap{overflow-x:auto}
.character-material-table{width:100%;border-collapse:collapse;background:#fffaf0}
.character-material-table th,.character-material-table td{padding:.6rem .8rem;border:1px solid #d9c5a7;text-align:left}
.character-material-table td{width:7rem;text-align:right;white-space:nowrap}
.character-index{display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));gap:.75rem}
.character-index-card{display:flex;flex-direction:column;align-items:center;gap:.35rem;padding:.6rem;border:1px solid #c8a780;border-radius:.4rem;background:#fffaf0;text-align:center}
.character-index-card img{width:64px;height:64px;object-fit:cover;border-radius:.25rem}
.character-teams{display:grid;gap:1rem}
.character-team{padding:.8rem;background:#fffaf0;border:1px solid #d9c5a7;border-radius:.4rem}
.character-team h3{margin:0 0 .7rem;font-size:1rem}
.character-team-members{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.5rem}
.character-team-member{display:flex;flex-direction:column;align-items:center;gap:.25rem;text-align:center;word-break:break-word;font-size:.85rem}
.character-team-member img{width:64px;height:64px;object-fit:cover;border-radius:.3rem;background:#eadcc5}
@media(max-width:600px){.character-profile{gap:.8rem}.character-profile img{width:76px;height:76px}.character-toc ul{columns:1}}
