:root {
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #514b3e;
  background: #ece4d6;
  font-synthesis: none;
  color-scheme: light;
  --ink: #514b3e;
  --green: #677f6c;
  --line: #b9ac9455;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.4;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #7a8b69;
  outline-offset: 3px;
}
a {
  color: inherit;
}
.preview-header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid #9d8f7255;
  background: #6b7159;
  color: #fff3d7;
  box-shadow: 0 2px 0 #c7b79b;
  position: relative;
  z-index: 2;
}
.preview-header h1 {
  font-family: 'Songti SC', STSong, serif;
  font-size: 23px;
  letter-spacing: 4px;
  margin: 0;
  font-weight: 700;
}
.back-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  min-width: 132px;
}
.catalog-total {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 132px;
  text-align: right;
  color: #e3dac2;
}
.preview-layout {
  height: calc(100dvh - 72px);
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}
.catalog {
  padding: 23px 17px 16px;
  background: linear-gradient(100deg, #eee7d7, #e7dcc7);
  border-right: 1px solid #b9aa8a77;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: inset -5px 0 18px #87704c08;
}
.catalog-heading {
  display: flex;
  justify-content: space-between;
  margin: 0 4px 18px;
  font-family: 'Songti SC', STSong, serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
}
.catalog-heading > span:last-child {
  color: #9b936c;
}
.search-field {
  height: 38px;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 11px;
  background: #fffaf066;
  border: 1px solid #ad9e7f66;
  border-radius: 4px;
}
.search-field > span {
  font-size: 22px;
}
.search-field input {
  width: 100%;
  border: 0;
  outline: none;
  background: none;
  font-size: 13px;
  color: var(--ink);
}
.categories {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 15px 0 14px;
}
.category-button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 6px 9px;
  font-size: 12px;
  color: #827761;
}
.category-button[aria-pressed='true'] {
  color: #f9efda;
  background: #78816a;
  border-color: #606b56;
  box-shadow: 0 2px 0 #5e654d55;
}
.model-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: auto;
  min-height: 0;
  padding: 1px 3px 10px;
  scrollbar-width: thin;
  scrollbar-color: #b6a88c transparent;
}
.model-item {
  position: relative;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  min-height: 53px;
}
.model-item:hover {
  background: #f7f0df80;
}
.model-item[aria-pressed='true'] {
  background: #fff9e8;
  border-color: #c8b48f;
  box-shadow: 0 3px 0 #b3a18555;
}
.model-symbol {
  font-size: 22px;
  color: #93866b;
  width: 26px;
  text-align: center;
}
.model-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.model-copy b {
  font-size: 13px;
  font-weight: 600;
}
.model-copy small {
  font-size: 10px;
  color: #8d816a;
  letter-spacing: 0.3px;
}
.model-item[aria-pressed='true']::after {
  content: '◆';
  color: #899072;
  font-size: 8px;
  position: absolute;
  right: 10px;
  top: 12px;
}
.credits-link {
  margin-top: auto;
  padding: 14px 3px 0;
  font-size: 10px;
  text-decoration: none;
  color: #8a7b61;
}
.viewer {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #e5dccb;
}
.model-heading {
  position: absolute;
  top: 25px;
  left: 34px;
  right: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1;
  pointer-events: none;
}
.model-heading p {
  margin: 0 0 5px;
  font-size: 11px;
  letter-spacing: 2px;
  color: #9c8b70;
}
.model-heading h2 {
  margin: 0;
  font-family: 'Songti SC', STSong, serif;
  font-size: 26px;
  letter-spacing: 2px;
}
.model-heading > span {
  font-size: 12px;
  color: #9b8f77;
}
.canvas-wrap {
  position: absolute;
  inset: 0;
}
.canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
}
.load-status {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 42%;
  text-align: center;
  font-size: 14px;
  color: #806e52;
  line-height: 1.7;
  pointer-events: none;
}
.load-status[hidden] {
  display: none;
}
.load-status.error {
  background: #fff6e7d9;
  border: 1px solid #ba9a74;
  padding: 20px;
  max-width: 420px;
  margin: 0 auto;
  border-radius: 5px;
}
.view-controls {
  position: absolute;
  top: 110px;
  right: 26px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.small-button {
  border: 1px solid #b6a38477;
  border-radius: 5px;
  background: #fff9ebd9;
  padding: 10px 12px;
  box-shadow: 0 3px 0 #aa96754d;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
}
.small-button span {
  font-size: 11px;
}
.small-button[aria-pressed='true'] {
  background: #7e896e;
  color: #fff2d6;
  border-color: #677052;
}
.viewer-bottom {
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 24px;
}
.animation-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 17px;
  background: #fffaecd9;
  border: 1px solid #cbbb9b;
  border-radius: 7px;
  box-shadow:
    0 4px 0 #ab95754a,
    0 9px 30px #735c3810;
  backdrop-filter: blur(10px);
  max-width: 540px;
  margin: 0 auto;
}
.play-button {
  width: 37px;
  height: 37px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: #78866a;
  color: #fff2d5;
  border: 1px solid #616d55;
  border-radius: 50%;
  box-shadow: 0 2px 0 #48553e;
  font-weight: 700;
  font-size: 16px;
}
.animation-select {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.animation-select > span,
.speed-control > span {
  font-size: 10px;
  color: #9a8a6f;
  white-space: nowrap;
}
.animation-select select {
  max-width: 100%;
  min-width: 0;
  flex: 1;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #b8a47e88;
  color: #554c3d;
  padding: 6px 15px 6px 3px;
  font-size: 12px;
  border-radius: 0;
}
.speed-control {
  width: 112px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
.speed-control > span {
  display: flex;
  justify-content: space-between;
}
.speed-control output {
  color: #657255;
  font-weight: 700;
}
.speed-control input {
  width: 100%;
  accent-color: #7d8967;
  cursor: pointer;
  height: 13px;
  margin: 0;
}
.viewer-notes {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 10px;
  color: #988b73;
  margin-top: 14px;
  letter-spacing: 0.3px;
}
.empty-list {
  padding: 15px 5px;
  font-size: 12px;
  color: #95836a;
}
.model-list::-webkit-scrollbar {
  width: 5px;
}
.model-list::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: #bbad91;
}
@media (max-width: 760px) {
  .preview-header {
    height: 58px;
    padding: 0 17px;
  }
  .preview-header h1 {
    font-size: 19px;
    letter-spacing: 2px;
  }
  .back-link {
    font-size: 14px;
    min-width: 90px;
  }
  .back-link span {
    font-size: 11px;
  }
  .catalog-total {
    min-width: 90px;
    font-size: 10px;
  }
  .preview-layout {
    height: calc(100dvh - 58px);
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 180px;
  }
  .viewer {
    grid-row: 1;
  }
  .catalog {
    grid-row: 2;
    padding: 9px 13px 12px;
    border-right: 0;
    border-top: 1px solid #baa47e88;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 34px minmax(0, 1fr);
    gap: 8px;
    position: relative;
  }
  .catalog-heading,
  .search-field,
  .credits-link {
    display: none;
  }
  .categories {
    margin: 0;
    align-items: center;
    flex-wrap: nowrap;
    overflow: auto;
    gap: 5px;
    scrollbar-width: none;
  }
  .category-button {
    white-space: nowrap;
    padding: 6px 10px;
  }
  .model-list {
    flex-direction: row;
    padding: 2px 2px 8px;
    gap: 8px;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .model-item {
    width: 114px;
    min-height: 85px;
    padding: 11px 9px;
    flex-direction: column;
    gap: 7px;
    align-items: flex-start;
    justify-content: center;
    background: #f4ead9a8;
    border-color: #c9b69255;
  }
  .model-symbol {
    font-size: 22px;
    text-align: left;
  }
  .model-copy {
    gap: 5px;
  }
  .model-copy b {
    font-size: 11px;
    line-height: 1.4;
  }
  .model-copy small {
    font-size: 9px;
  }
  .model-heading {
    top: 20px;
    left: 21px;
    right: 20px;
  }
  .model-heading p {
    font-size: 9px;
    margin-bottom: 4px;
  }
  .model-heading h2 {
    font-size: 22px;
  }
  .model-heading > span {
    font-size: 10px;
  }
  .view-controls {
    top: 85px;
    right: 15px;
    gap: 8px;
  }
  .small-button {
    padding: 9px 10px;
    font-size: 16px;
  }
  .small-button span {
    display: none;
  }
  .viewer-bottom {
    bottom: 15px;
    left: 17px;
    right: 17px;
  }
  .animation-controls {
    padding: 10px 12px;
    gap: 10px;
  }
  .play-button {
    width: 33px;
    height: 33px;
  }
  .speed-control {
    width: 79px;
  }
  .animation-select {
    gap: 4px;
  }
  .animation-select select {
    font-size: 11px;
    padding-right: 7px;
  }
  .animation-select > span {
    display: none;
  }
  .viewer-notes {
    font-size: 9px;
    margin-top: 9px;
    gap: 8px;
  }
  .gesture-hint {
    white-space: nowrap;
  }
  .load-status {
    font-size: 12px;
  }
}
@media (max-height: 640px) and (min-width: 761px) {
  .preview-header {
    height: 58px;
  }
  .preview-layout {
    height: calc(100dvh - 58px);
  }
  .model-heading {
    top: 17px;
  }
  .viewer-bottom {
    bottom: 12px;
  }
  .view-controls {
    top: 95px;
  }
}
