/* ================= 弹窗样式 ================= */
.mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.mask.show { opacity: 1; pointer-events: auto; }

.modal {
  width: 480px;
  max-width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 28px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.05) inset;
  transform: translateY(20px) scale(0.95);
  transition: transform .25s;
}
.mask.show .modal { transform: none; }

.modal-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
}
.modal-title svg {
  stroke: #fff;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}
.modal-hint {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.5);
}

.field { display: block; margin-bottom: 18px; }
.field > span {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.5px;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  outline: none;
  resize: vertical;
  transition: .2s;
}
.field select {
  cursor: pointer;
  resize: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.field input::placeholder,
.field textarea::placeholder { color: rgba(255, 255, 255, 0.35); }
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.modal-footer { display: flex; align-items: center; gap: 12px; margin-top: 24px; }

.btn {
  padding: 12px 20px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: .2s;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--primary-glow);
}
.btn.danger {
  background: transparent;
  color: #fca5a5;
}
.btn.danger:hover { background: rgba(239, 68, 68, 0.15); color: #f87171; }

/* 分组管理 */
.group-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.group-empty {
  margin: 0;
  padding: 24px 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 14px;
}
.group-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}
.color-dot {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 12px currentColor, inset 0 0 0 3px rgba(255, 255, 255, 0.4);
  transition: transform .2s;
}
.color-dot:hover { transform: scale(1.2); }
.group-name-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  outline: none;
}
.group-name-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.group-row .icon-btn { opacity: 1; }

.group-add-row { display: flex; gap: 10px; }
.group-add-row input { flex: 1 1 auto; }

/* 图片预览容器 */
.image-preview-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.image-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.2s;
}

.image-preview-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.image-preview-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.image-preview-item:hover .image-preview-delete {
  opacity: 1;
}

.image-preview-delete:hover {
  background: var(--danger);
  transform: scale(1.1);
}

/* 图片预览弹窗 */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.image-lightbox.show {
  opacity: 1;
  pointer-events: auto;
}

.image-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.image-lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}
