/* 上传零件页：按设计图对齐虚线上传区 + 四步流程 + 卖点卡片 */

.upload-page {
  padding: 48px 0 80px;
  background: #fff;
}

/* —— 上传虚线框 —— */
.upload-hero__inner {
  width: min(1040px, calc(100% - 48px));
  margin: 0 auto;
}

.upload-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  padding: 56px 32px 48px;
  border: 2px dashed #c5c5c5;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}

.upload-drop.is-dragging,
.upload-drop:hover {
  border-color: var(--blue);
  background: #f7fbff;
}

.upload-drop__cloud {
  width: 100px;
  height: auto;
  margin-bottom: 28px;
  pointer-events: none;
}

.upload-drop__btn {
  min-width: 240px;
  min-height: 54px;
  padding: 0 40px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: none;
}

.upload-drop__or {
  margin-top: 20px;
  color: var(--blue);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.upload-drop__hint {
  margin-top: 12px;
  color: #1a1a1a;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.upload-drop__formats {
  margin-top: 10px;
  color: #9b9b9b;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}

.upload-drop__file {
  margin-top: 14px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

/* —— How it works：整图（图标+虚线）+ 下方文案按图标中心对齐 —— */
.upload-steps {
  margin-top: 64px;
}

.upload-steps__inner {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
}

.upload-steps__visual {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
}

/*
 * 步骤图图标中心约在 8.5% / 37.2% / 66.0% / 94.6%，
 * 用绝对定位 + translateX(-50%) 让标题/描述落在对应图标正下方。
 */
.upload-steps__grid {
  position: relative;
  display: block;
  margin-top: 12px;
  /* 文案绝对定位脱流，预留标题+多行描述高度 */
  min-height: 120px;
}

.upload-step {
  position: absolute;
  top: 0;
  width: 22%;
  max-width: 200px;
  min-width: 0;
  padding: 0;
  text-align: center;
  transform: translateX(-50%);
}

.upload-step:nth-child(1) { left: 8.5%; }
.upload-step:nth-child(2) { left: 37.2%; }
.upload-step:nth-child(3) { left: 66%; }
.upload-step:nth-child(4) { left: 94.6%; }

.upload-step h3 {
  margin: 0 0 8px;
  color: #111;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}

.upload-step p {
  margin: 0 auto;
  max-width: 200px;
  color: #666;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
}

/* —— Buy Bricks 卖点：标题左 + 图标右上，正文铺满下方 —— */
.upload-benefits {
  margin-top: 72px;
}

.upload-benefits__title {
  margin: 0 0 68px;
  text-align: center;
  color: #111;
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.upload-benefits__title span {
  color: var(--blue);
}

.upload-benefits__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  /* 为图标上溢出留出空间 */
  padding-top: 28px;
}

.upload-benefit {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 20px 18px 18px;
  border-radius: 14px;
  background: #fff8e0;
  overflow: visible;
}

.upload-benefit__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.upload-benefit h3 {
  flex: 1;
  margin: 0;
  padding-top: 2px;
  padding-right: 78px;
  color: var(--blue);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.upload-benefit__icon {
  position: absolute;
  top: -28px;
  right: 14px;
  width: 72px;
  height: auto;
  pointer-events: none;
}

.upload-benefit p {
  margin: 0;
  color: #222;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
}

/* —— 响应式 —— */
@media (max-width: 1100px) {
  .upload-benefits__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .upload-steps__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 12px;
    margin-top: 20px;
    min-height: 0;
  }

  .upload-step {
    position: static;
    width: auto;
    max-width: none;
    transform: none;
    padding: 0 6px;
  }

  .upload-step p {
    max-width: none;
  }
}

@media (max-width: 820px) {
  .upload-page {
    padding: 28px 0 56px;
  }

  .upload-hero__inner {
    width: min(1040px, calc(100% - 32px));
  }

  .upload-drop {
    min-height: 320px;
    padding: 40px 20px 36px;
  }

  .upload-drop__cloud {
    width: 80px;
    margin-bottom: 20px;
  }

  .upload-steps {
    margin-top: 44px;
  }

  .upload-benefits {
    margin-top: 52px;
  }
}

@media (max-width: 560px) {
  .upload-drop {
    min-height: 280px;
    border-radius: 10px;
  }

  .upload-drop__btn {
    width: 100%;
    max-width: 280px;
    min-height: 50px;
    font-size: 16px;
  }

  .upload-drop__hint {
    font-size: 14px;
  }

  .upload-drop__formats {
    font-size: 12px;
  }

  .upload-steps__grid,
  .upload-benefits__grid {
    grid-template-columns: 1fr;
  }

  .upload-step {
    padding: 0;
  }

  .upload-benefit {
    min-height: 0;
  }

  .upload-benefit__icon {
    width: 64px;
    top: -24px;
    right: 12px;
  }
}

/* —— 上传后的可购零件页 —— */
.upload-page.is-parts {
  padding: 0;
}

.has-part-list .dock {
  display: none;
}

.plist-page {
  padding: 22px 0 56px;
  background: #fff;
}

.plist {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) 228px;
  grid-template-areas:
    "side tools summary"
    "side filters summary"
    "side actions summary"
    "side grid summary";
  column-gap: 16px;
  row-gap: 12px;
  align-items: start;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.plist-side {
  grid-area: side;
  padding: 14px 12px 12px;
  border-radius: 16px;
  background: #e7f4fc;
}
.plist-tools { grid-area: tools; }
.plist-filters { grid-area: filters; }
.plist-actions { grid-area: actions; }
.plist-grid,
.plist-empty { grid-area: grid; }
.plist-summary { grid-area: summary; }

.plist-side__upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  border-radius: 22px;
  background: var(--yellow);
  color: #1a1a1a;
  font-size: 15px;
  font-weight: 800;
}

.plist-side__upload img {
  width: 28px;
  height: auto;
}

.plist-side__label {
  margin-top: 12px;
  color: #8d8d8d;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.plist-formats {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.plist-formats span {
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.plist-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
}

.plist-brands {
  display: flex;
  align-items: center;
  gap: 6px;
}

.plist-brands button {
  padding: 8px 16px;
  border-radius: 999px;
  color: #222;
  font-size: 14px;
  font-weight: 800;
}

.plist-brands button.is-on {
  background: var(--yellow);
}

.plist-tools__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plist-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.plist-pill img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.plist-history,
.plist-sort {
  position: relative;
}

.plist-filters {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 42px;
  padding: 6px 16px;
  border-radius: 10px;
  background: #eef1f4;
}

.plist-filters__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.plist-filters__btn img {
  width: 22px;
  height: 22px;
}

.plist-sort {
  margin-left: auto;
}

.plist-sort__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #222;
  font-size: 14px;
  font-weight: 800;
}

.plist-sort__btn span {
  color: var(--blue);
  font-weight: 800;
}

.plist-sort__btn img {
  width: 10px;
  height: 8px;
  object-fit: contain;
}

.plist-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 6;
  min-width: 196px;
  padding: 6px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.plist-menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  color: #222;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.plist-menu button:hover,
.plist-menu button.is-on {
  background: #f3f8fc;
  color: var(--blue);
}

.plist-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
}

.plist-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #333;
  font-size: 14px;
  font-weight: 700;
}

.plist-actions__ops {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.plist-op {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px 0 6px;
  border-radius: 16px;
  background: var(--yellow);
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 800;
}

.plist-op img {
  width: 20px;
  height: 20px;
}

.plist-op:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: none;
}

.tick img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.tick.is-on {
  border: 1.5px solid var(--blue);
  border-radius: 3px;
  background: var(--blue);
}

.tick.is-on::after {
  content: "";
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.plist-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px 12px;
}

.plist-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0 0 10px;
  border: 1.5px solid #e4e4e4;
  border-radius: 12px;
  background: #fff;
}

.plist-card.is-selected {
  border-color: #7ec8f0;
}

.plist-card.is-coloring {
  z-index: 3;
}

.plist-card__media {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 132px;
  margin-bottom: 8px;
  padding: 18px 8px 12px;
  border-radius: 10px 10px 0 0;
  background: #f2f3f5;
}

.plist-card__check {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 0;
  z-index: 1;
}

.plist-card__issue {
  position: absolute;
  top: 8px;
  left: 32px;
  max-width: calc(100% - 72px);
  overflow: hidden;
  color: #e53935;
  font-size: 12px;
  font-weight: 800;
  line-height: 16px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.plist-card__logo {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e0e0e0;
  color: #b0b0b0;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}

.plist-card__brick {
  width: 58px;
}

.plist-card__brick svg {
  display: block;
  width: 100%;
  height: auto;
}

.plist-card__x {
  margin-top: 4px;
  color: #222;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.plist-card__step {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.plist-card__step button {
  padding: 0;
}

.plist-card__step img {
  width: 22px;
  height: 22px;
}

.plist-card__step span {
  min-width: 12px;
  color: #222;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.plist-card h3 {
  margin: 0 10px;
  color: #222;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.plist-card__code {
  margin: 2px 10px 0;
  color: #9aa0a6;
  font-size: 11px;
  font-weight: 700;
}

.plist-card__badge {
  margin: 2px 10px 0;
  color: #e53935;
  font-size: 11px;
  font-weight: 800;
}

.plist-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 10px 0;
}

.plist-card__meta strong {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.plist-card__aside {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex: none;
  max-width: 100%;
}

.plist-card__colorname {
  color: #8d8d8d;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.plist-card__color {
  flex: none;
  min-width: 44px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #1f78c8;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.plist-color {
  position: absolute;
  right: 8px;
  bottom: 36px;
  z-index: 4;
  display: grid;
  gap: 2px;
  min-width: 148px;
  padding: 6px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.plist-color button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  color: #222;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.plist-color button:hover {
  background: #f3f8fc;
}

.plist-color i {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
}

.plist-empty {
  padding: 48px 12px;
  color: #888;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.plist-summary {
  position: sticky;
  top: 118px;
  padding: 16px 14px 14px;
  border-radius: 16px;
  background: #fff4cc;
}

.plist-summary h2 {
  color: var(--blue);
  font-size: 16px;
  font-weight: 800;
}

.plist-summary__file {
  margin-top: 4px;
  color: #9a9a9a;
  font-size: 12px;
  font-weight: 700;
  word-break: break-all;
}

.plist-summary__box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(160, 130, 20, 0.08);
}

.plist-summary__total {
  color: #222;
  font-size: 14px;
  font-weight: 800;
}

.plist-summary__row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}

.plist-summary__row img {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  flex: none;
}

.plist-summary__row--ok { color: var(--blue); }
.plist-summary__row--no { color: #e53935; }

.plist-summary__price {
  margin-top: 16px;
  color: var(--blue);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-align: center;
}

.plist-summary__sub {
  margin-top: 2px;
  color: #8a8a8a;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.plist-summary__cart,
.plist-summary__save {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 800;
}

.plist-summary__cart {
  margin-top: 14px;
  background: var(--yellow);
  color: #1a1a1a;
}

.plist-summary__save {
  margin-top: 8px;
  background: var(--blue);
  color: #fff;
}

.plist-summary__cart img,
.plist-summary__save img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* 存盘图标本身是蓝色，蓝底按钮上改成白色 */
.plist-summary__save img {
  filter: brightness(0) invert(1);
}

.plist-summary__ship {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  color: #6f6f6f;
  font-size: 12px;
  font-weight: 700;
}

.plist-summary__ship img {
  width: 18px;
  height: 16px;
  object-fit: contain;
  /* 白色货车剪影改成品牌蓝，浅黄底上才看得见 */
  filter: brightness(0) saturate(100%) invert(31%) sepia(86%) saturate(1748%) hue-rotate(176deg) brightness(94%) contrast(101%);
}

@media (max-width: 1200px) {
  .plist-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .plist {
    grid-template-columns: 1fr;
    grid-template-areas:
      "side"
      "tools"
      "filters"
      "actions"
      "grid"
      "summary";
  }

  .plist-summary {
    position: static;
  }

  .plist-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .plist-side {
    max-width: 220px;
  }

  .plist-side__upload {
    max-width: none;
  }

  .plist-formats,
  .plist-side__label {
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .plist-tools,
  .plist-filters,
  .plist-actions {
    flex-wrap: wrap;
  }

  .plist-sort {
    margin-left: 0;
  }

  .plist-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 缺颜色零件的选色弹窗 */
.plist-card.is-nocolor,
.plist-card.is-unknown,
.plist-card.is-replaceable {
  cursor: pointer;
}

.color-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(78, 82, 88, 0.42);
}

.color-modal__panel {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  width: min(940px, 100%);
  min-height: 540px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.color-modal__side {
  padding: 22px 18px 24px;
  border-right: 1px solid #ededed;
}

.color-modal__search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  background: #fff;
}

.color-modal__search svg {
  flex: none;
  width: 16px;
  height: 16px;
}

.color-modal__search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #222;
  font-size: 14px;
}

.color-modal__search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.color-modal__groups {
  margin-top: 8px;
}

.color-modal__group {
  margin-top: 16px;
}

.color-modal__group h3 {
  margin-bottom: 2px;
  color: #222;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.color-modal__swatches {
  display: grid;
  grid-template-columns: repeat(3, 46px);
  gap: 14px 10px;
  padding-top: 18px;
}

.color-modal__swatch {
  position: relative;
  width: 46px;
  height: 26px;
  padding: 0;
}

.color-modal__swatch i {
  display: block;
  width: 42px;
  height: 22px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.color-modal__swatch.is-pearl i {
  background-image: linear-gradient(140deg, rgba(255, 255, 255, 0.72), transparent 42%, rgba(0, 0, 0, 0.14));
}

.color-modal__swatch.is-clear i {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent);
}

.color-modal__badge {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  z-index: 1;
  height: 20px;
  padding: 0 8px;
  border-radius: 5px;
  background: #2f86d6;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}

.color-modal__badge::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  border: 4px solid transparent;
  border-top-color: #2f86d6;
  transform: translateX(-50%);
}

.color-modal__none {
  margin-top: 18px;
  color: #999;
  font-size: 13px;
  font-weight: 700;
}

.color-modal__main {
  display: flex;
  flex-direction: column;
  min-height: 540px;
  padding: 22px 28px 32px;
}

.color-modal__variants {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.color-modal__variant {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 112px;
  padding: 0;
  background: none;
  color: #9aa0a6;
}

.color-modal__face {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  background: #f3f4f6;
}

.color-modal__variant.is-on .color-modal__face {
  box-shadow: inset 0 0 0 2px #7ec8f0;
}

.color-modal__stud {
  display: block;
  width: 78px;
  height: 66px;
  margin: 0 auto;
}

.color-modal__stud svg {
  display: block;
  width: 100%;
  height: 100%;
}

.color-modal__name {
  display: block;
  margin-top: 8px;
  color: #555;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.color-modal__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 88px;
  margin-top: auto;
  padding-top: 24px;
}

.color-modal__cancel,
.color-modal__ok {
  min-width: 112px;
  height: 38px;
  padding: 0 26px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 800;
}

.color-modal__cancel {
  background: #1f78c8;
  color: #fff;
}

.color-modal__ok {
  background: var(--yellow);
  color: #1a1a1a;
}

.part-modal__panel {
  grid-template-columns: 210px minmax(0, 1fr);
  width: min(1000px, 100%);
  min-height: 0;
}

.part-modal__panel .color-modal__main {
  min-height: 0;
}

.part-modal__panel .color-modal__actions {
  margin-top: auto;
  padding-top: 8px;
}

.part-modal__panel .color-modal__side {
  padding: 24px 20px 24px 28px;
}

.part-modal__cats {
  margin-top: 18px;
}

.part-modal__cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 12px 2px;
  color: #222;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
}

.part-modal__play {
  flex: none;
  width: 15px;
  height: 15px;
  transition: transform 0.2s ease;
}

.part-modal__play.is-open {
  transform: rotate(90deg);
}

.part-modal__cat.is-on {
  color: #1f78c8;
}

.part-modal__sub {
  display: block;
  width: 100%;
  padding: 8px 8px 8px 16px;
  color: #666;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
}

.part-modal__sub.is-on {
  color: #1f78c8;
  font-weight: 800;
}

.part-modal__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.part-modal__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  background: none;
  color: #a0a4aa;
}

.part-modal__face {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  background: #f4f5f7;
}

.part-modal__item.is-on .part-modal__face {
  box-shadow: inset 0 0 0 2px #7ec8f0;
}

.part-modal__brick {
  display: block;
  width: 62%;
  height: auto;
  aspect-ratio: 96 / 78;
  margin: 0 auto 6px;
}

.part-modal__brick svg {
  display: block;
  width: 100%;
  height: 100%;
}

.part-modal__name {
  display: block;
  margin-top: 8px;
  color: #555;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.brand-modal__panel {
  min-height: 520px;
}

.brand-modal__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 22px;
}

.brand-modal__list button {
  padding: 2px 0;
  color: #222;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  text-align: left;
}

.brand-modal__list button.is-on {
  color: #1f78c8;
}

.brand-modal__grid {
  display: grid;
  grid-template-columns: repeat(4, 112px);
  gap: 16px;
}

.brand-modal__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  background: none;
}

.brand-modal__face {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  aspect-ratio: 1;
  border-radius: 14px;
  background: #f4f5f7;
}

.brand-modal__item.is-on .brand-modal__face {
  box-shadow: inset 0 0 0 2px #7ec8f0;
}

.brand-modal__name {
  display: block;
  margin-top: 8px;
  color: #555;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

@media (max-width: 760px) {
  .color-modal {
    align-items: flex-start;
    overflow: auto;
  }

  .color-modal__panel {
    grid-template-columns: 1fr;
    min-height: 0;
    margin: 16px 0;
  }

  .color-modal__main {
    min-height: 0;
    padding-top: 8px;
  }

  .color-modal__actions {
    position: sticky;
    bottom: 0;
    gap: 24px;
    margin-top: 12px;
    padding: 12px 0 4px;
    background: #fff;
  }

  .part-modal__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .brand-modal__grid {
    grid-template-columns: repeat(2, 112px);
  }
}

/* 加入我的零件清单 */
.addto {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(90, 94, 100, 0.38);
}

.addto__panel {
  position: relative;
  width: min(560px, 100%);
  padding: 32px 48px 40px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16);
}

.addto__close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 32px;
  height: 32px;
  padding: 0;
}

.addto__close img {
  display: block;
  width: 32px;
  height: 32px;
}

.addto__panel h2 {
  margin: 0 48px 22px 0;
  color: #006db8;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.addto__field {
  position: relative;
}

.addto__select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  height: 44px;
  padding: 0 8px 0 20px;
  border-radius: 8px;
  background: #f6f6f6;
  color: #222;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
}

.addto__select.is-new {
  color: #006db8;
}

.addto__select span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.addto__select:focus {
  outline: none;
}

.addto__select img {
  width: 26px;
  height: 26px;
  flex: none;
}

.addto__menu {
  max-height: 220px;
  margin-top: 8px;
  overflow: auto;
  padding: 6px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.addto__menu button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  color: #222;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
}

.addto__menu button.is-create {
  color: #006db8;
}

.addto__menu button:hover,
.addto__menu button.is-on {
  background: #f3f8fc;
}

.addto__name {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 28px;
  padding: 0 20px;
  border: none;
  border-radius: 8px;
  background: #f6f6f6;
  color: #222;
  font-size: 16px;
  font-weight: 600;
}

.addto__name::placeholder {
  color: #8a8a8a;
  font-weight: 600;
}

.addto__name:focus {
  outline: none;
}

.addto__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 44px;
  margin-top: 72px;
}

.addto__panel.is-naming .addto__actions {
  margin-top: 40px;
}

.addto__cancel,
.addto__ok {
  width: 176px;
  height: 44px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 800;
}

.addto__cancel {
  background: #006db8;
  color: #fff;
}

.addto__ok {
  background: #f5ce00;
  color: #1a1a1a;
}

@media (max-width: 560px) {
  .addto__panel {
    padding: 22px 16px 24px;
  }

  .addto__actions {
    gap: 16px;
  }

  .addto__cancel,
  .addto__ok {
    width: 132px;
    height: 42px;
    font-size: 16px;
  }
}

/* 点击 History：修改前 / 修改后对照 */
.hist {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 168px 24px 32px;
  overflow: auto;
  background: rgba(78, 82, 88, 0.42);
}

.hist__panel {
  display: flex;
  flex-direction: column;
  width: min(1120px, 100%);
  min-height: min(540px, calc(100vh - 200px));
  max-height: calc(100vh - 200px);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.hist__banner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: none;
}

.hist__banner-before,
.hist__banner-after {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  font-size: 16px;
  font-weight: 800;
}

.hist__banner-before {
  background: #006db8;
  color: #fff;
}

.hist__banner-after {
  background: #fbce01;
  color: #1a1a1a;
}

.hist__sheet {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.hist__sheet-inner {
  min-width: 960px;
}

.hist__pair {
  position: relative;
}

.hist__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.hist__before,
.hist__after {
  display: grid;
  align-items: center;
  min-height: 44px;
  text-align: center;
}

.hist__before {
  grid-template-columns: 108px repeat(4, minmax(0, 1fr));
  padding: 0 10px 0 16px;
}

.hist__after {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 16px 0 22px;
}

.hist__pair--head {
  position: sticky;
  top: 0;
  z-index: 1;
}

.hist__pair--head .hist__before {
  background: #eff8ff;
  color: #222;
  font-size: 14px;
  font-weight: 800;
}

.hist__pair--head .hist__after {
  background: #fff9d6;
  color: #222;
  font-size: 14px;
  font-weight: 800;
}

.hist__sel {
  display: grid;
  grid-template-columns: 74px 16px;
  align-items: center;
  justify-content: start;
  column-gap: 8px;
}

.hist__sel > span {
  color: #222;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.hist__box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
}

.hist__box img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.hist__box img.is-check {
  width: 13px;
  height: 11px;
}

.hist__brand,
.hist__color,
.hist__qty {
  color: #222;
  font-size: 15px;
  font-weight: 700;
}

.hist__part {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 18px 0 16px;
}

.hist__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  border-radius: 10px;
  background: #f3f4f6;
}

.hist__thumb svg {
  display: block;
  width: 44px;
  height: 38px;
}

.hist__code {
  color: #9a9a9a;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.hist__arrow {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 28px;
  height: auto;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hist__empty {
  margin: 0;
  padding: 48px 16px;
  color: #999;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.hist__actions {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 96px;
  padding: 28px 16px 42px;
}

.hist__cancel,
.hist__restore {
  min-width: 112px;
  height: 36px;
  padding: 0 22px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 800;
}

.hist__cancel {
  background: #006db8;
  color: #fff;
}

.hist__restore {
  background: #fbce01;
  color: #1a1a1a;
}

.hist__restore:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .hist {
    padding-top: 96px;
  }
}
