:root {
  color-scheme: dark;
  --ink: #ebead9;
  --sub: #a6b5aa;
  --gold: #ddc28b;
  --line: #51615a;
  --bg: #172b2e;
  --panel: #1c3032;
  --serif: 'Songti SC', 'STSong', 'Noto Serif CJK SC', serif;
  --sans: Inter, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font: 14px/1.5 var(--sans);
  background: var(--bg);
  color: var(--ink);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  background: transparent;
  cursor: pointer;
}
button,
a,
input,
select,
canvas {
  outline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
canvas:focus-visible {
  outline: 2px solid #f3d791;
}
button:hover,
a:hover {
  color: #fff4cd;
}
a {
  color: var(--gold);
  text-underline-offset: 3px;
}
svg {
  width: 18px;
  height: 18px;
  display: block;
  flex: none;
}
i {
  display: inline-flex;
  font-style: normal;
  align-items: center;
}
button {
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.42;
  cursor: default;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
button,
select,
input {
  border-radius: 4px;
}
header {
  height: 66px;
  padding: 0 19px;
  gap: 22px;
  display: flex;
  align-items: center;
  flex: none;
  position: relative;
  z-index: 8;
  background: linear-gradient(#23383b, #172a2c);
  border-bottom: 1px solid #ad925e;
  box-shadow: 0 2px 7px #131e2480;
}
.brand {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 10px;
  color: var(--gold);
  padding: 0;
}
.brand img {
  width: 42px;
}
.brand > span {
  font: 700 20px/1.12 var(--serif);
  letter-spacing: 0.13em;
  white-space: nowrap;
}
.brand small {
  display: block;
  letter-spacing: 0.28em;
  font:
    9px/1.4 Georgia,
    serif;
  margin-top: 3px;
  letter-spacing: 0.27em;
}
.yields {
  display: flex;
  gap: 18px;
  border-left: 1px solid var(--line);
  padding-left: 19px;
}
.yields button {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  padding: 4px;
}
.yields i {
  color: #a5ba96;
}
.yields button:nth-child(2) i {
  color: #e0bd77;
}
.yields button:nth-child(3) i {
  color: #cbb989;
}
.yields svg {
  width: 23px;
  height: 23px;
}
.yields span {
  font-size: 10px;
  color: #bdc3b7;
  white-space: nowrap;
}
.yields b {
  display: block;
  font: 600 13px/1.35 var(--sans);
  color: #f0e6ca;
  letter-spacing: 0.025em;
}
.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tool,
.dock button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tool {
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid #56635a;
  color: var(--gold);
}
#search-box {
  display: flex;
  align-items: center;
  position: relative;
  gap: 7px;
  height: 35px;
  border: 1px solid #626b5c;
  background: #102426;
  border-radius: 5px;
  padding: 0 9px;
  color: #c7b380;
}
#search-box svg {
  width: 15px;
}
#search {
  background: transparent;
  border: 0;
  width: clamp(105px, 14vw, 216px);
  font-size: 12px;
  outline: none;
}
#search::placeholder {
  color: #abb3a5;
}
kbd {
  font:
    11px/1.2 ui-monospace,
    monospace;
  color: var(--sub);
  border: 1px solid #69766b;
  border-radius: 3px;
  padding: 2px 5px;
}
main {
  position: relative;
  flex: 1;
  min-height: 0;
  isolation: isolate;
  overflow: hidden;
  background: #1d2f3a;
}
#map {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
.map-shadow {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 55px #0a1e2538;
  pointer-events: none;
}
.panel {
  background: linear-gradient(145deg, #22383af7, #162b2ef7);
  border: 1px solid #8b8365;
  border-radius: 6px;
  box-shadow:
    0 5px 18px #0b1a2580,
    0 0 0 2px #17262960;
  backdrop-filter: blur(10px);
}
.location {
  position: absolute;
  top: 15px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  pointer-events: none;
  background: #192d31e8;
  border: 1px solid #687267;
  border-radius: 4px;
  padding: 6px 10px;
  box-shadow: 0 2px 7px #17282b50;
}
.location b {
  font: 600 13px var(--serif);
  color: #e7d9b7;
}
.location span,
#zoom-level {
  font:
    10px ui-monospace,
    monospace;
  color: #c6cec0;
}
.map-tools {
  position: absolute;
  right: 15px;
  top: 15px;
  display: grid;
  border-radius: 5px;
  background: #1b3133ed;
  border: 1px solid #8b8365;
  box-shadow: 0 2px 7px #13252b60;
}
.map-tools button {
  display: grid;
  place-items: center;
  color: var(--gold);
  width: 35px;
  height: 35px;
  font-size: 21px;
}
.map-tools button + button {
  border-top: 1px solid #54615a;
  border-radius: 0;
}
#mini-wrap {
  position: absolute;
  left: 15px;
  bottom: 15px;
  width: 188px;
  padding: 5px 6px 6px;
}
.mini-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1;
  color: #ddcfaa;
  font: 600 12px var(--serif);
  margin: 0 3px 4px;
}
.mini-heading button {
  font-size: 17px;
  color: var(--sub);
}
#mini {
  display: block;
  width: 100%;
  aspect-ratio: 366/206;
  border: 1px solid #596b63;
  border-radius: 2px;
  cursor: crosshair;
}
#mini-show {
  position: absolute;
  bottom: 15px;
  left: 15px;
}
.dock-wrap {
  position: absolute;
  bottom: 15px;
  right: 15px;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.dock-wrap > * {
  pointer-events: auto;
}
.dock {
  display: flex;
  align-items: stretch;
  gap: 3px;
  padding: 5px;
}
.dock button {
  color: #dadcc8;
  min-height: 37px;
  padding: 0 11px;
  font-size: 13px;
  white-space: nowrap;
}
.dock button svg {
  color: #cebd90;
  width: 16px;
}
.dock button:hover,
.tool:hover,
.map-tools button:hover {
  background: #344a46;
}
.dock button.active,
.dock button[aria-expanded='true'] {
  color: #f6eaca;
  background: #4a5547;
  box-shadow: inset 0 0 0 1px #8d8969;
}
.dock button:last-child {
  border-left: 1px solid #57655c;
  border-radius: 0;
  padding-left: 13px;
}
.dock button:last-child svg {
  color: #a5c7b5;
}
#picker,
#legend {
  width: min(420px, calc(100vw - 30px));
  padding: 15px;
}
#picker {
  max-height: min(58dvh, 510px);
  overflow: auto;
}
#legend {
  width: auto;
  max-width: min(410px, calc(100vw - 30px));
  padding: 10px 14px;
}
#legend h3,
#picker h3 {
  font-size: 14px;
  color: var(--gold);
  margin: 0 0 6px;
}
.swatches {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #e3e4d5;
}
.swatches span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-right: 4px;
}
.swatches i {
  width: 14px;
  height: 9px;
  border: 1px solid #ffffff1c;
}
.muted,
small {
  color: var(--sub);
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--gold);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 6px 0 12px;
}
.chips button,
.chip,
.tabs button,
.action {
  padding: 6px 10px;
  border: 1px solid #51635b;
  color: #d4dece;
  background: #213738;
  font-size: 12px;
}
.chips button.active,
.tabs button.active,
.action:hover {
  background: #415345;
  border-color: #ac9b72;
  color: #ffefc4;
}
.checks {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.checks label {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 2px;
}
input[type='checkbox'] {
  accent-color: #cfb982;
}
#matches {
  color: var(--ink);
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: max(100%, 285px);
  padding: 4px;
  max-height: min(60dvh, 400px);
  overflow: auto;
}
.match {
  border-radius: 3px;
  background: transparent;
  display: flex;
  width: 100%;
  text-align: left;
  align-items: center;
  gap: 9px;
  padding: 9px;
}
.match[aria-selected='true'],
.match:hover {
  background: #354d47;
}
.match small {
  margin-left: auto;
}
.match i {
  color: var(--gold);
}
#tooltip {
  position: fixed;
  pointer-events: none;
  padding: 6px 11px;
  font-size: 12px;
  z-index: 4;
  max-width: 240px;
}
#tooltip b {
  color: #eadaac;
}
#tooltip small {
  margin-left: 7px;
}
.detail {
  position: absolute;
  left: 15px;
  top: 60px;
  width: 306px;
  max-height: calc(100% - 122px);
  overflow: auto;
  padding: 18px 18px 16px;
}
.close {
  position: absolute;
  right: 9px;
  top: 7px;
  width: 28px;
  height: 30px;
  color: var(--sub);
  font-size: 22px;
}
.detail h2,
#dialog-body h1 {
  font: 600 25px/1.4 var(--serif);
  color: #f1dfb7;
  margin: 4px 0;
}
.detail .en {
  font:
    italic 13px Georgia,
    serif;
  color: #b9c3b2;
}
.detail p,
.article p {
  font-size: 13px;
  line-height: 1.8;
  margin: 10px 0;
  color: #d6ded1;
}
.detail section {
  border-top: 1px solid #4f6057;
  margin-top: 11px;
  padding-top: 10px;
}
.detail h3 {
  font-size: 12px;
  color: #c9b784;
  margin-bottom: 5px;
}
.kv {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin: 4px 0;
  font-size: 12px;
}
.kv span {
  color: #b6c3b7;
}
.kv b {
  font-weight: 550;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.detail .action {
  margin-top: 7px;
}
.detail .source {
  font-size: 11px;
  line-height: 1.55;
  margin: 4px 0;
  color: var(--sub);
}
.badge {
  display: inline-block;
  background: #394c40;
  color: #e6d6a9;
  border: 1px solid #657358;
  border-radius: 3px;
  padding: 2px 6px;
  margin: 1px 4px 3px 0;
  font-size: 11px;
}
body:has(.detail:not([hidden])) #mini-wrap {
  visibility: hidden;
}
#loading {
  position: absolute;
  inset: 0;
  background: #192f33;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--gold);
  font: 18px var(--serif);
}
#loading img {
  width: 48px;
}
footer {
  min-height: 26px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 3px 16px;
  border-top: 1px solid #576354;
  color: #b8c2b2;
  background: #182b2d;
  font-size: 10px;
}
footer a,
footer button {
  font: inherit;
  color: var(--sub);
  padding: 0;
  text-decoration: none;
}
.foot-brand {
  color: var(--gold);
  letter-spacing: 0.12em;
}
#zoom-level {
  margin-left: auto;
}
dialog {
  border: 1px solid #9d9171;
  border-radius: 9px;
  background: #1b3032;
  color: var(--ink);
  padding: 0;
  width: min(795px, calc(100vw - 32px));
  max-height: 86dvh;
  box-shadow: 0 15px 70px #06121288;
  overflow: auto;
}
dialog::backdrop {
  background: #0f2024a8;
  backdrop-filter: blur(3px);
}
.dialog-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #203536;
  border-bottom: 1px solid #4d6057;
  padding: 7px 16px;
  position: sticky;
  top: 0;
  z-index: 2;
  color: #d6c08e;
}
.dialog-bar span {
  display: flex;
  align-items: center;
  gap: 7px;
  letter-spacing: 0.15em;
  font: 600 13px var(--serif);
}
.dialog-bar img {
  width: 25px;
}
.dialog-bar button {
  font-size: 24px;
  line-height: 1.2;
  min-width: 32px;
}
#dialog-body {
  padding: 21px 24px 26px;
}
.tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 10px 0 13px;
}
.article h2,
.explorer h2 {
  font: 600 17px var(--serif);
  color: var(--gold);
  margin: 14px 0 7px;
}
.article ul {
  padding-left: 18px;
  color: #d6ded1;
  line-height: 1.8;
  font-size: 13px;
}
.article a,
.detail a {
  font-size: 12px;
}
.action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 4px;
  cursor: pointer;
}
.explorer {
  font-size: 13px;
}
.explorer label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: #bac6b6;
  font-size: 11px;
}
.filters {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
select,
.filters input,
.share-url {
  border: 1px solid #566c5f;
  background: #122629;
  color: #e4e8d9;
  padding: 7px;
  min-height: 33px;
  min-width: 0;
}
.filters input {
  width: 132px;
}
.plot-box {
  margin: 10px 0 7px;
  background: #172b2e;
  border: 1px solid #465b51;
  border-radius: 4px;
}
.plot-box canvas {
  width: 100%;
  height: 172px;
  display: block;
  cursor: crosshair;
}
.table-wrap {
  max-height: 270px;
  overflow: auto;
  border-top: 1px solid #526458;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
th,
td {
  padding: 6px 8px;
  text-align: right;
  border-bottom: 1px solid #3b5249;
}
th {
  position: sticky;
  top: 0;
  background: #263b38;
  color: #d6c59c;
}
th:first-child,
td:first-child {
  text-align: left;
}
td button {
  color: #e3d0a3;
  text-align: left;
}
td button:hover {
  text-decoration: underline;
}
.pages {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0;
  gap: 8px;
}
.rank {
  display: flex;
  gap: 7px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 5px 2px;
}
.rank i {
  height: 5px;
  background: #9ca987;
  min-width: 2px;
}
.rank span {
  width: 58px;
  flex: none;
}
.rank b {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.share-url {
  width: 100%;
  margin: 12px 0;
}
.article .cta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#toast {
  position: fixed;
  z-index: 15;
  top: 81px;
  left: 50%;
  transform: translateX(-50%);
  background: #243c36;
  border: 1px solid #a39b72;
  color: #f0e3bf;
  padding: 7px 15px;
  border-radius: 5px;
  box-shadow: 0 2px 10px #101e23;
}
@media (max-width: 890px) {
  header {
    gap: 12px;
    padding-inline: 12px;
  }
  .yields {
    gap: 9px;
    padding-left: 10px;
  }
  .yields button {
    gap: 4px;
  }
  .yields svg {
    width: 18px;
  }
  .dock button {
    padding: 0 8px;
  }
}
@media (max-width: 700px) {
  header {
    height: 55px;
    gap: 5px;
    padding: 0 9px;
  }
  .brand {
    gap: 5px;
  }
  .brand img {
    width: 34px;
  }
  .brand > span {
    font-size: 17px;
  }
  .brand small {
    font-size: 8px;
  }
  .yields {
    display: none;
  }
  .header-tools {
    gap: 5px;
  }
  #search-box {
    padding: 0 6px;
    gap: 3px;
  }
  #search {
    width: clamp(78px, 27vw, 150px);
    font-size: 11px;
  }
  #search-box kbd {
    display: none;
  }
  .tool {
    padding: 0 7px;
  }
  .header-tools .tool span {
    display: none;
  }
  .location {
    top: 10px;
    left: 10px;
    padding: 5px 8px;
    gap: 7px;
  }
  .location b {
    font-size: 12px;
  }
  .location span {
    font-size: 9px;
  }
  .map-tools {
    right: 9px;
    top: 10px;
  }
  .map-tools button {
    width: 33px;
    height: 34px;
  }
  .dock-wrap {
    bottom: 9px;
    right: 8px;
    left: 8px;
  }
  .dock {
    width: 100%;
    justify-content: space-between;
    gap: 0;
    padding: 4px;
  }
  .dock button,
  .dock button:last-child {
    padding: 0 5px;
    font-size: 11px;
    gap: 3px;
    min-height: 37px;
  }
  .dock button svg {
    width: 14px;
  }
  .dock button:last-child {
    border: 0;
  }
  .detail {
    left: 9px;
    top: 48px;
    width: min(310px, calc(100vw - 63px));
    max-height: calc(100% - 115px);
    padding: 13px 14px;
  }
  .detail h2 {
    font-size: 22px;
  }
  #mini-wrap {
    left: 9px;
    bottom: 65px;
    width: 144px;
  }
  #mini-show {
    left: 9px;
    bottom: 65px;
    min-height: 31px;
    padding: 0 6px;
  }
  #picker,
  #legend {
    width: 100%;
    max-width: 100%;
  }
  #picker {
    max-height: 53dvh;
  }
  #legend {
    padding: 7px 10px;
  }
  body:has(#legend:not([hidden])) :is(#mini-show, #mini-wrap),
  body:has(#picker:not([hidden])) :is(#mini-show, #mini-wrap) {
    visibility: hidden;
  }
  footer {
    gap: 8px;
    padding: 3px 8px;
    font-size: 9px;
  }
  .foot-brand {
    display: none;
  }
  #zoom-level {
    font-size: 9px;
  }
  #dialog-body {
    padding: 15px;
  }
  dialog {
    width: calc(100vw - 16px);
    max-height: 91dvh;
  }
  #matches {
    position: fixed;
    left: 8px;
    right: 8px;
    top: 53px;
    width: auto;
  }
  .plot-box canvas {
    height: 150px;
  }
  .table-wrap {
    max-height: 210px;
  }
  .filters select {
    max-width: 136px;
  }
  .filters input {
    width: 107px;
  }
  #toast {
    top: 62px;
  }
  .detail .kv {
    font-size: 11px;
  }
}
@media (max-width: 360px) {
  .dock button svg {
    display: none;
  }
  .foot-date {
    display: none;
  }
}
@media (max-width: 360px) {
  header {
    padding-inline: 6px;
  }
  .brand img {
    width: 28px;
  }
  .brand > span {
    font-size: 15px;
  }
  .header-tools {
    gap: 4px;
  }
  #search {
    width: 75px;
  }
  .header-tools .tool {
    padding-inline: 5px;
  }
}

.legend-source {
  display: block;
  margin-top: 4px;
  font-size: 10px;
}
.legend-source a {
  color: #d5c7a6;
}
