style.css 9.99 KB
/* 数据处理模块 - 全局样式(最简实现:原生 CSS) */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6fa;
  color: #333;
  font-size: 14px;
  min-height: 100vh;
}

/* 全局布局 */
.layout { display: flex; min-height: 100vh; }
.main { flex: 1; padding: 24px; min-width: 0; overflow-x: auto; }
.page-section { width: 100%; }
.page-placeholder { color: #888; }
.placeholder-text { margin-top: 24px; padding: 40px; background: #fff; border-radius: 8px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.06); }

/* 侧边栏 */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #001529;
  color: #fff;
  display: flex; flex-direction: column;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #1f2e3d;
}
.logo-mark {
  width: 36px; height: 36px;
  background: #185fa5; color: #fff;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 600; font-size: 18px;
  flex-shrink: 0;
}
.logo-title { font-size: 15px; font-weight: 500; }
.logo-sub { font-size: 11px; color: #8c9bab; margin-top: 2px; }

.menu { padding: 12px 0; display: flex; flex-direction: column; flex: 1; }
.menu-item {
  display: block;
  padding: 0 20px;
  height: 40px; line-height: 40px;
  color: #c9d1d9;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s;
  font-size: 14px;
  border: none; background: none; text-align: left;
  width: 100%;
}
.menu-item:hover { background: #112a45; color: #fff; }
.menu-item.active {
  background: #185fa5;
  color: #fff;
  font-weight: 500;
}
.menu-item.menu-sub { padding-left: 40px; font-size: 13px; }
.menu-group {
  padding: 12px 20px 4px;
  font-size: 12px;
  color: #6a7a8d;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid #1f2e3d;
}
.current-user-block {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px;
  color: #c9d1d9;
}
.current-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.btn-logout {
  background: transparent; border: 1px solid #2c3e54; color: #c9d1d9;
  padding: 2px 10px; border-radius: 3px; font-size: 12px; cursor: pointer;
}
.btn-logout:hover { border-color: #185fa5; color: #fff; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.page-header h1 { font-size: 22px; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 12px; }
.current-user { color: #555; font-size: 14px; }

/* 按钮 */
.btn {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid #d0d3da;
  border-radius: 4px;
  background: #fff;
  color: #333;
  cursor: pointer;
  font-size: 14px;
  transition: all .15s;
}
.btn:hover { border-color: #185fa5; color: #185fa5; }
.btn-primary { background: #185fa5; border-color: #185fa5; color: #fff; }
.btn-primary:hover { background: #0c447c; color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 2px 10px; font-size: 13px; margin-right: 8px; }
.btn-link {
  border: none; background: none; color: #185fa5; cursor: pointer; padding: 0; font-size: 14px;
}
.btn-link:disabled { color: #aaa; cursor: not-allowed; }
.btn-link.danger { color: #a32d2d; }

/* 筛选栏 */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.filter-item { display: flex; flex-direction: column; gap: 6px; }
.filter-item label { font-size: 13px; color: #666; }
.filter-item select, .filter-item input {
  height: 32px; padding: 0 10px; border: 1px solid #d0d3da;
  border-radius: 4px; min-width: 140px; outline: none;
}
.filter-item input:focus, .filter-item select:focus { border-color: #185fa5; }
.filter-actions { display: flex; gap: 8px; }

/* 表格 */
.table-wrap {
  background: #fff;
  border-radius: 8px;
  padding: 8px 16px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid #eef0f4;
  white-space: nowrap;
}
th { background: #fafbfc; color: #666; font-weight: 500; font-size: 13px; }
tbody tr:hover { background: #f8fafd; }
.empty-tip { text-align: center; color: #999; padding: 40px 0; }

/* 状态 */
.status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
}
.status-PROCESSING { background: #faedda; color: #854f0b; }
.status-COMPLETED { background: #eaf3de; color: #3b6d11; }
.status-FAILED { background: #fcebeb; color: #a32d2d; }

/* 分页 */
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
  color: #666;
}

/* 表单 */
.form-wrap {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  max-width: 720px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.form-item { margin-bottom: 24px; }
.form-item > label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}
.form-item label.required::before { content: '* '; color: #e24b4a; }
.radio-group { display: flex; gap: 24px; flex-wrap: wrap; }
.radio-group label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.radio-group input[type=radio] { accent-color: #185fa5; width: 16px; height: 16px; }
.select { height: 32px; padding: 0 10px; border: 1px solid #d0d3da; border-radius: 4px; min-width: 200px; outline: none; }
.select:focus { border-color: #185fa5; }

/* 上传区 */
.upload-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px dashed #c8cdd6;
  border-radius: 6px;
  margin-bottom: 12px;
  background: #fafbfc;
}
.upload-item .form-type { font-weight: 500; min-width: 110px; }
.upload-item .file-name { color: #666; flex: 1; word-break: break-all; }
.upload-item input[type=file] { max-width: 220px; }
.tip { color: #999; font-size: 12px; margin-top: 4px; }

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  max-width: 720px;
}

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  transition: opacity .3s;
  z-index: 9999;
  pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.error { background: #a32d2d; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  overflow: hidden;
}
.modal-card {
  width: 100%;
  max-width: 640px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 32px);
  overflow: hidden;
}
.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid #eef0f4;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-header h2 { font-size: 16px; font-weight: 500; color: #222; }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 22px; line-height: 1; color: #999;
  padding: 4px 8px; border-radius: 4px;
}
.modal-close:hover { background: #f5f6fa; color: #333; }

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;          /* 关键:让 flex 子项可压缩,触发内部滚动 */
}
.modal-row {
  display: flex; align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.modal-row > label {
  flex: 0 0 130px;
  text-align: right;
  padding-top: 6px;
  font-size: 13px;
  color: #555;
}
.modal-row > label.required::before { content: '*'; color: #e24b4a; margin-right: 4px; }
.modal-control { flex: 1; }
.modal-control select {
  width: 100%; height: 32px; padding: 0 10px;
  border: 1px solid #d0d3da; border-radius: 4px; outline: none;
  background: #fff;
}
.modal-control select:focus { border-color: #185fa5; }

.modal-file {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.modal-file > label {
  flex: 0 0 130px; text-align: right;
  font-size: 13px; color: #555;
  padding-top: 6px;
}
.modal-file > label.required::before { content: '*'; color: #e24b4a; margin-right: 4px; }
.modal-file .file-upload { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.file-upload input[type=file] { display: none; }
.file-upload .file-btn {
  flex-shrink: 0;          /* 防止按钮文字被压成竖排 */
  white-space: nowrap;
  padding: 6px 16px; border: 1px solid #d0d3da; border-radius: 4px;
  background: #fff; cursor: pointer; font-size: 13px;
}
.file-upload .file-btn:hover { border-color: #185fa5; color: #185fa5; }
.file-upload .file-name {
  flex: 1; min-width: 0;
  color: #666; font-size: 13px; word-break: break-all;
}
.modal-file .tip {
  flex: 0 0 280px;
  font-size: 12px; color: #999;
  padding-top: 6px;
}

.modal-footer {
  padding: 12px 24px;
  border-top: 1px solid #eef0f4;
  display: flex; justify-content: flex-end; gap: 12px;
  flex-shrink: 0;          /* 关键:底部按钮始终可见 */
  background: #fff;
}

@media (max-width: 760px) {
  .modal-row, .modal-file { flex-wrap: wrap; }
  .modal-row > label, .modal-file > label { flex: 0 0 100%; text-align: left; padding-top: 0; }
  .modal-file .tip { flex: 1 1 100%; padding-top: 0; }
}

/* 上传 Loading 遮罩 */
.loading-mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
}
.loading-box {
  background: #fff;
  border-radius: 10px;
  padding: 28px 44px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .2);
}
.loading-box p { color: #444; font-size: 14px; }
.spinner {
  width: 34px; height: 34px;
  border: 3px solid #e3e8ef;
  border-top-color: #185fa5;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }