:root {
  color-scheme: dark;
  --night: #101525;
  --panel: #181e32;
  --gold: #f6c778;
  --paper: #fff1d9;
  --soft: #c3c4d1;
  --line: #f5ddaf36;
  --body: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --display: "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", serif;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 1rem; }
body { margin: 0; background: var(--night); color: var(--paper); font: 1rem/1.65 var(--body); }
a { color: inherit; text-decoration: none; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
svg { width: 1.5rem; height: 1.5rem; flex: none; }
h1, h2, p { margin: 0; }
h1, h2, .brand { font-family: var(--display); font-weight: 700; }
.wrap { width: min(100% - 6vw, 1320px); margin-inline: auto; }
.skip { position: fixed; z-index: 10; left: 1rem; top: 1rem; padding: .5rem 1rem; background: var(--gold); color: var(--night); transform: translateY(-200%); }
.skip:focus { transform: none; }
.top { z-index: 2; position: relative; border-bottom: 1px solid var(--line); background: #111628; }
.top-inner { min-height: 4.4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-size: clamp(1.25rem, 2vw, 1.75rem); white-space: nowrap; letter-spacing: .05em; }
.brand svg { color: var(--gold); width: 2rem; height: 2rem; }
.top nav { display: flex; flex-wrap: wrap; gap: .3rem clamp(1rem, 3vw, 2.5rem); align-items: center; }
.top nav a { display: flex; align-items: center; position: relative; min-height: 3.5rem; color: var(--soft); font-size: .95rem; white-space: nowrap; }
.top nav a:hover, .top nav a[aria-current] { color: var(--gold); }
.top nav a[aria-current]::after { content: ""; position: absolute; height: 2px; left: 0; right: 0; bottom: 0; background: var(--gold); }
.hero { position: relative; isolation: isolate; overflow: hidden; background: #121938; }
.hero-art { position: absolute; inset: 0; z-index: -2; background: url("./tavern.webp") 67% 50% / cover no-repeat; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg,#10162ff2 0%,#10162fcd 29%,#10162f48 55%,transparent 74%), linear-gradient(0deg,var(--night),transparent 24%); }
.hero-inner { min-height: clamp(31rem, 43vw, 41rem); display: flex; align-items: center; padding-block: 3rem 5.2rem; }
.hero-copy { max-width: 42rem; }
.hero-label { color: #f9dca6; letter-spacing: .19em; display: flex; align-items: center; gap: .75rem; }
.hero-label::before { content: ""; display: inline-block; background: #f9dca6; width: 1.6rem; height: 1px; }
.hero h1 { font-size: clamp(2.85rem, 5.1vw, 5.35rem); line-height: 1.22; letter-spacing: -.055em; margin: .7rem 0 .55rem; text-shadow: 0 3px 25px #070b17; }
.hero-note { color: #f2e8da; font-size: clamp(1rem, 1.6vw, 1.15rem); }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.65rem; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 3rem; padding: .52rem 1.15rem; border-radius: .4rem; border: 1px solid var(--gold); font-weight: 700; }
.primary { background: var(--gold); color: #201811; }
.primary:hover { background: #ffdb9b; }
.secondary { color: var(--paper); border-color: #f9e4bb88; background: #151b39b0; }
.secondary:hover { background: #303b65; }
.home-grid { position: relative; margin-top: -1.3rem; display: grid; grid-template-columns: 1fr 1.1fr; gap: 1rem; }
.panel { border: 1px solid var(--line); border-radius: .8rem; background: linear-gradient(145deg,#1b2138,var(--panel) 78%); padding: clamp(1rem, 2.6vw, 1.65rem); }
.section-title { display: flex; align-items: baseline; gap: .75rem; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: .55rem; margin-bottom: .35rem; }
.section-title h2 { font-size: clamp(1.35rem, 2.15vw, 1.95rem); }
.section-title a, .source-note a { color: var(--gold); font-size: .9rem; white-space: nowrap; }
.section-title a:hover, .source-note a:hover { text-decoration: underline; text-underline-offset: .24em; }
.news-row { min-height: 3.25rem; display: flex; align-items: center; gap: .6rem; border-bottom: 1px solid var(--line); }
.news-row:last-child { border-bottom: 0; }
.news-row svg, .mini svg, .library-links svg { color: var(--gold); }
.news-row small { margin-inline-start: auto; color: var(--soft); font-size: .82rem; white-space: nowrap; }
.news-row:hover, .mini:hover, .library-links a:hover { color: var(--gold); }
.mini-grid, .library-links { display: grid; gap: .55rem; padding-top: .55rem; }
.mini-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.mini { min-height: 5.25rem; display: grid; justify-items: center; align-content: center; gap: .35rem; border: 1px solid var(--line); border-radius: .5rem; background: #0e14272e; }
.mini:hover, .library-links a:hover { border-color: #f6c77888; }
.mini svg { width: 1.8rem; height: 1.8rem; }
.library-panel { grid-column: 1 / -1; }
.library-links { grid-template-columns: repeat(4,minmax(0,1fr)); }
.library-links a { min-height: 3.25rem; display: flex; align-items: center; gap: .6rem; justify-content: center; border: 1px solid var(--line); border-radius: .45rem; }
.info-panel h2 { display: flex; align-items: center; gap: .55rem; font-size: 1.45rem; }
.info-panel h2 svg { color: var(--gold); }
.info-panel p { margin-top: .35rem; color: var(--soft); }
.info-link { margin-top: .75rem; }
.plain-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-copy { color: var(--soft); padding-top: .6rem; grid-column: 1 / -1; }
.library-links a { padding-inline: .45rem; overflow-wrap: anywhere; }
.news-row span { overflow-wrap: anywhere; }
.page-intro { padding: 3.3rem 0 2.7rem; background: linear-gradient(90deg,#11182af5 18%,#11182a91),url("./tavern.webp") center 38%/cover; border-bottom: 1px solid var(--line); }
.page-intro h1 { font-size: clamp(2.1rem, 4.2vw, 3.8rem); line-height: 1.25; margin-bottom: .5rem; }
.page-intro p, .article > p:last-child, .job > p, .resource p, .source-note { color: var(--soft); }
.content { padding-block: 1.5rem 2.1rem; }
.narrow { max-width: 950px; display: grid; gap: .9rem; }
.article h2 { font-size: 1.5rem; margin-bottom: .3rem; }
.tag { color: var(--gold); font-size: .9rem; }
.jump { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.jump a { min-height: 2.75rem; display: flex; align-items: center; padding: .25rem .8rem; border: 1px solid var(--line); border-radius: .4rem; color: var(--paper); }
.jump a:hover { border-color: var(--gold); color: var(--gold); }
.card-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .85rem; }
.job { display: grid; grid-template-columns: auto 1fr; gap: .65rem .85rem; align-content: start; }
.job > p { grid-column: 1 / -1; }
.job-icon { display: grid; align-self: center; place-items: center; width: 2.85rem; aspect-ratio: 1; background: #f6c77819; border: 1px solid var(--line); border-radius: .45rem; color: var(--gold); }
.job-title h2, .resource h2 { font-size: 1.45rem; line-height: 1.35; }
.job .job-next { padding-top: .5rem; border-top: 1px solid var(--line); }
.job-next strong { color: var(--paper); margin-right: .25rem; }
.source-note { margin-top: 1rem; font-size: .92rem; }
.resource-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.resource h2 { display: flex; gap: .55rem; align-items: center; margin-bottom: .65rem; }
.resource h2 svg { color: var(--gold); }
.resource .resource-status { border-top: 1px solid var(--line); margin-top: .7rem; padding-top: .65rem; color: var(--gold); font-size: .9rem; }
:target.panel { border-color: var(--gold); }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .45rem 1rem; margin-top: 2rem; padding-block: .95rem 1.4rem; border-top: 1px solid var(--line); color: var(--soft); font-size: .86rem; }
.footer a { color: var(--paper); }
.portal { --portal-paper: #fff2dc; background: var(--portal-paper); }
.portal-shell {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 21rem;
  padding: clamp(1.8rem, 5vh, 3.6rem) clamp(1rem, 5vw, 4rem) clamp(1.6rem, 6vh, 4.5rem);
  background: var(--portal-paper);
}
.portal-shell::before, .portal-shell::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.portal-shell::before { z-index: -2; background: url("./guild-portal.webp") center 49% / cover no-repeat; }
.portal-shell::after { z-index: -1; background: linear-gradient(180deg,#fff6e22b 0%,transparent 29%,transparent 74%,#fff2dc83 100%); }
.portal-heading { display: grid; justify-items: center; }
.portal-heading img {
  display: block;
  width: clamp(11rem, 23vw, 21rem);
  height: auto;
  max-height: min(29svh, 17rem);
  object-fit: contain;
  filter: drop-shadow(0 7px 12px #62364251);
}
.portal-nav { width: min(100%, 71rem); display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: clamp(.55rem, 1.7vw, 1.3rem); }
.portal-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.45rem, 1.4vw, 1rem);
  padding: .7rem .5rem;
  min-height: clamp(3.8rem, 7vw, 5.4rem);
  border: 2px solid #ffe4b6;
  border-radius: .9rem;
  background: linear-gradient(180deg,#fff8fa,#ffe1ef 58%,#fac3e2);
  box-shadow: inset 0 0 0 3px #fff8f4aa, 0 4px 0 #a66489, 0 9px 17px #76425d45;
  color: #4b2150;
  font-size: clamp(1rem, 2vw, 1.65rem);
  font-weight: 750;
  white-space: nowrap;
}
.portal-nav a:nth-child(even) { background: linear-gradient(180deg,#fef9ff,#eee1ff 58%,#dbbdf1); }
.portal-nav a svg { width: clamp(1.15rem, 2.3vw, 2rem); height: clamp(1.15rem, 2.3vw, 2rem); color: #84246f; }
.portal-nav a:hover { transform: translateY(-3px); filter: brightness(1.09); }
.portal-nav a:active { transform: translateY(2px); }
.portal-nav a:focus-visible { outline: 3px solid #fff; outline-offset: 5px; }
@media (prefers-reduced-motion: no-preference) {
  .portal-nav a { transition: transform .18s, filter .18s; }
}
@media (max-width: 850px) {
  .card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hero-inner { min-height: 30rem; }
  .hero-art { background-position: 65% 50%; }
}
@media (max-width: 650px) {
  .portal-shell { gap: 14rem; }
  .portal-shell::before {
    inset: 16% 0 auto;
    aspect-ratio: 15 / 17;
    background-size: 170% auto;
    background-position: center;
    mask-image: linear-gradient(180deg, transparent, #000 21% 75%, transparent);
  }
  .portal-shell::after { background: linear-gradient(180deg,transparent 55%,var(--portal-paper) 81%); }
  .portal-nav { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem; }
  .wrap { width: calc(100% - 2rem); }
  .top-inner { display: block; padding-top: .55rem; }
  .top nav { justify-content: space-between; gap: .15rem .45rem; }
  .top nav a { min-height: 2.75rem; font-size: .875rem; }
  .hero-inner { min-height: 33rem; align-items: flex-end; padding-block: 13rem 2.55rem; }
  .hero-art { inset: 0 0 5rem; background-position: 70% 38%; }
  .hero::after { background: linear-gradient(0deg,var(--night) 0%,#101525f7 20%,#101525b8 40%,#11162a15 79%); }
  .hero h1 { font-size: clamp(2.25rem, 9.6vw, 3.75rem); }
  .hero-label { font-size: .9rem; }
  .actions { margin-top: 1rem; }
  .home-grid { grid-template-columns: 1fr; margin-top: 0; }
  .library-links { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .news-row small { display: none; }
  .page-intro { padding: 2.25rem 0 1.8rem; }
  .card-grid { grid-template-columns: 1fr; }
}
