/* Adapted from the Star Rail archive's wiki shell, chapter cards, and reading navigation. */
:root {
  --ink: #27323e;
  --muted: #5b6c76;
  --blue: #366677;
  --gold: #c9a96d;
  --line: #d5dee1;
  --paper: #fff;
  --ground: #edf1f1;
  --tint: #e6eeeb;
  --tag: #315f58;
  --nav: #222d39;
  --hero: #204440;
  --on-hero: #eaf1e6;
  --ui: system-ui, "Microsoft YaHei", "PingFang SC", sans-serif;
  --serif: "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  color-scheme: light;
}
:root[data-game="zzz"] {
  --tag: #6b6118;
  --tint: #f4f1d9;
  --hero: #32312e;
  --on-hero: #f1efcc;
  --gold: #ebe452;
  --nav: #1e1e22;
  --serif: var(--ui);
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--ground);
  font: 15px/1.65 var(--ui);
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
button,
a,
input,
select,
summary {
  outline-offset: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid #b78737;
}
button {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin: 0;
}
::selection {
  background: #d0e4d6;
}
.skip {
  position: fixed;
  left: 12px;
  top: -60px;
  background: white;
  z-index: 10;
  padding: 8px;
}
.skip:focus {
  top: 12px;
}
.topbar {
  background: var(--nav);
  color: #edf1f1;
  box-shadow: inset 0 -1px #4b5661;
}
.top-inner {
  height: 73px;
  max-width: 1272px;
  padding: 0 36px;
  display: flex;
  align-items: center;
  gap: 48px;
  margin: auto;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: #f5f1e7;
  flex-shrink: 0;
}
.brand:hover {
  text-decoration: none;
}
.brand strong {
  display: block;
  font-size: 21px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0.08em;
}
.brand small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.24em;
  color: #cdcfcc;
}
.brand-mark {
  height: 34px;
  width: 34px;
  position: relative;
  display: grid;
  place-items: center;
  color: var(--gold);
  transform: rotate(45deg);
  border: 1px solid currentColor;
}
.brand-mark:before,
.brand-mark:after {
  content: "";
  position: absolute;
  background: var(--nav);
}
.brand-mark:before {
  inset: 7px -2px;
}
.brand-mark:after {
  inset: -2px 7px;
}
.brand-mark i {
  z-index: 1;
  display: block;
  width: 16px;
  height: 16px;
  background: currentColor;
  clip-path: polygon(
    0 0,
    50% 23%,
    100% 0,
    77% 50%,
    100% 100%,
    50% 77%,
    0 100%,
    23% 50%
  );
}
/* A scan-lined tube and twin aerials mark the New Eridu archive. */
[data-game="zzz"] .brand-mark {
  width: 1.95em;
  height: 1.4em;
  margin: .22em .1em 0;
  border: 2px solid currentColor;
  border-radius: 22% / 27%;
  transform: rotate(-6deg);
}
[data-game="zzz"] .brand-mark::before,
[data-game="zzz"] .brand-mark::after {
  inset: auto auto 100% 46%;
  width: 2px;
  height: .5em;
  transform-origin: bottom;
  transform: rotate(-51deg);
  background: currentColor;
}
[data-game="zzz"] .brand-mark::after {
  height: .64em;
  transform: rotate(42deg);
}
[data-game="zzz"] .brand-mark i {
  width: 70%;
  height: 55%;
  border-radius: 18% / 32%;
  clip-path: none;
  background: repeating-linear-gradient(0deg, currentColor 0 1.5px, transparent 1.5px 3px);
}
[data-game="zzz"] .brand strong,
[data-game="zzz"] .hero h1 {
  font-weight: 900;
  letter-spacing: -.025em;
}
[data-game="zzz"] .hero:after {
  background:
    linear-gradient(90deg, #19191ef2, #201e22d9 34%, #302a2e30 75%, transparent),
    repeating-linear-gradient(0deg, transparent 0 3px, #15121921 3px 4px);
}
[data-game="zzz"] .open-story {
  background: var(--gold);
  border-color: var(--gold);
  color: #202020;
}
[data-game="zzz"] .open-story:hover {
  background: #fff683;
}
.topnav {
  display: flex;
  align-self: stretch;
  gap: 24px;
}
.topnav a {
  display: flex;
  align-items: center;
  white-space: nowrap;
  padding: 3px 0 0;
  border-bottom: 3px solid transparent;
  color: #c6ced3;
  font-size: 14px;
}
.topnav a[aria-current="page"] {
  border-color: var(--gold);
  color: #f1e5cb;
  font-weight: 650;
}
.topnav a:hover {
  color: white;
  text-decoration: none;
}
#search-form {
  margin-left: auto;
  display: flex;
  align-items: center;
  width: 245px;
  background: #343f4b;
  border: 1px solid #52606d;
  border-radius: 4px;
}
#query {
  width: 100%;
  min-width: 0;
  border: 0;
  background: none;
  color: #fff;
  font-size: 13px;
  padding: 8px 10px;
  outline-offset: 0;
}
#query::placeholder {
  color: #c0cad1;
}
.search-button {
  border: 0;
  background: transparent;
  color: #dce0df;
  width: 38px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
}
.search-button i {
  width: 13px;
  height: 13px;
  border: 1.8px solid currentColor;
  border-radius: 50%;
  position: relative;
}
.search-button i:after {
  content: "";
  width: 6px;
  height: 1.8px;
  background: currentColor;
  position: absolute;
  right: -5px;
  bottom: -2px;
  transform: rotate(45deg);
}
.shell {
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr);
  align-items: start;
  max-width: 1272px;
  margin: auto;
  padding: 28px 36px 48px;
  gap: 28px;
  min-height: calc(100dvh - 135px);
}
.sidebar {
  position: sticky;
  top: 18px;
  min-width: 0;
}
.side-group {
  margin: 0 0 22px;
}
.side-title {
  font-size: 12px;
  letter-spacing: 0.09em;
  color: #55656b;
  margin: 0 0 9px;
  font-weight: 700;
}
.side-nav {
  display: grid;
  gap: 2px;
}
.side-nav a {
  color: var(--muted);
  border-left: 3px solid transparent;
  padding: 8px 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.side-nav a small {
  font-variant-numeric: tabular-nums;
  color: #65756f;
}
.side-nav a.active {
  color: var(--tag);
  border-color: var(--tag);
  font-weight: 700;
  background: var(--tint);
}
.side-nav a:hover {
  color: var(--ink);
  background: var(--paper);
  text-decoration: none;
}
.side-note {
  border-top: 1px solid var(--line);
  padding-top: 15px;
  color: var(--muted);
  font-size: 12px;
  display: grid;
  gap: 4px;
}
.side-note strong {
  color: var(--ink);
}
#nav-toggle {
  display: none;
}
main {
  min-width: 0;
  outline: none;
}
main:focus:not(:focus-visible) {
  outline: none;
}
.hero {
  background: var(--hero);
  color: var(--on-hero);
  position: relative;
  isolation: isolate;
  min-height: 220px;
  padding: 26px 32px 28px;
  overflow: hidden;
  border-left: 4px solid var(--gold);
  border-radius: 3px;
}
.hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.hero:after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    90deg,
    rgba(17, 36, 39, 0.93),
    rgba(24, 45, 47, 0.83) 30%,
    rgba(25, 43, 48, 0.2) 70%,
    transparent
  );
}
.hero-meta {
  font-size: 12px;
  letter-spacing: 0.09em;
  color: #e7d5a7;
}
.hero h1 {
  font: 650 clamp(28px, 3.2vw, 45px) / 1.28 var(--serif);
  letter-spacing: 0.04em;
  margin: 9px 0 9px;
  color: #fff;
}
.hero p {
  font-size: 13px;
  color: #e1e8e5;
  max-width: 47ch;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.open-story {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  padding: 5px 13px 6px;
  margin-top: 16px;
  background: #f4e7c9;
  border: 1px solid #ead9ac;
  border-radius: 3px;
  color: #263032;
  font-size: 13px;
  font-weight: 650;
}
.open-story:hover {
  color: #101921;
  background: #fff2d6;
  text-decoration: none;
}
.heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 23px 0 13px;
}
.heading h1,
.reading h1,
.paper h1 {
  font: 650 clamp(25px, 2.6vw, 33px) / 1.38 var(--serif);
  letter-spacing: 0.04em;
}
.heading h2,
.paper h2 {
  font-size: 21px;
  line-height: 1.5;
}
.heading > small,
.meta,
.muted,
.status {
  color: var(--muted);
  font-size: 13px;
}
.heading > small {
  white-space: nowrap;
}
.chapter-block {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  margin: 0 0 9px;
  overflow: hidden;
}
.chapter-block > summary {
  display: flex;
  align-items: center;
  gap: 13px;
  cursor: pointer;
  padding: 12px 17px 12px 15px;
  min-height: 58px;
  list-style: none;
  border-left: 3px solid #b1bfb5;
}
.chapter-block > summary::-webkit-details-marker {
  display: none;
}
.chapter-block > summary:hover {
  background: #f4f7f5;
}
.chapter-block[open] > summary {
  background: var(--tint);
  border-color: var(--tag);
}
.chapter-block summary strong {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.4;
}
.chapter-block summary small {
  margin-left: auto;
  font-size: 12px;
  white-space: nowrap;
  color: var(--muted);
}
.chapter-block .chevron {
  width: 8px;
  height: 8px;
  border-bottom: 1.5px solid var(--muted);
  border-right: 1.5px solid var(--muted);
  transform: rotate(45deg);
  margin: -3px 3px 0;
}
.chapter-block[open] .chevron {
  transform: rotate(225deg);
  margin-top: 5px;
}
.chapter-body {
  border-top: 1px solid var(--line);
  padding: 10px 17px 11px 24px;
}
.chapter-intro {
  font-size: 14px;
  color: var(--muted);
  padding: 3px 0 9px;
}
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rows li + li {
  border-top: 1px solid var(--line);
}
.rows a {
  padding: 10px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  justify-content: space-between;
}
.rows a:hover {
  color: var(--blue);
}
.rows .trail {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}
.paper,
.reading {
  padding: 24px 30px 29px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: 3px;
}
.paper h2 {
  margin-top: 22px;
}
.paper p {
  margin: 9px 0;
  max-width: 76ch;
}
.crumb {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 13px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.reading h1 {
  margin: 3px 0 7px;
}
.read-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 14px 0 17px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid #aebcc0;
  border-radius: 3px;
  font-size: 13px;
  padding: 6px 10px;
  min-height: 33px;
  cursor: pointer;
}
.btn:hover {
  text-decoration: none;
  background: var(--tint);
}
.btn.main-btn {
  background: var(--tag);
  border-color: var(--tag);
  color: white;
}
.plot-section {
  margin: 16px 0 23px;
}
.plot-section h2 {
  margin: 0 0 5px;
  color: var(--tag);
  font-size: 14px;
  letter-spacing: 0.04em;
}
.plot-section p {
  font-size: 16px;
  line-height: 1.9;
  margin: 4px 0 9px;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.plot-section ol {
  padding-left: 1.4em;
  line-height: 1.95;
  margin: 5px 0;
}
.dialogue-line {
  padding: 8px 0;
  margin: 0;
  line-height: 1.85;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.dialogue-line b {
  color: var(--tag);
  font-size: 14px;
}
.story-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 23px;
  padding-top: 15px;
}
.story-navigation a {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  align-items: start;
}
.story-navigation a.next {
  grid-column: 2;
  align-items: end;
  text-align: right;
}
.story-navigation small {
  font-size: 12px;
  color: var(--muted);
}
.site-foot {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.site-foot div {
  max-width: 1272px;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 15px 36px;
}
.site-foot a {
  color: var(--muted);
}
.status {
  padding: 14px 0;
  line-height: 1.8;
}
.import-status {
  font-size: 13px;
  color: var(--tag);
  min-height: 1.5em;
}
.src-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.state-pill {
  color: var(--tag);
  font-weight: 650;
  font-size: 12px;
}
.button-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.search-row small {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}
@media (min-width: 1400px) {
  .shell {
    gap: 34px;
    grid-template-columns: 218px minmax(0, 1fr);
  }
}
@media (max-width: 900px) {
  .top-inner {
    gap: 24px;
    padding-inline: 22px;
  }
  .topnav {
    gap: 15px;
  }
  #search-form {
    width: 190px;
  }
  .shell {
    gap: 18px;
    padding-inline: 22px;
    grid-template-columns: 165px minmax(0, 1fr);
  }
  .hero {
    padding: 25px;
  }
  .reading,
  .paper {
    padding: 20px;
  }
  .site-foot div {
    padding-inline: 22px;
  }
}
@media (max-width: 720px) {
  .top-inner {
    height: auto;
    display: grid;
    grid-template-columns: 1fr minmax(138px, 47%);
    gap: 8px 12px;
    padding: 11px 15px 0;
  }
  .brand {
    gap: 10px;
  }
  .brand-mark {
    width: 24px;
    height: 24px;
    margin: 0 4px;
  }
  .brand strong {
    font-size: 18px;
  }
  .brand small {
    font-size: 9px;
  }
  .topnav {
    order: 3;
    grid-column: 1/-1;
    justify-content: flex-start;
    gap: 26px;
  }
  .topnav a {
    padding: 6px 0 7px;
    font-size: 13px;
  }
  #search-form {
    width: 100%;
  }
  .shell {
    display: block;
    padding: 12px 13px 30px;
  }
  .sidebar {
    position: static;
    margin: 0 0 10px;
  }
  #nav-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    background: var(--paper);
    border: 1px solid var(--line);
    font-weight: 600;
    color: var(--tag);
    font-size: 13px;
    border-radius: 3px;
  }
  #side-content {
    display: none;
  }
  #side-content.shown {
    display: block;
    background: var(--paper);
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-top: 0;
  }
  .side-nav {
    grid-template-columns: 1fr 1fr;
  }
  .side-group {
    margin: 0 0 9px;
  }
  .side-title {
    display: none;
  }
  .side-note {
    display: none;
  }
  .hero {
    min-height: 198px;
    padding: 18px 17px 19px;
  }
  .hero p {
    max-width: 85%;
    font-size: 12px;
  }
  .hero h1 {
    font-size: 30px;
  }
  .hero:after {
    background: linear-gradient(90deg, #162926ed, #16292695 61%, transparent);
  }
  .paper,
  .reading {
    padding: 15px;
  }
  .heading {
    margin: 17px 0 10px;
  }
  .heading h2,
  .paper h2 {
    font-size: 19px;
  }
  .chapter-block > summary {
    padding: 10px;
    gap: 7px;
    min-height: 51px;
  }
  .chapter-block summary strong {
    font-size: 14px;
  }
  .chapter-body {
    padding: 9px 12px;
  }
  .site-foot div {
    padding-inline: 15px;
  }
  .plot-section p {
    font-size: 15px;
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #e0e7e9;
    --muted: #a8b7bd;
    --blue: #9ed2dc;
    --line: #3b4a51;
    --paper: #263239;
    --ground: #1c272d;
    --tint: #354b44;
    --tag: #a6d4bd;
  }
  :root[data-game="zzz"] {
    --tint: #414134;
    --tag: #e5d97f;
  }
  .side-title,
  .side-nav a small {
    color: var(--muted);
  }
  .chapter-block > summary:hover {
    background: var(--tint);
  }
  .btn.main-btn {
    color: #182821;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
