/* 弹窗的基础样式 */ .popup { display: none; position: fixed; top: 20%; left: 30%; width: 500px; /* 设置宽度适当的弹窗 */ background: #fff; border: 1px solid #ccc; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); padding: 20px; z-index: 1000; cursor: move; overflow: hidden; } .popup h2 { margin: 0 0 10px; text-align: center; cursor: move; } .popup form { display: flex; flex-direction: column; gap: 15px; } .popup form .form-item { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 5px; /* 调整每个表单项之间的垂直间距 */ } .popup form label { flex: 0 0 30%; /* 标签占据容器的 30% 宽度 */ font-size: 14px; text-align: right; margin-right: 10px; /* 标签和输入框之间的间距 */ white-space: nowrap; /* 防止标签文本换行 */ overflow: hidden; text-overflow: ellipsis; /* 标签文本过长时显示省略号 */ } .popup form select, .popup form input[type="file"] { flex: 1; /* 下拉框占据剩余的空间 */ padding: 8px; font-size: 14px; width: 100%; /* 使下拉框自适应填充容器 */ } .popup form input { flex: 1; /* 让输入框自适应宽度 */ padding: 8px; font-size: 13px; width: 100%; } .popup form button { padding: 10px; font-size: 14px; background-color: #007bff; color: #fff; border: none; cursor: pointer; } .popup form button:hover { background-color: #0056b3; } .close-btn { background: none; border: none; font-size: 24px; /* 字体大小 */ color: #555; cursor: pointer; position: absolute; top: 10px; right: 10px; padding: 0; /* 不需要额外的内边距 */ border-radius: 50%; /* 圆形背景 */ width: 35px; /* 圆形的宽度 */ height: 35px; /* 圆形的高度 */ text-align: center; /* 水平居中 */ line-height: 35px; /* 垂直居中 */ background-color: #f0f0f0; /* 背景颜色 */ transition: background-color 0.3s ease; /* 背景色过渡效果 */ } .close-btn:hover { background-color: #ddd; /* 悬停时的背景色 */ } /* 解决文本偏下的情况 */ .close-btn span { display: inline-block; vertical-align: middle; /* 垂直居中 */ } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } /* 按钮容器样式 */ .form-buttons { display: flex; justify-content: space-between; /*margin-top: 20px;*/ } .form-buttons button { width: 48%; } /* 动态内容容器样式 */ #form-container { /*margin-top: 10px;*/ } .form-item.dynamic { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; } .form-item.dynamic input { flex: 1; } /* 请求结果展示区域 */ .result-container { margin-top: 20px; padding: 10px; border: 1px solid #ccc; background-color: #f9f9f9; font-size: 14px; display: none; /* 初始隐藏 */ max-height: 200px; /* 限制最大高度 */ overflow-y: auto; /* 超出部分垂直滚动 */ overflow-x: auto; /*启用横向滚动条,当内容超出容器的宽度时,会出现水平滚动条 */ } /* 加载动画样式 */ .loading-icon { display: none; margin-top: 20px; text-align: center; } .loading-icon::after { content: ""; display: block; width: 30px; height: 30px; margin: 0 auto; border: 4px solid #f3f3f3; border-top: 4px solid #007bff; border-radius: 50%; animation: spin 1s linear infinite; } .select2-container { font-size: 14px; } .select2-container--default .select2-selection--multiple { border: 1px solid #ccc; border-radius: 4px; padding: 5px; overflow: auto; } .select2-container--default .select2-selection--multiple .select2-selection__rendered { line-height: 20px; }