.history-sheet {
  position: absolute; left: 157px; top: 72px; width: 1053px; height: 650px;
  color: #32281f; font-family: "Songti SC", "STSong", "Noto Serif CJK SC", SimSun, Georgia, serif;
  background: url("../assets/history-panel/paper.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(0 7px 8px #3a292b42);
}
.history-sheet *, .history-sheet *::before, .history-sheet *::after { box-sizing: border-box; }
.history-sheet [hidden] { display: none !important; }
.history-sheet :is(button, select) { font: inherit; color: inherit; cursor: pointer; }
.history-sheet button { appearance: none; border: 0; box-shadow: none; padding: 0; }
.history-sheet :is(button,select):focus-visible { outline: 2px solid #8d6d47; outline-offset: 2px; }
.history-sheet__sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.history-sheet .history-sheet__heading {
  position: absolute; left: 298px; top: 33px; width: 466px; height: 50px; margin: 0; padding: 0;
  background: url("../assets/history-panel/heading.webp") center / contain no-repeat;
}
.history-sheet .history-sheet__heading:focus { outline: none; }
.history-sheet__close {
  position: absolute; top: 23px; right: 28px; width: 42px; height: 52px; border-radius: 5px;
  background: transparent url("../assets/history-panel/close.webp") center / 34px 33px no-repeat;
}
.history-sheet__divider {
  position: absolute; left: 60px; top: 82px; width: 944px; height: 21px; pointer-events: none;
  background: url("../assets/history-panel/divider.webp") center / 100% 100% no-repeat;
}
.history-categories {
  position: absolute; top: 106px; left: 58px; display: flex; align-items: center; gap: 3px;
}
.history-sheet .history-categories__tab {
  height: 57px; width: 157px; padding: 0 0 2px; white-space: nowrap; border-radius: 32px;
  background: transparent url("../assets/history-panel/tab-stone.webp") center / 100% 100% no-repeat;
  font-size: 26px; font-weight: 500; line-height: 1; text-shadow: 0 1px 2px #fff8df;
}
.history-sheet .history-categories__tab[aria-pressed="true"] {
  color: #60401d; background-image: url("../assets/history-panel/tab-gold.webp");
}
.history-pity {
  position: absolute; right: 47px; top: 106px; width: 294px; height: 54px;
  display: grid; place-items: center; padding: 0 8px 1px; color: #523b24;
  background: url("../assets/history-panel/pity.webp") center / 100% 100% no-repeat;
  white-space: nowrap; font-size: 23px; line-height: 1;
}
.history-table {
  position: absolute; left: 60px; top: 169px; width: 942px;
  display: block; table-layout: fixed; border-collapse: collapse; border-spacing: 0;
  margin: 0; font-weight: 500; font-size: 28px; color: #221d19; line-height: 1.16;
}
.history-table :is(thead,tbody) { display: block; }
.history-table tr:not(.history-table__empty) {
  display: grid; grid-template-columns: 25.2% 24.6% 24.6% 25.6%; align-items: stretch;
}
.history-table :is(th,td) {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-width: 0; margin: 0; padding: 0 4px; font-size: inherit; font-weight: inherit; white-space: nowrap;
  border: none; background: transparent;
}
.history-table tr:not(.history-table__empty) > :not(:first-child)::before {
  content: ""; position: absolute; left: 0; top: 20%; height: 60%; width: 1px;
  background-color: #baa98ba8;
}
.history-table .history-table__head {
  height: 48px; border-block: 1px solid #b0a38e;
  background: linear-gradient(90deg, #ece6dc1a, #eae2d5a6 21%, #eae2d5aa 79%, #ece6dc1a);
  font-size: 27px; font-weight: 600; line-height: 1;
}
.history-sheet .history-table__filter {
  max-width: calc(100% - 12px); width: 100%; height: 90%; padding: 0 6px; border: 0; border-radius: 5px;
  appearance: none; background: transparent; text-align: center; text-align-last: center;
}
.history-table th:has(select)::after {
  content: ""; position: absolute; right: 12px; top: 48%; width: 6px; height: 6px;
  border: solid #917650; border-width: 0 1px 1px 0; transform: rotate(45deg); pointer-events: none; opacity: .55;
}
.history-table__filter option { font-size: 17px; color: #39291d; background: #faf6ed; }
.history-table__body { margin-top: 2px; }
.history-table .history-table__row {
  position: relative; min-height: 58px; background: transparent center / 100% 100% no-repeat;
}
.history-table__row[data-tone="gold"] { color: #634520; background-image: url("../assets/history-panel/row-gold.webp"); }
.history-table__row[data-tone="violet"] { color: #30283d; background-image: url("../assets/history-panel/row-violet.webp"); }
.history-table__row[data-tone="silver"]::after {
  content: ""; position: absolute; inset: auto 0 0; height: 1px;
  background: linear-gradient(90deg,transparent,#b7ad9b9c 9%,#b7ad9bbd 88%,transparent);
}
.history-table .history-table__grade { font-family: Georgia, "Songti SC", serif; letter-spacing: .5px; font-size: 26px; }
.history-table .history-table__time { font-family: Georgia, "Songti SC", serif; font-size: 25px; font-variant-numeric: tabular-nums; }
.history-table .history-table__name { gap: 5px; }
.history-table .history-table__name:has(.model-name) { flex-direction: column; gap: 1px; }
.history-table .model-name { font-size: .67em; }
.history-table__legacy { color: #786a63; font-size: 13px; }
.history-table .history-table__empty { display: grid; height: 343px; place-items: center; }
.history-table .history-table__empty td { font-size: 24px; color: #887865; white-space: normal; text-align: center; }
.history-pages {
  position: absolute; bottom: 31px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center; gap: 6px; height: 43px;
}
.history-pages__current { min-width: 83px; font: 28px/1.2 Georgia, "Songti SC", serif; color: #493528; text-align: center; white-space: nowrap; }
.history-sheet .history-pages__arrow { position: relative; width: 33px; height: 39px; background: transparent; border-radius: 6px; }
.history-pages__arrow::before, .history-pages__arrow.is-first::after, .history-pages__arrow.is-last::after {
  content: ""; position: absolute; inset: 0; background: url("../assets/history-panel/arrow.webp") center / 23px 31px no-repeat;
}
.history-pages__arrow:is(.is-first,.is-prev) { transform: scaleX(-1); }
.history-pages__arrow:is(.is-first,.is-last)::before { transform: translateX(-3px) scale(.76); }
.history-pages__arrow:is(.is-first,.is-last)::after { transform: translateX(4px) scale(.76); }
.history-sheet .history-pages__arrow:disabled { cursor: default; opacity: .40; }
.history-note {
  position: absolute; right: 51px; bottom: 38px; display: flex; align-items: center; gap: 12px;
  color: #594434; font-size: 21px; line-height: 1.3; white-space: nowrap;
}
.history-sheet .history-note__archive { padding: 4px; color: #7c6344; font-size: 15px; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) {
  .history-sheet button:enabled:hover, .history-table__filter:hover { filter: brightness(1.05); }
  .history-table th:has(select):hover::after { opacity: 1; }
}

.portrait .history-sheet {
  left: 7px; top: 50%; transform: translateY(-50%); width: 406px; max-width: calc(100% - 14px);
  height: min(690px, calc(100% - 24px));
}
.portrait .history-sheet .history-sheet__heading { width: 265px; height: 35px; left: 50%; top: 27px; transform: translateX(-50%); }
.portrait .history-sheet__close { width: 39px; height: 40px; top: 16px; right: 13px; background-size: 23px; }
.portrait .history-sheet__divider { left: 5%; width: 90%; top: 58px; height: 13px; }
.portrait .history-categories { left: 4%; right: 4%; top: 79px; gap: 2px; justify-content: center; }
.portrait .history-sheet .history-categories__tab { width: 33%; height: 43px; font-size: 18px; }
.portrait .history-pity { top: 126px; right: 5%; width: 194px; height: 39px; font-size: 15px; }
.portrait .history-table {
  left: 5%; right: 5%; width: 90%; top: 178px; bottom: 103px;
  display: flex; flex-direction: column; font-size: 17px;
}
.portrait .history-table thead { flex: 0 0 auto; }
.portrait .history-table .history-table__head { height: 39px; font-size: 16px; }
.portrait .history-table tr:not(.history-table__empty) { grid-template-columns: 24% 19% 27% 30%; }
.portrait .history-table :is(td,th) { padding-inline: 2px; }
.portrait .history-sheet .history-table__filter { max-width: 100%; width: 100%; padding: 0 7px 0 0; }
.portrait .history-table th:has(select)::after { right: 4px; width: 4px; height: 4px; }
.portrait .history-table__body { flex: 1; min-height: 0; overflow-y: auto; }
.portrait .history-table .history-table__row { min-height: 47px; height: 16.67%; font-size: 16px; }
.portrait .history-table .history-table__name { flex-direction: column; gap: 1px; font-size: 16px; white-space: normal; text-align: center; }
.portrait .history-table__legacy { font-size: 11px; }
.portrait .history-table .history-table__grade { font-size: 13px; letter-spacing: -.8px; }
.portrait .history-table .history-table__time { font-size: 13px; white-space: normal; text-align: center; }
.portrait .history-table__time time { max-width: 87px; }
.portrait .history-table .history-table__empty { height: 100%; min-height: 160px; }
.portrait .history-table .history-table__empty td { font-size: 17px; }
.portrait .history-pages { bottom: 48px; height: 39px; gap: 4px; }
.portrait .history-pages__current { min-width: 66px; font-size: 22px; }
.portrait .history-note { left: 5%; right: 5%; bottom: 27px; justify-content: center; font-size: 14px; gap: 8px; }
.portrait .history-sheet .history-note__archive { font-size: 13px; }
