.custom-card-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.custom-card-modal.active {
  opacity: 1;
  visibility: visible;
}

.custom-card-modal .modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.custom-card-modal .modal-content {
  position: relative;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 3px solid rgba(255, 215, 0, 0.6);
  border-radius: 20px;
  padding: 30px;
  max-width: 520px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  animation: customCardModalIn 0.4s ease;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
}

@keyframes customCardModalIn {
  from { 
    opacity: 0; 
    transform: scale(0.8) translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: scale(1) translateY(0); 
  }
}

.custom-card-modal .modal-header {
  text-align: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(255, 215, 0, 0.3);
}

.custom-card-modal .modal-title {
  font-family: 'Cinzel', serif;
  font-size: 24px;
  color: #FFD700;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
  margin-bottom: 8px;
}

.custom-card-modal .modal-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

.custom-card-modal .modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  background: rgba(139, 0, 0, 0.6);
  border: 2px solid rgba(255, 215, 0, 0.5);
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.custom-card-modal .modal-close:hover {
  background: rgba(139, 0, 0, 0.9);
  transform: rotate(90deg);
}

.custom-card-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 12px;
  padding: 15px;
}

.form-section-title {
  font-family: 'MedievalSharp', cursive;
  font-size: 14px;
  color: #FFD700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section-title::before {
  content: '❧';
  opacity: 0.7;
}

.type-selector {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.type-option {
  flex: 1;
  min-width: 100px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.type-option:hover {
  background: rgba(255, 215, 0, 0.1);
  border-color: rgba(255, 215, 0, 0.5);
}

.type-option.selected {
  background: rgba(255, 215, 0, 0.2);
  border-color: #FFD700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.type-option .type-icon {
  font-size: 28px;
  margin-bottom: 5px;
}

.type-option .type-name {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
  padding: 5px;
}

.icon-grid::-webkit-scrollbar {
  width: 6px;
}

.icon-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.icon-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.5);
  border-radius: 3px;
}

.icon-option {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 215, 0, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-option:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.5);
  transform: scale(1.1);
}

.icon-option.selected {
  background: rgba(255, 215, 0, 0.25);
  border-color: #FFD700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding: 5px;
}

.avatar-option {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 215, 0, 0.2);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-option:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.5);
  transform: scale(1.15);
}

.avatar-option.selected {
  background: rgba(255, 215, 0, 0.25);
  border-color: #FFD700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.form-input-field {
  width: 100%;
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 10px;
  color: #fff;
  font-size: 16px;
  font-family: 'Spectral', serif;
  transition: all 0.3s ease;
}

.form-input-field:focus {
  outline: none;
  border-color: #FFD700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
  background: rgba(255, 255, 255, 0.12);
}

.form-input-field::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.char-counter {
  text-align: right;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 5px;
}

.select-field {
  width: 100%;
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23FFD700' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
}

.select-field:focus {
  outline: none;
  border-color: #FFD700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.select-field option {
  background: #1a1a2e;
  color: #fff;
}

.intimacy-selector {
  display: flex;
  gap: 15px;
}

.intimacy-option {
  flex: 1;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.intimacy-option:hover {
  background: rgba(255, 215, 0, 0.1);
}

.intimacy-option.selected {
  background: rgba(255, 215, 0, 0.2);
  border-color: #FFD700;
}

.intimacy-option .intimacy-icon {
  font-size: 24px;
  margin-bottom: 5px;
}

.intimacy-option .intimacy-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.intimacy-option[data-value="-50"] .intimacy-icon { color: #dc2626; }
.intimacy-option[data-value="0"] .intimacy-icon { color: #a0a0a0; }
.intimacy-option[data-value="50"] .intimacy-icon { color: #22c55e; }

.modal-actions {
  display: flex;
  gap: 15px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 2px solid rgba(255, 215, 0, 0.2);
}

.btn-action {
  flex: 1;
  padding: 14px 25px;
  border-radius: 12px;
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-cancel {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-create {
  background: linear-gradient(135deg, #FFD700 0%, #B8860B 100%);
  border: none;
  color: #1a1a2e;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.btn-create:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.btn-create:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.step-indicator {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.3);
  transition: all 0.3s ease;
}

.step-dot.active {
  background: #FFD700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.step-dot.completed {
  background: #22c55e;
}

.custom-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 14px;
  filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
  z-index: 10;
}

.card-preview {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.preview-card {
  width: 120px;
  height: 160px;
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
  border: 3px solid #FFD700;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.4);
  position: relative;
}

.preview-card .preview-icon {
  font-size: 42px;
  margin-bottom: 10px;
}

.preview-card .preview-name {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  color: #FFD700;
  text-align: center;
  padding: 0 10px;
}

.preview-card .preview-type {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 5px;
}

@media (max-width: 600px) {
  .custom-card-modal .modal-content {
    padding: 20px;
    max-height: 90vh;
  }

  .icon-grid {
    grid-template-columns: repeat(8, 1fr);
  }

  .avatar-grid {
    grid-template-columns: repeat(8, 1fr);
  }

  .type-option {
    min-width: 80px;
    padding: 10px;
  }

  .type-option .type-icon {
    font-size: 24px;
  }

  .intimacy-selector {
    flex-direction: column;
    gap: 10px;
  }

  .modal-actions {
    flex-direction: column;
  }
}

/* ========== 丢弃卡牌弹窗样式 ========== */

.discard-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.discard-overlay.active {
  opacity: 1;
  visibility: visible;
}

.discard-modal {
  background: linear-gradient(180deg, #2a2a4a 0%, #1a1a2e 100%);
  border: 2px solid rgba(255, 215, 0, 0.5);
  border-radius: 16px;
  padding: 30px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: discardModalIn 0.3s ease-out;
}

@keyframes discardModalIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.discard-header {
  text-align: center;
  margin-bottom: 20px;
}

.discard-header h3 {
  font-family: var(--font-title);
  font-size: 24px;
  color: var(--color-gold);
  margin-bottom: 10px;
}

.discard-header p {
  color: var(--color-text-muted);
  font-size: 14px;
}

.discard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.discard-card {
  background: linear-gradient(180deg, #3a3a5a 0%, #2a2a4a 100%);
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.discard-card:hover {
  border-color: var(--color-gold);
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(255, 215, 0, 0.2);
}

.discard-card.selected {
  border-color: #ff4444;
  background: linear-gradient(180deg, #4a2a2a 0%, #3a1a1a 100%);
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
}

.discard-card .card-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.discard-card .card-name {
  font-family: var(--font-title);
  font-size: 12px;
  color: var(--color-gold);
  word-break: break-word;
}

.discard-card .card-type {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.discard-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.discard-btn {
  padding: 12px 30px;
  border-radius: 8px;
  font-family: var(--font-title);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.discard-btn.cancel {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: var(--color-text);
}

.discard-btn.cancel:hover {
  border-color: rgba(255, 255, 255, 0.5);
}

.discard-btn.confirm {
  background: linear-gradient(180deg, #ff4444 0%, #cc0000 100%);
  border: 2px solid #ff6666;
  color: white;
}

.discard-btn.confirm:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 68, 68, 0.3);
}

.discard-btn.confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 600px) {
  .discard-modal {
    padding: 20px;
    width: 95%;
  }

  .discard-cards {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
  }

  .discard-card {
    padding: 12px;
  }

  .discard-card .card-icon {
    font-size: 28px;
  }

  .discard-actions {
    flex-direction: column;
  }

  .discard-btn {
    width: 100%;
  }
}
