/**
 * JXKit 自定义词库模态框样式表 (modal.css)
 * 职责物理隔离：模态弹窗、表单输入、标签云展示与删除交互
 */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.15rem 1.4rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-title-wrap h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.4rem;
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.modal-desc strong {
  color: var(--accent-cf);
}

.form-group label {
  display: block;
  font-size: 0.84rem;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.input-with-btn {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.input-with-btn input {
  flex: 1;
  padding: 0.55rem 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}

.input-with-btn input:focus {
  border-color: var(--accent-cf);
}

.custom-words-display {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.display-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
}

.clear-link-btn {
  background: transparent;
  border: none;
  color: var(--color-danger);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
}

.clear-link-btn:hover {
  text-decoration: underline;
}

.custom-chips-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 48px;
  max-height: 140px;
  overflow-y: auto;
}

.empty-chips-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 48px;
}

.custom-word-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: 6px;
  color: #a78bfa;
  font-size: 0.82rem;
  font-weight: 500;
}

.tag-del-btn {
  background: transparent;
  border: none;
  color: #c4b5fd;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
}

.tag-del-btn:hover {
  color: #ef4444;
}

.modal-footer {
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .modal-backdrop {
    padding: 0.75rem;
  }
  .modal-dialog {
    border-radius: 14px;
    max-height: 92vh;
  }
  .modal-header,
  .modal-footer {
    padding: 0.85rem 1rem;
  }
  .modal-body {
    padding: 1rem;
    overflow-y: auto;
  }
  .input-with-btn input {
    font-size: 16px; /* 防止 iOS Safari 聚焦输入框时强制放大页面 */
  }
}

