:root {
  --color-page: #f3f4f7;
  --color-surface: #ffffff;
  --color-surface-soft: #f8fafc;
  --color-header: rgba(243, 244, 247, 0.96);
  --color-text: #222222;
  --color-muted: #667085;
  --color-line: #d8dce5;
  --color-line-soft: #e7eaf0;
  --color-tab-active: #30394b;
  --color-tab-hover: #eef3ff;
  --color-focus: #4f68d7;
  --color-card-hover: #f8fbff;
  --color-card-hover-border: #b4c7ff;
  --shadow-card-selected: 0 0 0 2px rgba(79, 104, 215, 0.10);

  --top-bar-height: 88px;
  --status-bar-height: 52px;
  --left-column-width: 420px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--color-text);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  background: var(--color-page);
}

button {
  font: inherit;
}

.app-shell {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: var(--top-bar-height) 1fr var(--status-bar-height);
  overflow: hidden;
}

.top-bar {
  min-width: 0;
  display: grid;
  grid-template-columns: var(--left-column-width) minmax(0, 1fr) auto;
  align-items: stretch;
  background: var(--color-header);
  border-bottom: 1px solid var(--color-line);
  backdrop-filter: blur(8px);
}

.app-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 28px;
  white-space: nowrap;
  background: var(--color-header);
}

.app-title__main {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}

.app-title__subtitle {
  margin-top: 5px;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}

.engine-tabs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 20px;
  overflow: hidden;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 20px 18px 0;
}

.top-action-button {
  height: 38px;
  padding: 0 16px;
  border: 1px solid #c8cede;
  border-radius: 6px;
  color: #30394b;
  background: var(--color-surface);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.top-action-button:hover,
.engine-tab:hover {
  border-color: var(--color-focus);
  color: #3656d4;
  background: #f7f9ff;
}

.top-action-button.is-active {
  background: var(--color-tab-active);
  border-color: var(--color-tab-active);
  color: #ffffff;
}

.engine-tab {
  height: 38px;
  padding: 0 16px;
  border: 1px solid #c8cede;
  border-radius: 6px;
  color: #30394b;
  background: var(--color-surface);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.engine-tab.is-active {
  background: var(--color-tab-active);
  border-color: var(--color-tab-active);
  color: #ffffff;
}

.main-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: var(--left-column-width) 1fr;
  overflow: hidden;
}

.result-column {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: 50px 1fr;
  overflow: hidden;
  background: var(--color-surface);
  border-right: 1px solid var(--color-line);
}

.filter-region {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-line);
}

.filter-toggle {
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #30394b;
  background: transparent;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease;
}

.filter-toggle:hover {
  border-color: #d8deea;
  background: #f8fafc;
}

.filter-toggle[aria-expanded="true"] {
  border-color: #b9c7ee;
  color: #3656d4;
  background: #f4f7ff;
  box-shadow: inset 0 0 0 1px rgba(79, 104, 215, 0.08);
}

.filter-toggle__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background: currentColor;
  opacity: 0.78;
  -webkit-mask: url("https://img.orchestrionxiv.com/images/ui/filter-menu.svg") center / contain no-repeat;
  mask: url("https://img.orchestrionxiv.com/images/ui/filter-menu.svg") center / contain no-repeat;
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.filter-toggle[aria-expanded="true"] .filter-toggle__icon {
  opacity: 1;
  transform: translateY(1px);
}

.filter-region:has(.accessory-view-toggle:not([hidden])) .filter-toggle {
  width: auto;
  flex: 1 1 auto;
}

.app-shell[data-engine="accessoryPieces"] .filter-toggle {
  width: auto;
  flex: 1 1 auto;
}

.accessory-view-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid #b9c1cf;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.78);
}

.accessory-view-toggle[hidden] {
  display: none;
}

.accessory-view-toggle .compact-tab {
  height: 26px;
  min-width: 44px;
  padding: 0 8px;
  font-size: 12px;
  white-space: nowrap;
}

.filter-dropdown {
  position: absolute;
  z-index: 20;
  top: 50px;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: #ffffff;
  border-right: 1px solid var(--color-line);
  box-shadow: 12px 0 28px rgba(31, 41, 55, 0.12);
}

.filter-dropdown[hidden] {
  display: none;
}

.filter-form {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px 14px 8px;
  overflow: hidden;
  background: #ffffff;
}

.filter-group-block {
  background: #ffffff;
}

.filter-group-block {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-line-soft);
}

.filter-group-block:last-child {
  border-bottom: 0;
}

.filter-group-block h3 {
  margin: 0;
  color: #202938;
  font-size: 13px;
  font-weight: 750;
}

.sub-filter-heading {
  margin-top: 4px !important;
  padding-top: 8px;
  border-top: 1px solid var(--color-line-soft);
}

.filter-input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 9px;
  border: 1px solid #bfc7d8;
  border-radius: 6px;
  color: #202938;
  background: #ffffff;
  font-size: 13px;
}

.filter-input:disabled {
  border-color: #d6dbe5;
  color: #98a2b3;
  background: #f3f5f8;
  cursor: not-allowed;
}

.filter-group-block.is-filter-disabled {
  opacity: 0.52;
}

.filter-group-block.is-filter-disabled input,
.filter-group-block.is-filter-disabled select,
.filter-group-block.is-filter-disabled label,
.filter-group-block.is-filter-disabled span,
.filter-group-block.is-filter-disabled h3 {
  cursor: not-allowed;
}

input:disabled {
  cursor: not-allowed;
}

.range-stack {
  display: grid;
  gap: 6px;
}

.range-stack label {
  margin: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  color: #30394b;
  font-size: 13px;
  font-weight: 500;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.source-select-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 6px 9px;
  align-items: center;
}

.check-grid--four {
  grid-template-columns: repeat(4, max-content);
  gap: 6px 8px;
}

.check-grid label,
.wide-check,
.check-pairs label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #30394b;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.check-grid input,
.wide-check input,
.check-pairs input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.check-pairs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px 9px;
  align-items: center;
}

.check-pairs span {
  min-width: 0;
  color: #30394b;
  font-size: 12px;
}

.wide-check {
  margin-top: 0;
}

.filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px 14px;
  border-top: 1px solid var(--color-line-soft);
  background: #ffffff;
}

.filter-action {
  height: 34px;
  border: 1px solid #c8cede;
  border-radius: 7px;
  color: #30394b;
  background: #ffffff;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.filter-toggle[hidden] {
  display: none;
}

.check-grid[hidden] {
  display: none;
}

.filter-action--primary {
  border-color: var(--color-tab-active);
  color: #ffffff;
  background: var(--color-tab-active);
}

.result-region {
  min-height: 0;
  position: relative;
  overflow: auto;
  padding: 10px 6px 10px 10px;
  background: var(--color-surface-soft);
}

.result-card + .result-card {
  margin-top: 8px;
}

.result-card {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  background: var(--color-surface);
  cursor: pointer;
}

.result-card:hover,
.result-card.is-selected {
  border-color: var(--color-card-hover-border);
  background: var(--color-card-hover);
  box-shadow: var(--shadow-card-selected);
}

.result-card__icon {
  width: 72px;
  height: 72px;
  display: block;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.16);
}

.result-card__body {
  min-width: 0;
  min-height: 72px;
  display: grid;
  grid-template-rows: auto auto auto auto;
  align-content: start;
  row-gap: 3px;
}

.result-card__title-row {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.result-card__title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #202938;
  font-size: 17px;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-card__id {
  flex: 0 0 auto;
  color: #8a94a6;
  font-size: 13px;
  font-weight: 650;
}

.result-card__meta,
.result-card__source {
  overflow: hidden;
  color: #5f6b7d;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-top: 4px;
  overflow: visible;
}

.card-status-icon-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  line-height: 1;
}

.card-status-icon {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
}

.card-status-icon-tag.is-muted .card-status-icon {
  filter: grayscale(1);
  opacity: 0.38;
}

.card-dye-dots {
  position: absolute;
  right: -5px;
  bottom: -2px;
  display: inline-flex;
  gap: 1px;
}

.card-dye-dots span {
  width: 7px;
  height: 7px;
  border: 1px solid #ffffff;
  border-radius: 999px;
  background: #f4c77b;
  box-shadow: 0 0 0 1px rgba(40, 27, 12, 0.5);
}

.result-chip {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border: 1px solid #c8cede;
  border-radius: 999px;
  color: #30394b;
  background: #f7f9ff;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.result-chip.is-muted {
  color: var(--color-muted);
  background: #f8fafc;
}

.result-chip--gold {
  border-color: #ead08a;
  color: #7a4d00;
  background: #fff7df;
}

.result-chip--green {
  border-color: #bde6d2;
  color: #16704b;
  background: #eefbf5;
}

.result-load-more {
  width: 100%;
  height: 38px;
  margin-top: 10px;
  border: 1px solid #c8cede;
  border-radius: 8px;
  color: #30394b;
  background: #ffffff;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.result-load-more:hover {
  border-color: var(--color-focus);
  color: #3656d4;
  background: #f7f9ff;
}

.detail-workspace {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--color-page);
}

.detail-region {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(160px, 28%);
  gap: 16px;
  padding: 20px;
  overflow: hidden;
  background: var(--color-surface);
  border-left: 1px solid var(--color-line-soft);
}

.detail-top {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  gap: 18px;
  overflow: hidden;
}

.preview-column {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  overflow: hidden;
}

.preview-stage {
  position: relative;
  width: auto;
  max-width: 100%;
  height: calc(100% - 54px);
  max-height: 453px;
  aspect-ratio: 3 / 4;
  align-self: center;
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid var(--color-line-soft);
  border-radius: 8px;
}

.preview-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  cursor: zoom-in;
}

.preview-image.is-empty {
  visibility: hidden;
  cursor: default;
}

.preview-title {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 78px;
  margin: 0;
  color: #202938;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.2;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  text-shadow:
    0 1px 1px rgba(255, 255, 255, 0.9),
    0 0 8px rgba(255, 255, 255, 0.82),
    0 1px 8px rgba(15, 23, 42, 0.18);
}

.gender-tabs {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #b9c1cf;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(8px);
}

.gender-tabs[hidden] {
  display: none;
}

.app-shell[data-engine="accessoryPieces"] .gender-tabs,
.app-shell[data-engine="weaponPieces"] .gender-tabs {
  display: none;
}

.compact-tab,
.switch-tab {
  border: 0;
  color: #30394b;
  background: transparent;
  cursor: pointer;
}

.compact-tab {
  min-width: 26px;
  height: 22px;
  padding: 0 6px;
  font-size: 14px;
  font-weight: 650;
}

.compact-tab + .compact-tab {
  border-left: 1px solid #d3d8e2;
}

.compact-tab.is-active,
.switch-tab.is-active {
  color: #ffffff;
  background: var(--color-tab-active);
}

.switch-tab:disabled,
.switch-tab.is-disabled {
  color: #98a2b3;
  background: #eef1f5;
  cursor: not-allowed;
}

.dye-tabs {
  min-width: 0;
  height: 42px;
  flex: 0 0 42px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #c8cede;
  border-radius: 7px;
  background: var(--color-surface);
}

.switch-tab {
  min-width: 0;
  flex: 1;
  padding: 0 12px;
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
}

.switch-tab + .switch-tab {
  border-left: 1px solid #d8dce5;
}

.detail-info-area {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.basic-info-region,
.relation-region,
.acquisition-region {
  min-width: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: 8px;
}

.basic-info-region {
  position: relative;
  padding: 8px 12px;
}

.wishlist-button,
.favorite-button {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c8cfdd;
  border-radius: 8px;
  color: #667085;
  background: #ffffff;
  cursor: pointer;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease,
    transform 120ms ease;
}

.wishlist-button::before {
  content: "";
  width: 17px;
  height: 17px;
  background: currentColor;
  -webkit-mask: url("https://img.orchestrionxiv.com/images/ui/wishlist-cart.svg") center / contain no-repeat;
  mask: url("https://img.orchestrionxiv.com/images/ui/wishlist-cart.svg") center / contain no-repeat;
}

.favorite-button::before {
  content: "";
  width: 17px;
  height: 17px;
  background: currentColor;
  -webkit-mask: url("https://img.orchestrionxiv.com/images/ui/favorite-heart-off.svg") center / contain no-repeat;
  mask: url("https://img.orchestrionxiv.com/images/ui/favorite-heart-off.svg") center / contain no-repeat;
}

.favorite-button.is-active::before {
  -webkit-mask-image: url("https://img.orchestrionxiv.com/images/ui/favorite-heart-on.svg");
  mask-image: url("https://img.orchestrionxiv.com/images/ui/favorite-heart-on.svg");
}

.wishlist-button:hover,
.favorite-button:hover {
  border-color: #9bb1d9;
  color: #3656d4;
  background: #f7f9ff;
}

.wishlist-button:active,
.favorite-button:active {
  transform: translateY(1px);
}

.wishlist-button.is-active {
  border-color: #d5a940;
  color: #7a4d00;
  background: #fff4c7;
}

.favorite-button.is-active {
  border-color: #e4a7bd;
  color: #bd2f62;
  background: #fff1f6;
}

.wishlist-button--card {
  position: absolute;
  top: 6px;
  right: 6px;
}

.favorite-button--card {
  position: absolute;
  top: 42px;
  right: 6px;
}

.wishlist-button--detail {
  position: absolute;
  top: 6px;
  right: 44px;
}

.favorite-button--detail {
  position: absolute;
  top: 6px;
  right: 6px;
}

.basic-info-content {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  min-width: 0;
}

.item-icon {
  width: 48px;
  height: 48px;
  display: block;
  align-self: center;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.18);
}

.basic-info-body {
  min-width: 0;
  display: grid;
  gap: 6px;
  align-content: center;
}

.info-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
}

.info-grid span {
  color: #30394b;
  font-size: 15px;
  font-weight: 600;
}

.info-grid strong {
  color: #111827;
  font-size: inherit;
  font-weight: 700;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0;
}

.info-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border: 1px solid #c8cede;
  border-radius: 999px;
  color: #30394b;
  background: #f7f9ff;
  font-size: 12px;
  font-weight: 650;
}

.info-tag.is-muted {
  color: var(--color-muted);
  background: #f8fafc;
}

.info-tag--gold {
  border-color: #ead08a;
  color: #7a4d00;
  background: #fff7df;
}

.info-tag--green {
  border-color: #bde6d2;
  color: #16704b;
  background: #eefbf5;
}

.relation-regions {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr);
  gap: 14px;
  overflow: hidden;
}

.relation-region {
  min-height: 0;
  padding: 16px;
  overflow: hidden;
}

.relation-region h3,
.acquisition-region h3 {
  margin: 0;
  color: #202938;
  font-size: 20px;
  line-height: 1.2;
}

.relation-region p {
  margin: 12px 0 12px;
  color: #30394b;
  font-size: 18px;
  font-weight: 750;
}

#setPanelTitle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.relation-region ul {
  margin: 0;
  padding: 0;
  list-style: none;
  color: #374151;
  font-size: 15px;
  line-height: 1.5;
}

.relation-region li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relation-region li.is-current {
  font-weight: 700;
}

.set-piece-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}

.set-piece-link {
  min-width: 0;
  overflow: hidden;
  border: 0;
  padding: 0;
  color: #2459c5;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.set-piece-row.is-current .set-piece-link {
  color: #1f4f95;
  font-weight: 800;
}

.set-piece-link:hover {
  text-decoration: underline;
}

.set-panel-title-link {
  min-width: 0;
  overflow: hidden;
  border: 0;
  padding: 0;
  color: #2459c5;
  background: transparent;
  font: inherit;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.set-panel-title-link:hover {
  text-decoration: underline;
}

.set-panel-title-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.set-panel-type-tag {
  justify-self: start;
  flex: 0 0 auto;
  padding: 2px 8px;
  border: 1px solid #d5dce8;
  border-radius: 999px;
  color: #667085;
  background: #f7f9fc;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.set-panel-type-tag--official {
  border-color: #efd082;
  color: #8a5b00;
  background: #fff4c7;
}

.set-panel-type-tag--custom {
  border-color: #d5dce8;
  color: #667085;
  background: #f7f9fc;
}

.set-piece-preview-link {
  border: 0;
  padding: 0;
  color: #667085;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}

.set-piece-preview-link:hover {
  color: #3656d4;
  text-decoration: underline;
}

.set-piece-empty {
  color: var(--color-muted);
}

.relation-region.has-race-preview {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.relation-region.has-race-preview > #setPanelTitle {
  margin-bottom: 6px;
}

.relation-region.has-race-preview > #setPanelList {
  flex: 0 0 auto;
}

.race-preview-panel {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--color-line-soft);
}

.race-preview-panel[hidden] {
  display: none;
}

.race-preview-panel h3 {
  margin-bottom: 12px;
}

.race-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.race-preview-grid button {
  min-width: 0;
  min-height: 42px;
  border: 1px solid #c8cfdd;
  border-radius: 7px;
  padding: 7px 4px;
  color: #30394b;
  background: #f7f9fc;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}

.race-preview-grid button:hover {
  border-color: #9bb1d9;
  color: #2449b8;
  background: #f4f7ff;
}

.race-preview-grid button.is-active {
  border-color: #283956;
  color: #ffffff;
  background: #283956;
}

.model-table-wrap {
  min-height: 0;
  height: calc(100% - 28px);
  margin: 10px -16px -16px;
  overflow: auto;
  border-top: 1px solid var(--color-line-soft);
}

.model-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.model-table th,
.model-table td {
  padding: 8px 10px;
  border-right: 1px solid var(--color-line-soft);
  border-bottom: 1px solid var(--color-line-soft);
  text-align: left;
  vertical-align: middle;
}

.model-table th:last-child,
.model-table td:last-child {
  border-right: 0;
}

.model-table tbody tr:last-child td {
  border-bottom: 0;
}

.model-table th {
  color: var(--color-muted);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.model-table td:nth-child(2),
.model-table td:nth-child(3) {
  width: 52px;
  white-space: nowrap;
}

.model-table td:nth-child(4) {
  width: 52px;
  text-align: center;
  white-space: nowrap;
}

.model-table tr.is-current {
  background: #fff4c7;
}

.model-table tr.is-current td {
  border-bottom-color: #edd48d;
}

.model-table tr.is-same-model-only {
  background: #fbfcff;
}

.model-name-cell {
  min-width: 150px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.model-name-cell img {
  width: 20px;
  height: 20px;
  display: block;
  border-radius: 3px;
}

.model-name-link {
  min-width: 0;
  overflow: hidden;
  border: 0;
  padding: 0;
  color: #2459c5;
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.3;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.model-name-link:hover {
  text-decoration: underline;
}

.model-name-link--static {
  color: #475467;
  font-weight: 650;
  cursor: default;
}

.model-name-link--static:hover {
  text-decoration: none;
}

.model-preview-button,
.model-preview-link {
  border: 0;
  padding: 0;
  color: #667085;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
}

.model-preview-button:hover,
.model-preview-link:hover {
  color: #3656d4;
  text-decoration: underline;
}

.model-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.model-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid #ead08a;
  border-radius: 999px;
  color: #7a4d00;
  background: #fff7df;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.model-tag.is-muted {
  border-color: #d7dce5;
  color: #667085;
  background: #f8fafc;
}

.model-tag.is-dye {
  border-color: #d8c7ff;
  color: #56349b;
  background: #f4efff;
}

.model-tag.is-dresser {
  border-color: #bde6d2;
  color: #16704b;
  background: #eefbf5;
}

.model-status-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.model-source-cell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.model-source-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
}

.acquisition-detail-cell {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 8px;
  row-gap: 2px;
}

.acquisition-detail-cell__main {
  color: #101828;
  font-size: 14px;
  line-height: 1.35;
}

.acquisition-detail-cell__sub {
  color: #667085;
  font-size: 12px;
  line-height: 1.3;
}

.acquisition-region {
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.acquisition-table-wrap {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.acquisition-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.acquisition-table th,
.acquisition-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-line-soft);
  border-right: 1px solid var(--color-line-soft);
  text-align: left;
  vertical-align: top;
}

.acquisition-table th:last-child,
.acquisition-table td:last-child {
  border-right: 0;
}

.acquisition-table th {
  color: var(--color-muted);
  background: #f8fafc;
  font-size: 13px;
  font-weight: 700;
}

.acquisition-table tbody tr:last-child td {
  border-bottom: 0;
}

.acquisition-cell-lines {
  display: grid;
  gap: 3px;
  line-height: 1.45;
}

.acquisition-npc-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.acquisition-location-text {
  overflow: hidden;
  color: #8a94a6;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-bar {
  min-width: 0;
  display: grid;
  grid-template-columns: var(--left-column-width) 1fr;
  align-items: stretch;
  background: var(--color-header);
  border-top: 1px solid var(--color-line);
}

.current-filters {
  display: flex;
  align-items: center;
  padding: 0 20px;
  color: var(--color-muted);
  background: var(--color-surface);
  border-right: 1px solid var(--color-line);
  font-size: 14px;
  font-weight: 600;
}

.status-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 20px;
}

.copyright-notice {
  margin-right: auto;
  overflow: hidden;
  color: #8a94a6;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.utility-button {
  width: 34px;
  height: 34px;
  border: 1px solid #c8cfdd;
  border-radius: 999px;
  color: #30394b;
  background: var(--color-surface);
  box-shadow: 0 6px 18px rgba(31, 41, 55, 0.10);
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.utility-button:hover {
  border-color: var(--color-focus);
  color: #3656d4;
  background: #f7f9ff;
}

.app-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 36px;
  background: rgba(15, 23, 42, 0.16);
}

.app-modal {
  width: min(720px, calc(100vw - 72px));
  max-height: min(760px, calc(100vh - 72px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #cfd6e3;
  border-radius: var(--radius-panel);
  background: var(--color-surface);
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.18);
}

.app-modal--settings {
  width: min(520px, calc(100vw - 72px));
}

.app-modal--wishlist-recommend {
  width: min(860px, calc(100vw - 72px));
}

.image-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  overflow: auto;
  padding: 24px;
  background: rgba(0, 0, 0, 0.78);
}

.image-viewer-image {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 78vh;
  display: block;
  object-fit: contain;
  border-radius: 10px;
  background: #222222;
  cursor: zoom-in;
  touch-action: none;
  user-select: none;
}

.image-viewer-caption {
  position: relative;
  z-index: 2;
  color: #ffffff;
  font-size: 14px;
  text-align: center;
}

.image-viewer-close {
  position: fixed;
  top: 18px;
  right: 24px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  color: #222222;
  background: #ffffff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.image-viewer-toolbar {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 3;
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  transform: translateX(-50%);
}

.image-viewer-toolbar button {
  min-width: 44px;
  height: 32px;
  border: 1px solid #c8cede;
  border-radius: 999px;
  color: #222222;
  background: #ffffff;
  font-size: 14px;
  cursor: pointer;
}

.image-viewer-toolbar button:hover {
  background: #eef3ff;
}

.image-viewer-zoom-input-wrap {
  height: 32px;
  min-width: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0 8px;
  border: 1px solid #c8cede;
  border-radius: 999px;
  color: #222222;
  background: #ffffff;
  font-size: 14px;
}

.image-viewer-zoom-input {
  width: 42px;
  border: 0;
  outline: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: right;
}

.image-viewer-zoom-input::-webkit-outer-spin-button,
.image-viewer-zoom-input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.app-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--color-line-soft);
}

.app-modal__header h2 {
  margin: 0;
  color: var(--color-text);
  font-size: 22px;
  line-height: 1.25;
}

.app-modal__header p {
  margin: 6px 0 0;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.5;
}

.app-modal__close {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid #cfd6e3;
  border-radius: 8px;
  color: var(--color-muted);
  background: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.app-modal__close:hover {
  border-color: var(--color-focus);
  color: var(--color-focus);
  background: #f7f9ff;
}

.app-modal__body {
  min-height: 0;
  overflow: auto;
  padding: 20px 22px;
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.75;
}

.app-modal__body h3,
.app-modal__body h4 {
  margin: 18px 0 8px;
  color: var(--color-text);
  font-size: 17px;
  line-height: 1.4;
}

.app-modal__body h3:first-child,
.app-modal__body h4:first-child,
.app-modal__body p:first-child {
  margin-top: 0;
}

.app-modal__body p {
  margin: 0 0 12px;
}

.app-modal__body ul,
.app-modal__body ol {
  margin: 0 0 14px 20px;
  padding: 0;
}

.app-modal__body li + li {
  margin-top: 4px;
}

.app-modal__body code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #f1f4f9;
  font-size: 0.92em;
}

.app-modal__body a {
  color: #2459c5;
  font-weight: 650;
}

.app-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--color-line-soft);
  background: #fbfcfe;
}

.app-modal-button {
  height: 36px;
  min-width: 120px;
  padding: 0 16px;
  border: 1px solid #cfd6e3;
  border-radius: 8px;
  color: var(--color-text);
  background: #fff;
  font-size: 14px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

#firstRunNoticeAcceptButton {
  min-width: 148px;
}

.app-modal-button:hover {
  border-color: var(--color-focus);
  color: var(--color-focus);
  background: #f7f9ff;
}

.app-modal-button--primary {
  border-color: var(--color-tab-active);
  color: #fff;
  background: var(--color-tab-active);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
}

.app-modal-button--primary:hover {
  border-color: #1f2a44;
  color: #fff;
  background: #1f2a44;
}

.settings-fieldset {
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-panel);
}

.settings-fieldset legend {
  padding: 0 6px;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 800;
}

.settings-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.settings-option input {
  width: 16px;
  height: 16px;
}

.wishlist-recommend-compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  margin-bottom: 16px;
}

.wishlist-recommend-card {
  position: relative;
  min-width: 0;
  display: block;
  width: 100%;
  padding: 12px;
  border: 1px solid #d8dce5;
  border-radius: 8px;
  color: inherit;
  background: #fbfcff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.wishlist-recommend-card:has(.wishlist-recommend-best) {
  border-color: #9fb0e4;
  background: #f6f8ff;
  box-shadow: inset 0 0 0 1px rgba(79, 104, 215, 0.08);
}

.wishlist-recommend-card:hover {
  border-color: #9fb0e4;
  background: #f7f9ff;
}

.wishlist-recommend-card.is-selected {
  border-color: #4f68d7;
  background: #f2f5ff;
  box-shadow: inset 0 0 0 1px rgba(79, 104, 215, 0.24), 0 6px 18px rgba(79, 104, 215, 0.14);
}

.wishlist-recommend-card.is-selected .wishlist-recommend-label::after {
  content: "已选择";
  margin-left: 6px;
  padding-left: 6px;
  border-left: 1px solid rgba(79, 104, 215, 0.28);
  font-size: 11px;
  font-weight: 700;
}

.wishlist-recommend-label {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 20px;
  margin-bottom: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #4b5568;
  background: #eef1f7;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.wishlist-recommend-label.wishlist-recommend-best {
  color: #4f68d7;
  background: #e9edff;
}

.wishlist-rec-card-inner {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 12px;
  align-items: flex-start;
}

.wishlist-rec-card-info {
  min-width: 0;
  display: flex;
  gap: 11px;
}

.wishlist-rec-card-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 7px;
  object-fit: cover;
  background: #d7dce7;
  box-shadow: inset 0 0 0 1px rgba(48, 57, 75, 0.16);
}

.wishlist-rec-card-icon-missing {
  border: 1px dashed #aeb7ca;
}

.wishlist-rec-card-body {
  min-width: 0;
  flex: 1;
}

.wishlist-rec-card-name {
  display: block;
  margin-bottom: 3px;
  color: #232a3a;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.25;
}

.wishlist-rec-card-subtitle,
.wishlist-rec-card-source {
  display: block;
  overflow: hidden;
  color: #5f687a;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wishlist-rec-card-source {
  margin-top: 2px;
  color: #7a8394;
}

.wishlist-rec-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  overflow: visible;
  white-space: normal;
}

.wishlist-rec-preview {
  width: 112px;
  aspect-ratio: 3 / 4;
  display: block;
  overflow: hidden;
  border: 1px solid #d8dce5;
  border-radius: 8px;
  background: #eef1f7;
}

.wishlist-rec-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top center;
}

.wishlist-rec-preview-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a93a5;
  font-size: 12px;
  text-align: center;
}

.wishlist-recommend-cleanup-option {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 10px 0 0;
  padding: 8px 9px;
  border: 1px solid #d8dce5;
  border-radius: 6px;
  color: #4b5568;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.35;
  cursor: pointer;
}

.wishlist-recommend-card.is-selected .wishlist-recommend-cleanup-option {
  border-color: #b8c4f0;
  background: #ffffff;
}

.wishlist-recommend-cleanup-option input {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  accent-color: #4f68d7;
}

.wishlist-recommend-cleanup-option span {
  min-width: 0;
}

@media (max-width: 760px) {
  .wishlist-recommend-compare {
    grid-template-columns: 1fr;
  }

  .wishlist-rec-card-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .wishlist-rec-preview {
    width: 100%;
    height: auto;
  }
}

.app-info-loading,
.app-info-error {
  color: var(--color-muted);
}

.region-label {
  color: var(--color-muted);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.detail-region .region-label {
  position: absolute;
  left: 18px;
  top: 18px;
}

.wishlist-instance-groups {
  display: grid;
  gap: 12px;
}

.wishlist-instance-group {
  overflow: hidden;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  background: #fff;
}

.wishlist-instance-item-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.wishlist-instance-subgroup {
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fbfcff;
}

.wishlist-instance-subgroup__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  border-bottom: 1px solid #dbe3ef;
  background: #eef3f9;
}

.wishlist-instance-subgroup__header h4 {
  margin: 0;
  color: #1f2937;
  font-size: 16px;
  line-height: 1.35;
}

.wishlist-instance-subgroup__header p {
  margin: 3px 0 0;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.wishlist-instance-subgroup__header span {
  color: #344054;
  font-weight: 800;
  white-space: nowrap;
}

.wishlist-instance-subgroup__items {
  display: grid;
}

.wishlist-instance-item {
  display: grid;
  grid-template-columns: minmax(170px, 1.1fr) minmax(150px, 0.9fr) minmax(170px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #e6ebf2;
}

.wishlist-instance-item:last-child {
  border-bottom: 0;
}

.wishlist-instance-item__name {
  color: #1f2937;
  font-weight: 800;
}

.wishlist-instance-item__meta {
  color: #667085;
  font-weight: 700;
}

.wishlist-instance-item strong {
  color: #344054;
  font-weight: 850;
}

.wishlist-instance-item small {
  grid-column: 1 / -1;
  color: #7a8699;
  font-weight: 650;
}

@media (max-width: 760px) {
  .wishlist-instance-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
}
