/* add_tool.css - 响应式添加工具弹窗样式 */

/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
}

/* 弹窗容器 */
.popup_cont {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* 弹窗主体 */
.popup {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideIn 0.3s ease-out;
}

/* 弹窗动画 */
@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 弹窗标题 */
.popup_title {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #eee;
}

/* 弹窗内容 */
.popup_content {
  padding: 24px;
}

/* 表单样式 */
.form-margin-top {
  margin-top: 10px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
  font-size: 14px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background-color: #fff;
}

.form-control:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-control::placeholder {
  color: #999;
}

textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

/* 确保弹窗内容在移动设备上可以完整显示 */
.popup_content {
  min-height: 200px;
}

/* 优化工具增录准则区域的显示 */
.tool_add_rule {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #eee;
  position: relative;
  z-index: 1;
}

/* 帮助文本 */
.help-block {
  margin-top: 6px;
  font-size: 12px;
  color: #999;
}

/* 提交按钮 */
.submit-btn {
  width: 100%;
  padding: 14px;
  background-color: #4a90e2;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-top: 10px;
}

.submit-btn:hover {
  background-color: #357abd;
}

.submit-btn:active {
  transform: translateY(1px);
}

/* 关闭按钮 */
.popup_close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: #f5f5f5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.popup_close:hover {
  background: #e0e0e0;
  color: #333;
}

/* 工具增录准则 */
.tool_add_rule {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #eee;
}

.tool_add_rule h3 {
  font-size: 16px;
  color: #333;
  margin-bottom: 12px;
}

.tool_add_rule p {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 12px;
}

.tool_add_rule ul {
  list-style: none;
}

.tool_add_rule li {
  font-size: 14px;
  color: #666;
  padding-left: 20px;
  position: relative;
  margin-bottom: 8px;
}

.tool_add_rule li:before {
  content: "•";
  color: #4a90e2;
  font-size: 18px;
  position: absolute;
  left: 0;
  top: -2px;
}

.tool_add_rule a {
  color: #4a90e2;
  text-decoration: none;
}

.tool_add_rule a:hover {
  text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .popup {
    width: 95%;
    margin: 20px;
  }
  
  .popup_title {
    font-size: 18px;
    padding: 16px 20px 12px;
  }
  
  .popup_content {
    padding: 20px;
  }
  
  .form-control {
    padding: 10px 14px;
  }
  
  .submit-btn {
    padding: 12px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  body {
    overflow: auto;
  }
  
  .popup_cont {
    padding: 10px;
    align-items: flex-start;
    min-height: 100vh;
    display: block;
  }
  
  .popup {
    margin: 10px 0;
    max-height: calc(100vh - 20px);
    min-height: 80vh;
  }
  
  .popup_close {
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    font-size: 18px;
  }
  
  /* 针对iPhone等触摸设备优化 */
  .popup {
    -webkit-overflow-scrolling: touch;
    overflow-y: scroll;
  }
}

/* 针对iPhone 16等大屏幕手机的额外优化 */
@media (min-width: 390px) and (max-width: 844px) and (max-height: 932px) {
  .popup {
    width: 95%;
    max-height: calc(100vh - 40px);
    min-height: 85vh;
  }
  
  .popup_content {
    padding: 24px;
  }
  
  .form-control {
    padding: 12px 16px;
  }
  
  textarea.form-control {
    min-height: 100px;
  }
}

/* 滚动条样式 */
.popup::-webkit-scrollbar {
  width: 6px;
}

.popup::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.popup::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.popup::-webkit-scrollbar-thumb:hover {
  background: #999;
}