/* 功課頁內嵌收納櫃：不離開教學頁即可對照櫃位 */

.parts-cabinet-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
}

.parts-cabinet-modal.is-open {
  display: flex;
}

.parts-cabinet-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.parts-cabinet-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1180px, 100%);
  height: min(92vh, 920px);
  max-height: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  border: 3px solid rgba(233, 30, 99, 0.35);
}

.parts-cabinet-modal__header {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fce4ec, #e3f2fd);
  border-bottom: 2px solid rgba(0, 0, 0, 0.06);
}

.parts-cabinet-modal__header strong {
  font-size: 1.05rem;
  display: block;
  color: #ad1457;
}

.parts-cabinet-modal__sub {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #546e7a;
  margin-top: 4px;
}

.parts-cabinet-modal__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.parts-cabinet-modal__newtab {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 10px;
  border: 2px solid #1976d2;
  background: #fff;
  color: #1565c0;
  cursor: pointer;
}

.parts-cabinet-modal__newtab:hover {
  background: #e3f2fd;
}

.parts-cabinet-modal__close {
  font-family: inherit;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: none;
  background: #37474f;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  font-weight: 800;
}

.parts-cabinet-modal__close:hover {
  background: #263238;
}

.parts-cabinet-modal__iframe {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #f5f5f5;
}

/* 右下角浮動按鈕 */
.parts-cabinet-fab {
  position: fixed;
  right: 14px;
  bottom: 18px;
  z-index: 99990;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: "Microsoft YaHei", "PingFang TC", sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #e91e63, #ff7043);
  box-shadow: 0 8px 28px rgba(233, 30, 99, 0.45);
  transition: transform 0.2s, box-shadow 0.2s;
}

.parts-cabinet-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(233, 30, 99, 0.5);
}

.parts-cabinet-fab:active {
  transform: translateY(0);
}

.parts-cabinet-fab__icon {
  font-size: 1.2rem;
  line-height: 1;
}

@media (max-width: 480px) {
  .parts-cabinet-fab__text {
    max-width: 5.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

body.parts-cabinet-modal--open {
  overflow: hidden;
}
