:root {
  --ink: #24382e;
  --green: #315d48;
  --muted: #617066;
  --paper: #f6f6f0;
  --line: #d4dacd;
  --wood: #70503a;
  --pale: #e5eada;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font:
    14px/1.55 'Noto Sans CJK SC',
    'Microsoft YaHei',
    system-ui,
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}
body.stage-expanded {
  overflow: hidden;
}
button,
select {
  font: inherit;
  color: inherit;
}
button,
select {
  cursor: pointer;
}
button {
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 6px 11px;
  line-height: 1.5;
}
button:hover,
select:hover {
  border-color: #72917c;
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid #ad714c;
  outline-offset: 2px;
}
button[aria-pressed='true'] {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 56px;
  background: #24372d;
  color: #f8f7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px clamp(16px, 2.2vw, 32px);
  font-weight: 650;
  letter-spacing: 0.03em;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 12px rgba(20, 34, 26, 0.14);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  white-space: nowrap;
  flex: none;
}
.mark {
  width: 18px;
  height: 18px;
  border: 2px solid #dfcdb0;
  border-right-width: 7px;
  border-bottom-width: 6px;
  display: inline-block;
  flex: none;
}
.room-nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 3px 2px;
}
.room-nav::-webkit-scrollbar {
  display: none;
}
.room-nav a {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: #dde5dc;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.14s,
    border-color 0.14s,
    color 0.14s;
}
.room-nav a:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(223, 205, 176, 0.55);
  color: #fff;
}
.room-nav a[aria-current='page'] {
  background: #366b51;
  border-color: #dfcdb0;
  color: #fff;
  font-weight: 600;
}
.room-nav a:focus-visible,
.top .back-home:focus-visible {
  outline: 2px solid #e7b66b;
  outline-offset: 2px;
}
.wrap {
  max-width: 1640px;
  margin: auto;
  padding: 19px max(3vw, 20px) 34px;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 15px;
}
h1 {
  font-size: clamp(23px, 2.2vw, 34px);
  line-height: 1.3;
  margin: 0;
  letter-spacing: 0.03em;
}
.intro p {
  margin: 3px 0 0;
  color: var(--muted);
}
.modes {
  display: flex;
  padding: 3px;
  background: #e6eadf;
  border-radius: 7px;
  gap: 2px;
}
.modes button {
  border: 0;
  background: transparent;
}
.modes button[aria-pressed='true'] {
  background: #fffefa;
  color: var(--green);
  box-shadow: 0 1px 3px #20382a24;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  gap: 16px;
  align-items: start;
}
.left,
.side {
  min-width: 0;
}
.viewport,
.card,
.toolbar {
  border: 1px solid var(--line);
  background: #fffefa;
  border-radius: 9px;
}
.viewport {
  overflow: hidden;
}
.stage {
  position: relative;
  background: #e8ebe2;
  height: clamp(425px, 64vh, 760px);
  isolation: isolate;
  overflow: hidden;
  touch-action: none;
}
.stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.stage:fullscreen,
.stage.expanded {
  width: 100vw;
  height: 100dvh;
  background: #e8ebe2;
}
.stage.expanded {
  position: fixed;
  inset: 0;
  z-index: 45;
}
.viewlabels {
  position: absolute;
  inset: 12px 12px auto 12px;
  pointer-events: none;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}
.chip {
  background: #fffef6ef;
  border: 1px solid #cbd4c2d9;
  padding: 5px 9px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.chip:before {
  content: '';
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  background: #688368;
  margin-right: 7px;
}
.stage.split #tagA:before {
  background: #a34e2f;
}
.stage.split #tagB:before {
  background: var(--green);
}
.stagebuttons {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.stagebuttons button {
  font-size: 12px;
  background: #fffdf4ed;
}
.stagebuttons button[aria-pressed='true'] {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.axis {
  position: absolute;
  left: 12px;
  bottom: 13px;
  font:
    11px/1.4 ui-monospace,
    monospace;
  color: #475d50;
  pointer-events: none;
  background: #faf9f0d4;
  padding: 3px 6px;
  border-radius: 3px;
}
.divider {
  position: absolute;
  top: 0;
  left: 50%;
  bottom: 0;
  border-left: 2px solid #fffef3;
  pointer-events: none;
}
#loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  background: #e8ebe2;
  text-align: center;
}
.bar {
  padding: 10px 13px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
}
select {
  padding: 5px 25px 5px 8px;
  border: 1px solid var(--line);
  background: #fffefa;
  border-radius: 5px;
  max-width: 100%;
}
.bar label {
  font-weight: 600;
}
.bar .checks {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.checks label,
.inside label {
  font-weight: 400;
  cursor: pointer;
}
input {
  accent-color: var(--green);
  vertical-align: middle;
}
.side {
  display: grid;
  gap: 10px;
}
.card {
  padding: 15px 16px;
}
.card h2 {
  margin: 0 0 6px;
  font-size: 17px;
}
.variant {
  padding: 8px 0;
  border-top: 1px solid #e1e5d9;
}
.variant:first-of-type {
  border-top: 0;
}
.variant:last-child {
  padding-bottom: 0;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.row h3 {
  margin: 0;
  font-size: 14px;
}
.look {
  font-size: 12px;
  border: 0;
  background: transparent;
  padding: 2px 0 2px 6px;
  color: #546f59;
}
.options {
  display: flex;
  gap: 4px;
  margin: 6px 0;
}
.options button {
  flex: 1;
  padding: 5px 2px;
  font-size: 13px;
}
.note {
  font-size: 12px;
  color: var(--muted);
  margin: 5px 0 0;
}
.pair {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.pair button {
  font-size: 12px;
}
.inside summary,
details.table summary {
  cursor: pointer;
  font-weight: 600;
}
.inside .body {
  padding-top: 9px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.inside label {
  font-size: 12px;
}
.inside .long {
  grid-column: 1/-1;
}
.toolbar {
  margin-top: 12px;
  padding: 12px 15px;
}
table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  padding: 7px 8px;
  border-bottom: 1px solid #e0e4da;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
th {
  font-weight: 600;
  background: #eff1e9;
}
.toolbar p {
  margin: 8px 0 0;
}
.muted {
  color: var(--muted);
}
.comparekeys {
  padding: 9px 13px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  background: #fafbf5;
}
.comparekeys span {
  display: block;
}
.comparekeys b {
  display: inline-block;
  min-width: 1.4em;
  color: var(--green);
  margin-right: 6px;
}
.comparekeys b.ref {
  color: #a34e2f;
}
.comparekeys b.cur {
  color: var(--green);
}
footer {
  margin: 17px 0 0;
  font-size: 12px;
  color: #68756a;
}
#status {
  font-size: 12px;
  color: #526c58;
  min-height: 0;
}
.divider.vertical {
  left: 0;
  top: 50%;
  right: 0;
  bottom: auto;
  border-left: 0;
  border-top: 2px solid #fffef3;
}
[hidden] {
  display: none !important;
}
.top .back-home {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border: 1px solid #819486;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  text-decoration: none;
}
.top .back-home:hover {
  background: #49624f;
}
.stage .back-home {
  display: none;
}
.stage:fullscreen .back-home,
.stage.expanded .back-home {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  background: #fffdf4ed;
  border: 1px solid var(--line);
  padding: 6px 11px;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
}
.stage:fullscreen .back-home:hover,
.stage.expanded .back-home:hover {
  border-color: #72917c;
}
@media (max-width: 1260px) {
  .top {
    flex-wrap: wrap;
    row-gap: 6px;
    padding: 8px clamp(14px, 2vw, 24px) 6px;
  }
  .room-nav {
    order: 3;
    flex: 1 0 100%;
    max-width: 100%;
    gap: 4px;
    padding: 6px 2px 3px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  .room-nav a {
    padding: 4px 7px;
    font-size: 12px;
  }
}
@media (max-width: 950px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 269px;
    gap: 10px;
  }
  .wrap {
    padding: 12px;
  }
  .card {
    padding: 12px;
  }
  .bar .checks {
    margin: 0;
  }
  .top {
    padding: 8px 14px 6px;
  }
}
@media (max-width: 780px) {
  .room-nav {
    justify-content: flex-start;
  }
}
@media (max-width: 725px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .stage {
    height: clamp(360px, 55svh, 560px);
  }
  .side {
    grid-row: 2;
  }
  .intro {
    margin: 4px 0 12px;
  }
  .intro p {
    font-size: 12px;
  }
  .bar .checks {
    gap: 6px;
  }
  .side .card {
    padding: 12px;
  }
  .variant {
    padding: 7px 0;
  }
  .inside .body {
    grid-template-columns: 1fr 1fr;
  }
  .axis {
    font-size: 10px;
  }
  .stage:fullscreen .axis,
  .stage.expanded .axis {
    display: none;
  }
  .top {
    min-height: 0;
    padding: 8px 12px 6px;
    gap: 6px 8px;
  }
  .brand {
    font-size: 15px;
    gap: 8px;
  }
  .mark {
    width: 15px;
    height: 15px;
  }
  .top .back-home {
    padding: 4px 10px;
    font-size: 12px;
  }
  .room-nav {
    flex-wrap: nowrap;
    gap: 5px;
    padding: 5px 2px 3px;
    -webkit-overflow-scrolling: touch;
  }
  .room-nav a {
    padding: 4px 8px;
    font-size: 12px;
  }
  .wrap {
    padding-bottom: 18px;
  }
  .stage.vertical {
    height: clamp(420px, 62svh, 580px);
  }
  .stage.vertical:fullscreen,
  .stage.vertical.expanded {
    height: 100dvh;
  }
  .stage.vertical .viewlabels {
    inset: 10px auto 0 10px;
    display: block;
  }
  .stage.vertical #tagB {
    position: absolute;
    left: 0;
    top: 50%;
    white-space: nowrap;
  }
  .toolbar th,
  .toolbar td {
    font-size: 11px;
    padding: 5px;
  }
  .modes button {
    font-size: 12px;
  }
}
