/* NEXOREIGN 快捷编组栏：克制暗钢圆角 + 单行横滑胶囊条，释放下方舰船列表空间 */
.ucraft-preset-bar {
  flex: 0 0 auto;
  margin: 4px 0 6px;
  padding: 7px 9px 7px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(20, 30, 38, 0.88), rgba(10, 16, 22, 0.94));
  border: 1px solid rgba(154, 198, 210, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 14px rgba(0, 0, 0, 0.28);
  box-sizing: border-box;
  overflow: hidden;
  max-width: 100%;
}

.ucraft-preset-bar.is-empty {
  padding-bottom: 6px;
}

.ucraft-preset-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.ucraft-preset-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1 1 auto;
}

.ucraft-preset-title > span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #dcebf0;
  white-space: nowrap;
}

.ucraft-preset-count {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #9ab5bf;
  white-space: nowrap;
}

.ucraft-preset-tools {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  min-width: 0;
}

.ucraft-preset-tools button {
  height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(154, 194, 206, 0.22);
  background: linear-gradient(180deg, rgba(36, 52, 62, 0.92), rgba(20, 31, 39, 0.95));
  color: #d7ebf0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: filter 120ms ease, transform 120ms ease, border-color 120ms ease;
}

.ucraft-preset-tools button:active {
  transform: scale(0.97);
  filter: brightness(0.92);
}

.ucraft-preset-tools button.is-smart {
  border-color: rgba(94, 206, 184, 0.34);
  background: linear-gradient(180deg, rgba(20, 62, 58, 0.9), rgba(12, 40, 38, 0.95));
  color: #bff3e6;
}

.ucraft-preset-tools button.is-save {
  border-color: rgba(220, 182, 108, 0.42);
  background: linear-gradient(180deg, rgba(76, 58, 26, 0.9), rgba(48, 36, 15, 0.95));
  color: #f6dca2;
}

.ucraft-preset-tools button.is-manage {
  border-color: rgba(154, 186, 198, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: #b4cbd3;
}

/* 单行可横滑胶囊条：无论 1 套还是 5 套，永远只占 1 行高度 */
.ucraft-preset-strip {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  padding-bottom: 1px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  scrollbar-width: none;
}

.ucraft-preset-strip::-webkit-scrollbar {
  display: none;
}

.ucraft-preset-strip.is-dragging,
.ucraft-preset-strip.is-dragging .ucraft-preset-pill {
  cursor: grabbing;
}

@media (hover: hover) and (pointer: fine) {
  .ucraft-preset-strip {
    padding-bottom: 5px;
    scrollbar-width: thin;
    scrollbar-color: rgba(114, 210, 224, 0.34) transparent;
  }

  .ucraft-preset-strip::-webkit-scrollbar {
    display: block;
    height: 4px;
  }

  .ucraft-preset-strip::-webkit-scrollbar-track {
    background: transparent;
  }

  .ucraft-preset-strip::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(114, 210, 224, 0.32);
  }

  .ucraft-preset-strip::-webkit-scrollbar-thumb:hover {
    background: rgba(114, 210, 224, 0.56);
  }
}

.ucraft-preset-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px 0 8px;
  border-radius: 10px;
  border: 1px solid rgba(146, 192, 206, 0.22);
  background: linear-gradient(180deg, rgba(30, 44, 54, 0.92), rgba(16, 26, 34, 0.96));
  color: #edf7fa;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: border-color 140ms ease, background 140ms ease, transform 120ms ease;
}

.ucraft-preset-pill:hover {
  border-color: rgba(114, 224, 236, 0.5);
  background: linear-gradient(180deg, rgba(34, 54, 66, 0.96), rgba(18, 32, 42, 0.98));
}

.ucraft-preset-pill:active {
  transform: scale(0.97);
}

.ucraft-preset-pill em {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(88, 196, 214, 0.14);
  color: #8ee2ef;
  white-space: nowrap;
}

.ucraft-preset-pill strong {
  font-size: 12px;
  font-weight: 700;
  color: #f2fafc;
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ucraft-preset-pill small {
  font-size: 11px;
  color: #93b3be;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ucraft-preset-empty {
  margin: 5px 0 0;
  font-size: 11px;
  color: rgba(168, 196, 206, 0.68);
  line-height: 1.35;
}

/* 编组库管理弹窗：圆角克制暗玻璃质感 */
.ucraft-preset-dialog {
  position: fixed;
  inset: 0;
  width: min(352px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: min(76dvh, 540px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ecf7fa;
  overflow: visible;
}

.ucraft-preset-dialog::backdrop {
  background: rgba(3, 8, 13, 0.72);
  backdrop-filter: blur(4px);
}

.upd-card {
  display: flex;
  flex-direction: column;
  max-height: min(76dvh, 540px);
  border-radius: 16px;
  border: 1px solid rgba(146, 198, 214, 0.24);
  background: linear-gradient(180deg, rgba(20, 31, 40, 0.98), rgba(10, 17, 24, 0.98));
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.68), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.upd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.upd-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #f2fbfe;
}

.upd-head small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #88a9b4;
}

.upd-close {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #cce3ea;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  outline: none;
}

.upd-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(146, 192, 206, 0.16);
  background: rgba(255, 255, 255, 0.035);
}

.upd-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.upd-tag {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 7px;
  background: rgba(88, 196, 214, 0.15);
  color: #8ee2ef;
  font-size: 10px;
  font-weight: 700;
}

.upd-text {
  min-width: 0;
}

.upd-text strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #f0f9fb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upd-text small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #89a8b3;
  font-variant-numeric: tabular-nums;
}

.upd-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.upd-apply,
.upd-del {
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}

.upd-apply {
  border: 1px solid rgba(94, 208, 224, 0.36);
  background: linear-gradient(180deg, rgba(24, 72, 84, 0.92), rgba(14, 48, 58, 0.96));
  color: #dcfaff;
}

.upd-del {
  border: 1px solid rgba(214, 102, 112, 0.28);
  background: rgba(132, 38, 48, 0.28);
  color: #ebb0b6;
}

.upd-empty {
  margin: 18px 0;
  text-align: center;
  font-size: 12px;
  color: #82a0ab;
}

.upd-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.upd-save-btn,
.upd-done-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}

.upd-save-btn {
  border: 1px solid rgba(220, 182, 108, 0.42);
  background: linear-gradient(180deg, rgba(78, 60, 26, 0.92), rgba(50, 38, 16, 0.96));
  color: #f6dca2;
}

.upd-done-btn {
  border: 1px solid rgba(148, 186, 198, 0.24);
  background: rgba(255, 255, 255, 0.07);
  color: #d6eaef;
}

@media (max-width: 360px) {
  .ucraft-preset-bar {
    padding: 6px 7px;
  }
  .ucraft-preset-tools {
    gap: 4px;
  }
  .ucraft-preset-tools button {
    padding: 0 7px;
    font-size: 10.5px;
  }
}
