:root {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  color: #172033;
  background: #f4f7fb;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}
button,
input,
select,
textarea {
  font: inherit;
}
.hidden {
  display: none !important;
}
.logo {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #2582ec, #0c57bd);
  box-shadow: 0 8px 20px #0d5fc233;
  color: #fff;
  font-weight: 800;
}
.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 80% 10%, #cfe6ff, transparent 32%),
    radial-gradient(circle at 10% 90%, #e3eeff, transparent 28%),
    linear-gradient(145deg, #edf5ff, #f8fafc);
}
.login-card {
  width: min(430px, 100%);
  padding: 40px;
  border: 1px solid #e1e9f2;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 28px 90px #173b6b1c;
}
.login-kicker {
  margin-top: 25px;
  color: #1a6dcc;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.login-card h1 {
  margin: 8px 0 4px;
  font-size: 28px;
}
.login-card > p {
  margin: 0 0 25px;
  color: #7b8797;
}
.login-card > small {
  display: block;
  margin-top: 15px;
  color: #9aa6b5;
  text-align: center;
}
.form-field {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}
.form-field span {
  font-size: 13px;
  font-weight: 650;
}
.form-field input,
.form-field select,
.form-field textarea,
.control {
  width: 100%;
  min-height: 43px;
  border: 1px solid #dbe3ed;
  border-radius: 11px;
  background: #fff;
  padding: 9px 12px;
  outline: 0;
}
.form-field textarea {
  min-height: 88px;
  resize: vertical;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.control:focus {
  border-color: #4288e7;
  box-shadow: 0 0 0 3px #4288e715;
}
/* 登录密码「显示 / 隐藏」切换 */
.pwd-wrap {
  position: relative;
}
.pwd-wrap input {
  padding-right: 64px;
}
.pwd-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: #eef3fa;
  color: #4288e7;
  font-size: 12px;
  font-weight: 650;
  padding: 0 10px;
  cursor: pointer;
}
.pwd-toggle:hover {
  background: #e0eaf8;
}
/* 首页指标卡：可点击跳转 */
.cards button.card.metric {
  font: inherit;
  color: inherit;
}
.cards button.card.metric:hover {
  border-color: #4288e7 !important;
  box-shadow: 0 6px 18px #4288e71f;
  transform: translateY(-1px);
}
.cards button.card.metric {
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.form-error {
  min-height: 20px;
  margin-top: 10px;
  color: #bc3f3f;
}
.btn {
  display: inline-flex;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  padding: 0 15px;
  background: #fff;
  color: #233044;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary {
  background: #1267d6;
  color: #fff;
  font-weight: 650;
}
.btn.outline {
  border: 1px solid #dce5ef;
}
.btn.ghost {
  background: #edf4fc;
  color: #1765bd;
}
.btn.danger {
  background: #fff0f0;
  color: #b93434;
}
.btn.success {
  background: #e9f8f0;
  color: #13704b;
}
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.login-submit {
  width: 100%;
  height: 46px;
}
.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 248px 1fr;
}
.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 100vh;
  overflow: auto;
  padding: 23px 15px 28px;
  background: #082540;
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 22px;
}
.brand b {
  display: block;
  font-size: 15px;
}
.brand small {
  display: block;
  margin-top: 3px;
  color: #7896af;
  font-size: 9px;
  letter-spacing: 0.14em;
}
.nav {
  display: grid;
  gap: 4px;
}
.nav-group {
  overflow: hidden;
  border-radius: 10px;
}
.nav-main,
.nav-sub button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #a9bfd1;
  text-align: left;
  cursor: pointer;
}
.nav-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  border-radius: 10px;
}
.nav-main span {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-main i {
  width: 18px;
  color: #6f95b2;
  font-style: normal;
  text-align: center;
}
.nav-main:hover,
.nav-group.open > .nav-main,
.nav-group.leaf .nav-main.active {
  background: #ffffff12;
  color: #fff;
}
.nav-arrow {
  font-size: 19px;
  font-weight: 400;
  transition: transform 0.22s;
}
.nav-group.open .nav-arrow {
  transform: rotate(90deg);
  color: #7fc0ff;
}
.nav-sub {
  display: grid;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 0.25s,
    opacity 0.2s,
    padding 0.2s;
}
.nav-group.open .nav-sub {
  max-height: 640px;
  padding: 5px 0 7px;
  opacity: 1;
  overflow-y: auto;
}
.nav-sub button {
  position: relative;
  padding: 8px 12px 8px 43px;
  border-radius: 8px;
  font-size: 13px;
}
.nav-sub button:before {
  position: absolute;
  top: 50%;
  left: 28px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #547895;
  content: '';
}
.nav-sub button:hover,
.nav-sub button.active {
  background: #ffffff0d;
  color: #fff;
}
.nav-sub button.active:before {
  background: #6eb9ff;
  box-shadow: 0 0 0 4px #6eb9ff20;
}
.sidebar-foot {
  position: absolute;
  right: 20px;
  bottom: 22px;
  left: 20px;
  padding-top: 14px;
  border-top: 1px solid #ffffff18;
  color: #89a5ba;
  font-size: 11px;
}
.online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #4dde9b;
  box-shadow: 0 0 0 4px #4dde9b18;
}
.main {
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid #e4eaf1;
  background: #fff;
}
.top-left,
.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.breadcrumb {
  color: #8793a2;
  font-size: 11px;
}
.topbar h1 {
  margin: 2px 0 0;
  font-size: 18px;
}
.icon-button {
  display: none;
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}
.avatar-button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: #4c5a6c;
  cursor: pointer;
}
.avatar-button span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: #e9f3ff;
  color: #1465c2;
  font-weight: 700;
}
.content {
  padding: 28px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.page-head h2 {
  margin: 0;
  font-size: 22px;
}
.page-head p {
  margin: 5px 0 0;
  color: #778497;
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.cards {
  display: grid;
  /* 自适应列数：卡片尽量并排一排（如费用统计 5 张卡、待办中心 5 张卡），窄屏自动减少列数 */
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 16px;
}
.card {
  border: 1px solid #e3eaf2;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 25px #1c416a08;
}
.metric {
  position: relative;
  overflow: hidden;
  padding: 22px;
}
.metric:after {
  position: absolute;
  right: -15px;
  bottom: -25px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #eaf4ff;
  content: '';
}
.metric-label {
  color: #758397;
}
.metric-value {
  display: block;
  margin-top: 7px;
  font-size: 29px;
}
.metric small {
  display: block;
  margin-top: 4px;
  color: #9aa6b5;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
}
.panel {
  margin-top: 18px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 17px 20px;
  border-bottom: 1px solid #edf1f5;
}
.panel-head h3 {
  margin: 0;
  font-size: 16px;
}
.panel-head p {
  margin: 3px 0 0;
  color: #8995a4;
  font-size: 12px;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 15px 20px;
  background: #fbfcfe;
}
.toolbar .control {
  width: auto;
  min-width: 160px;
}
.toolbar input.control {
  flex: 1;
  max-width: 320px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 13px 17px;
  border-top: 1px solid #edf1f5;
  text-align: left;
  white-space: nowrap;
}
th {
  background: #f8fafc;
  color: #657489;
  font-size: 12px;
  font-weight: 650;
}
td {
  color: #445166;
}
td strong {
  color: #172033;
}
.tag {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 99px;
  font-size: 12px;
}
.tag.amber {
  background: #fff3d8;
  color: #966000;
}
.tag.blue {
  background: #e8f2ff;
  color: #1765bd;
}
.tag.purple {
  background: #f0eaff;
  color: #7143bf;
}
.tag.green {
  background: #e7f7ef;
  color: #14754d;
}
.tag.red {
  background: #ffe9e9;
  color: #a72c2c;
}
.tag.gray {
  background: #eef1f5;
  color: #637080;
}
.tag.cyan {
  background: #e6f7fa;
  color: #197080;
}
.row-actions {
  display: flex;
  gap: 7px;
}
.row-actions .btn {
  height: 31px;
  padding: 0 10px;
  font-size: 12px;
}
.empty {
  padding: 60px 20px;
  text-align: center;
  color: #8591a0;
}
.empty b {
  display: block;
  margin-bottom: 5px;
  color: #526075;
}
.stack {
  display: grid;
  gap: 14px;
}
.notice {
  padding: 14px 16px;
  border: 1px solid #dceafb;
  border-radius: 12px;
  background: #f0f7ff;
  color: #41607f;
}
.summary-list {
  padding: 7px 20px;
}
.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid #edf1f5;
}
.summary-row:last-child {
  border: 0;
}
.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #edf1f5;
}
.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1d73db, #5ba7ff);
}
.category-grid,
.device-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}
.entity-card {
  padding: 20px;
}
.entity-card h3 {
  margin: 0;
}
.entity-card p {
  margin: 8px 0;
  color: #718096;
}
.entity-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 14px 0;
}
.entity-card .row-actions {
  margin-top: 16px;
}
.device-visual {
  display: flex;
  height: 100px;
  align-items: center;
  justify-content: center;
  margin: -20px -20px 17px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(145deg, #eaf4ff, #f7fafd);
  font-size: 42px;
}
.device-visual.has-image {
  height: 150px;
  overflow: hidden;
  background: #eef3f9;
}
.device-visual.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.device-price {
  font-weight: 650;
}
.device-image-editor {
  display: flex;
  height: 230px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f6f9fc;
}
.device-image-editor img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.device-image-presets {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.device-image-preset {
  overflow: hidden;
  height: 58px;
  padding: 0;
  border: 1px solid #dbe3ed;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.device-image-preset img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.device-image-preset:hover {
  border-color: #4288e7;
}
.device-image-inline {
  display: flex;
  height: 120px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: 8px;
  border: 1px dashed #dbe3ed;
  border-radius: 12px;
  background: #f8fbfe;
}
.device-image-inline img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.engineer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.engineer-chip {
  padding: 4px 8px;
  border-radius: 99px;
  background: #eef5fd;
  color: #2868a9;
  font-size: 12px;
}
.timeline {
  position: relative;
  margin: 20px 0;
  padding-left: 25px;
}
.timeline:before {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 7px;
  width: 1px;
  background: #dce4ed;
  content: '';
}
.timeline-item {
  position: relative;
  margin: 0 0 20px;
}
.timeline-item:before {
  position: absolute;
  top: 5px;
  left: -22px;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #2780e5;
  box-shadow: 0 0 0 2px #cfe5ff;
  content: '';
}
.timeline-item b {
  display: block;
}
.timeline-item p {
  margin: 3px 0;
  color: #7b8797;
}
.chart {
  display: flex;
  height: 230px;
  align-items: flex-end;
  gap: 16px;
  padding: 25px 20px 10px;
}
.bar-wrap {
  display: grid;
  height: 100%;
  flex: 1;
  grid-template-rows: 1fr auto;
  gap: 8px;
  text-align: center;
}
.bar-area {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.bar {
  position: relative;
  width: min(48px, 75%);
  min-height: 3px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, #4599f2, #1766c8);
}
.bar b {
  position: absolute;
  top: -24px;
  left: 50%;
  color: #275784;
  font-size: 11px;
  transform: translateX(-50%);
}
.bar-wrap small {
  overflow: hidden;
  color: #748295;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: #07182e88;
  backdrop-filter: blur(3px);
}
.modal-card {
  position: relative;
  width: min(740px, 100%);
  max-height: 90vh;
  overflow: auto;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 100px #06182f55;
}
.modal-close {
  position: absolute;
  top: 15px;
  right: 17px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f1f4f7;
  color: #5d6b7d;
  font-size: 22px;
  cursor: pointer;
}
.modal-title {
  padding: 25px 28px;
  border-bottom: 1px solid #edf1f5;
}
.modal-title h2 {
  margin: 0;
}
.modal-title p {
  margin: 5px 0 0;
  color: #778497;
}
.modal-content {
  padding: 25px 28px;
}
.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}
.modal-grid .wide {
  grid-column: 1/-1;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.detail-box {
  padding: 17px;
  border-radius: 13px;
  background: #f7f9fc;
}
.detail-box b {
  display: block;
  margin-bottom: 9px;
}
.detail-box p {
  margin: 5px 0;
  color: #647286;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 18px 28px;
  border-top: 1px solid #edf1f5;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  transform: translateY(20px);
  border-radius: 12px;
  background: #102b45;
  color: #fff;
  padding: 13px 18px;
  box-shadow: 0 15px 35px #09274444;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
}
.toast.show {
  transform: none;
  opacity: 1;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.filter-grid .control {
  width: 100%;
}
.section-note {
  margin: 12px 0;
  color: #8390a0;
  font-size: 12px;
}
.export-card {
  padding: 28px;
}
.export-card h3 {
  margin-top: 0;
}
.sheet-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 20px 0;
}
.sheet-list span {
  padding: 10px;
  border-radius: 9px;
  background: #f5f8fb;
  color: #526176;
}
.rank {
  display: flex;
  align-items: center;
  gap: 12px;
}
.rank-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  background: #edf4fc;
  color: #1765bd;
  font-weight: 700;
}
@media (max-width: 1100px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .category-grid,
  .device-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 820px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    left: -260px;
    width: 248px;
    transition: left 0.22s;
  }
  .sidebar.open {
    left: 0;
  }
  .icon-button {
    display: block;
  }
  .topbar {
    padding: 0 16px;
  }
  .top-actions .outline {
    display: none;
  }
  .content {
    padding: 18px;
  }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .category-grid,
  .device-grid {
    grid-template-columns: 1fr;
  }
  .modal-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .modal-grid .wide {
    grid-column: auto;
  }
}
@media (max-width: 560px) {
  .cards {
    grid-template-columns: 1fr;
  }
  .filter-grid,
  .sheet-list {
    grid-template-columns: 1fr;
  }
  .toolbar .control {
    width: 100%;
    max-width: none;
  }
  .avatar-button {
    font-size: 0;
  }
  .topbar {
    height: 68px;
  }
  .content {
    padding: 14px;
  }
  .modal {
    padding: 10px;
  }
  .modal-content,
  .modal-title {
    padding-right: 20px;
    padding-left: 20px;
  }
}

/* Visual approval-flow designer */
.modal.flow-mode {
  display: block;
  padding: 0;
  background: #f5f7fa;
  backdrop-filter: none;
}
.modal.flow-mode .modal-card {
  width: 100%;
  height: 100vh;
  max-height: none;
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
}
.modal.flow-mode .modal-close {
  display: none;
}
.flow-designer {
  display: flex;
  height: 100vh;
  min-height: 640px;
  flex-direction: column;
  background: #f4f6f9;
  color: #172033;
}
.flow-editor-bar {
  position: relative;
  z-index: 8;
  display: grid;
  min-height: 68px;
  flex: 0 0 68px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid #e0e5eb;
  background: #fff;
  box-shadow: 0 2px 8px #1d35570a;
}
.flow-editor-bar > strong {
  font-size: 15px;
}
.flow-editor-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.flow-editor-brand > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 7px;
  background: #08a6ed;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}
.flow-editor-brand input {
  width: min(280px, 28vw);
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 7px 9px;
  background: transparent;
  color: #111827;
  font-size: 16px;
  outline: 0;
}
.flow-editor-brand input:hover,
.flow-editor-brand input:focus {
  border-color: #cbd9ea;
  background: #f8fbff;
}
.flow-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.flow-workspace {
  display: flex;
  min-height: 0;
  flex: 1;
}
.flow-canvas {
  position: relative;
  min-width: 0;
  flex: 1;
  overflow: auto;
  background-color: #f5f7fa;
  background-image: radial-gradient(#dce3eb 0.8px, transparent 0.8px);
  background-size: 22px 22px;
}
.flow-template-button {
  position: sticky;
  top: 14px;
  left: 16px;
  z-index: 6;
  height: 46px;
  border: 1px solid #e1e7ee;
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  box-shadow: 0 3px 12px #23364d16;
  cursor: pointer;
}
.flow-zoom {
  position: sticky;
  top: 14px;
  right: 16px;
  z-index: 6;
  display: flex;
  float: right;
  align-items: center;
  gap: 5px;
  padding: 3px;
  border: 1px solid #e1e6ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 12px #23364d12;
}
.flow-zoom button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: #f4f6f8;
  color: #6b7280;
  font-size: 20px;
  cursor: pointer;
}
.flow-zoom span {
  min-width: 48px;
  color: #657184;
  text-align: center;
}
.flow-stage {
  position: relative;
  display: flex;
  width: max-content;
  min-width: 100%;
  min-height: calc(100vh - 68px);
  align-items: center;
  flex-direction: column;
  padding: 58px 54px 100px;
  transform-origin: top center;
  transition: transform 0.16s ease;
}
.flow-node-card,
.flow-condition-card {
  position: relative;
  display: flex;
  width: 230px;
  min-height: 78px;
  align-items: stretch;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  border-top: 4px solid #4daaf0;
  border-radius: 4px;
  padding: 29px 30px 12px 13px;
  background: #fff;
  box-shadow: 0 3px 11px #30445c16;
  color: #172033;
  text-align: left;
  cursor: pointer;
}
.flow-node-card.selected,
.flow-condition-card.selected {
  border-color: #2f84e6;
  box-shadow:
    0 0 0 3px #2f84e61c,
    0 8px 20px #30445c20;
}
.flow-node-type {
  position: absolute;
  inset: 0 0 auto;
  height: 25px;
  padding: 4px 12px;
  background: #e8f4ff;
  color: #2582df;
  font-size: 12px;
  font-style: normal;
}
.flow-node-card b,
.flow-condition-card b {
  font-size: 13px;
  font-weight: 650;
}
.flow-node-card small,
.flow-condition-card small {
  margin-top: 4px;
  color: #4b5a6f;
  font-size: 12px;
}
.flow-node-card > i,
.flow-condition-card > i {
  position: absolute;
  top: 50%;
  right: 12px;
  color: #bdc6d1;
  font-size: 22px;
  font-style: normal;
  transform: translateY(-20%);
}
.flow-node-card > em {
  align-self: flex-start;
  margin-top: 7px;
  border-radius: 10px;
  padding: 2px 7px;
  background: #fff1de;
  color: #c26b00;
  font-size: 10px;
  font-style: normal;
}
.flow-node-card.approver {
  border-top-color: #ff9f19;
}
.flow-node-card.approver .flow-node-type {
  background: #fff7e9;
  color: #ee8500;
}
.flow-node-card.handler {
  margin-top: 0;
  border-top-color: #3ea8ed;
}
.flow-condition-card {
  min-height: 94px;
  border-top-color: #8795a7;
  padding-top: 34px;
}
.flow-condition-card > span,
.flow-condition-card > em {
  position: absolute;
  inset: 0 auto auto 0;
  height: 27px;
  padding: 5px 11px;
  background: #eef3f8;
  color: #617083;
  font-size: 12px;
  font-style: normal;
}
.flow-condition-card > em {
  right: 0;
  left: auto;
  color: #8793a2;
}
.flow-connector {
  width: 1px;
  height: 40px;
  background: #cdd5de;
}
.flow-connector.tall {
  height: 35px;
}
.flow-connector.branch-tail {
  height: 32px;
}
.flow-add {
  z-index: 2;
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #9eb8cf;
  color: #fff;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.flow-add:hover {
  background: #388fe2;
  transform: scale(1.08);
}
.flow-add-condition {
  z-index: 2;
  margin-top: -4px;
  border: 1px solid #e2e8ef;
  border-radius: 5px;
  padding: 6px 11px;
  background: #fff;
  color: #3b8eea;
  font-size: 12px;
  box-shadow: 0 2px 7px #263d5710;
  cursor: pointer;
}
.flow-branch-grid {
  position: relative;
  display: grid;
  width: max-content;
  min-width: 100%;
  align-items: start;
  justify-content: center;
  gap: 78px;
  margin-top: 22px;
  padding-top: 18px;
}
.flow-branch-grid::before {
  position: absolute;
  top: 0;
  right: 115px;
  left: 115px;
  height: 1px;
  background: #cdd5de;
  content: '';
}
.flow-branch {
  position: relative;
  display: flex;
  min-width: 230px;
  align-items: center;
  flex-direction: column;
}
.flow-branch::before {
  width: 1px;
  height: 18px;
  margin-top: -18px;
  background: #cdd5de;
  content: '';
}
.flow-merge-line {
  width: calc(100% - 230px);
  height: 28px;
  border-bottom: 1px solid #cdd5de;
}
.bottom-add {
  margin-top: 26px;
}
.flow-sidepanel {
  position: relative;
  z-index: 7;
  width: 455px;
  flex: 0 0 455px;
  overflow: auto;
  border-left: 1px solid #dfe5ec;
  background: #fff;
  box-shadow: -6px 0 18px #1c324812;
}
.flow-panel-head,
.flow-panel-tabs {
  display: flex;
  height: 58px;
  align-items: center;
  border-bottom: 1px solid #e2e7ed;
}
.flow-panel-head {
  justify-content: space-between;
  padding: 0 24px;
}
.flow-panel-head h3 {
  margin: 0;
}
.flow-panel-head button {
  border: 0;
  background: transparent;
  color: #8a96a5;
  font-size: 24px;
  cursor: pointer;
}
.flow-panel-tabs button {
  position: relative;
  height: 58px;
  flex: 1;
  border: 0;
  background: #fff;
  color: #202a39;
  cursor: pointer;
}
.flow-panel-tabs button.active {
  color: #1672dc;
}
.flow-panel-tabs button.active::after {
  position: absolute;
  right: 28%;
  bottom: 0;
  left: 28%;
  height: 2px;
  background: #2683ed;
  content: '';
}
.flow-panel-body {
  padding: 22px 24px 36px;
}
.flow-panel-body h4 {
  margin: 0 0 16px;
}
.flow-panel-empty {
  padding: 28px;
}
.flow-panel-empty p {
  color: #7b8796;
}
.flow-choice-title {
  margin: 22px 0 13px;
  font-size: 13px;
  font-weight: 700;
}
.flow-choice-title small {
  margin-left: 4px;
  color: #8b97a7;
  font-weight: 400;
}
.flow-radio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px 9px;
}
.flow-radio-grid label,
.flow-mode-list label,
.flow-permissions label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.flow-radio-grid label {
  min-width: 0;
  font-size: 12px;
}
.flow-radio-grid label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flow-radio-grid label small {
  color: #b2bbc6;
  font-size: 10px;
}
.flow-radio-grid input,
.flow-mode-list input,
.flow-permissions input {
  accent-color: #2c82e6;
}
.flow-divider {
  height: 1px;
  margin: 25px 0;
  background: #e4e8ed;
}
.flow-member-list {
  display: flex;
  min-height: 64px;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 13px;
}
.flow-member {
  position: relative;
  display: flex;
  width: 48px;
  align-items: center;
  flex-direction: column;
  gap: 5px;
}
.flow-member b {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(145deg, #d5ebff, #8fc4f3);
  color: #245f91;
}
.flow-member i {
  position: absolute;
  top: -5px;
  right: 2px;
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border-radius: 50%;
  background: #17202b;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  cursor: pointer;
}
.flow-member small {
  max-width: 54px;
  overflow: hidden;
  color: #344154;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flow-member-add {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #d7dee7;
  border-radius: 5px;
  background: #fff;
  color: #7d8998;
  font-size: 23px;
  cursor: pointer;
}
.flow-mode-list,
.flow-permissions {
  display: grid;
  gap: 15px;
}
.flow-mode-list label,
.flow-permissions label {
  font-size: 13px;
}
.flow-tip {
  margin-top: 20px;
  border-radius: 8px;
  padding: 12px;
  background: #f3f7fb;
  color: #718094;
  font-size: 12px;
}
.flow-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 28px;
}
.flow-delete-node {
  width: 100%;
  margin-top: 28px;
}

@media (max-width: 1100px) {
  .flow-sidepanel {
    width: 390px;
    flex-basis: 390px;
  }
  .flow-radio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .flow-branch-grid {
    gap: 42px;
  }
}
@media (max-width: 760px) {
  .flow-editor-bar {
    grid-template-columns: 1fr auto;
    padding: 0 12px;
  }
  .flow-editor-bar > strong {
    display: none;
  }
  .flow-editor-brand input {
    width: 150px;
  }
  .flow-editor-actions .ghost {
    display: none;
  }
  .flow-sidepanel {
    position: absolute;
    right: 0;
    bottom: 0;
    width: min(92vw, 420px);
    height: calc(100vh - 68px);
  }
}

/* 下单表单设置（模板设计器） */
.fd-layout{display:grid;grid-template-columns:1.4fr 1fr;gap:18px;align-items:start}
@media(max-width:1100px){.fd-layout{grid-template-columns:1fr}}
.fd-controls{display:grid;grid-template-columns:repeat(auto-fill,minmax(86px,1fr));gap:10px}
.fd-ctl{display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 6px;border:1px solid #e3eaf2;border-radius:12px;background:#fff;cursor:pointer;font-size:12px;color:#334155;transition:all .15s}
.fd-ctl:hover{border-color:#0d5fc2;color:#0d5fc2;box-shadow:0 4px 12px rgba(13,95,194,.12)}
.fd-ctl i{font-style:normal;font-size:18px;font-weight:700;color:#0d5fc2}
.fd-preview-head{margin-top:14px;background:#4a6fa5;color:#fff;text-align:center;padding:10px;border-radius:10px 10px 0 0;font-weight:600}
.fd-preview{border:1px solid #e3eaf2;border-top:0;border-radius:0 0 10px 10px;background:#f8fafc;min-height:120px;padding:10px;display:flex;flex-direction:column;gap:8px}
.fd-field{display:flex;justify-content:space-between;align-items:center;gap:10px;background:#fff;border:1px solid #e8eef5;border-radius:10px;padding:10px 12px;cursor:pointer;transition:all .15s}
.fd-field:hover{border-color:#b9d2f2}
.fd-field.active{border-color:#0d5fc2;box-shadow:0 0 0 2px rgba(13,95,194,.15)}
.fd-field-main{display:flex;flex-direction:column;gap:2px}
.fd-field-main b{font-size:13px}
.fd-field-main small{color:#8494a7;font-size:11px}
.fd-star{color:#e11d48;font-style:normal;margin-left:2px}
.fd-field-side{display:flex;align-items:center;gap:8px}
.fd-tag{font-style:normal;font-size:11px;border-radius:999px;padding:2px 8px;background:#eef5ff;color:#0d5fc2}
.fd-tag.off{background:#f1f5f9;color:#94a3b8}
.fd-ops{display:flex;gap:4px}
.fd-ops button{border:1px solid #e3eaf2;background:#fff;border-radius:6px;width:26px;height:24px;font-size:11px;cursor:pointer;color:#475569}
.fd-ops button:hover{border-color:#0d5fc2;color:#0d5fc2}
.fd-ops .fd-del:hover{border-color:#dc2626;color:#dc2626}
.fd-settings{display:flex;flex-direction:column;gap:12px}
.fd-check{display:flex;align-items:center;gap:8px;font-size:13px;color:#334155}
.fd-check small{color:#94a3b8}
.fd-hint{color:#8494a7;font-size:13px;line-height:1.8}
.fd-sep{border-top:1px solid #eef2f7;margin:16px 0}

/* 测试项目管理：表格在当前页面内自带滚动（横向+纵向），无需滑到页面底部 */
.si-scroll {
  max-height: calc(100vh - 250px);
  min-height: 320px;
  overflow: auto;
  overscroll-behavior: contain;
}
.si-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  box-shadow: 0 1px 0 #edf1f5;
}
.si-scroll tbody tr:hover {
  background: #f8fbff;
}

/* 测试项目管理：单元格内容自动换行，表格宽度一屏放下，不需要左右滚动 */
.si-scroll th,
.si-scroll td {
  white-space: normal;
  word-break: break-word;
  vertical-align: top;
  line-height: 1.6;
}
.si-scroll table {
  table-layout: fixed;
  width: 100%;
}
.si-scroll th:nth-child(1), .si-scroll td:nth-child(1) { width: 5%; }
.si-scroll th:nth-child(2), .si-scroll td:nth-child(2) { width: 10%; }
.si-scroll th:nth-child(3), .si-scroll td:nth-child(3) { width: 14%; }
.si-scroll th:nth-child(4), .si-scroll td:nth-child(4) { width: 14%; }
.si-scroll th:nth-child(5), .si-scroll td:nth-child(5) { width: 13%; }
.si-scroll th:nth-child(6), .si-scroll td:nth-child(6) { width: 12%; }
.si-scroll th:nth-child(7), .si-scroll td:nth-child(7) { width: 16%; }
.si-scroll th:nth-child(8), .si-scroll td:nth-child(8) { width: 16%; }
.si-scroll .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* 下单表单设置：模板列表 */
.fd-tpls { display: grid; gap: 8px; }
.fd-tpl { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid #e5e9f0; border-radius: 12px; background: #fff; cursor: pointer; transition: .15s; }
.fd-tpl:hover { border-color: #c7d9f5; }
.fd-tpl.active { border-color: #0d5fc2; background: #f3f8ff; }
.fd-tpl-main b { display: block; font-size: 14px; color: #172033; }
.fd-tpl-main small { color: #8494a7; font-size: 12px; }
.fd-ops button[disabled] { opacity: .35; cursor: not-allowed; }

/* 工程师管理：可办理测试项目 */
.eg-picked { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border: 1px dashed #d8e0ea; border-radius: 12px; background: #fbfdff; min-height: 44px; }
.eg-picked .engineer-chip { display: inline-flex; align-items: center; gap: 6px; }
.eg-picked .engineer-chip i { font-style: normal; cursor: pointer; color: #94a3b8; font-size: 14px; }
.eg-picked .engineer-chip i:hover { color: #d94a4a; }
.eg-groups { max-height: 320px; overflow: auto; border: 1px solid #e5e9f0; border-radius: 12px; padding: 10px 12px; }
.eg-group { margin-bottom: 10px; }
.eg-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; color: #172033; padding: 4px 0; }
.eg-group-head .eg-ops button { border: 0; background: none; color: #0d5fc2; font-size: 12px; cursor: pointer; padding: 2px 6px; }
.eg-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; }
.eg-items label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #445166; cursor: pointer; }

/* 工程师可办理测试项目：复选框不被全局表单样式拉伸，保持与文字同行对齐 */
.eg-items input[type="checkbox"],
.eg-picked input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  min-height: 0 !important;
  border: none !important;
  background: none !important;
  flex: 0 0 16px;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  accent-color: #0d5fc2;
}
.eg-items label {
  align-items: center;
  line-height: 1.5;
  padding: 3px 0;
  white-space: normal;
}
.eg-group-head {
  border-bottom: 1px solid #eef2f7;
  padding-bottom: 4px;
}

/* ===================== 账号体系：登录申请 / 权限指派 ===================== */
.login-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.link-button {
  border: none;
  background: none;
  color: #0d5fc2;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.link-button:hover { text-decoration: underline; }
.login-hint {
  flex: 1 1 200px;
  font-size: 12px;
  color: #8a94a6;
  line-height: 1.5;
}
.nav-hidden { display: none !important; }
.panel-title {
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 10px;
}
.page-note {
  font-size: 13px;
  color: #7b8598;
  line-height: 32px;
}
.wrap-cell {
  white-space: normal;
  word-break: break-word;
  line-height: 1.6;
}
.perm-tip {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #8a94a6;
  line-height: 1.5;
}
.req {
  font-style: normal;
  color: #d94a4a;
}
.field-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.field-inline input { flex: 1; }
.field-tip {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #8a94a6;
  line-height: 1.6;
}
.review-brief {
  border: 1px dashed #d8e0ea;
  border-radius: 12px;
  background: #fbfdff;
  padding: 10px 12px;
  font-size: 13px;
  color: #445166;
  line-height: 1.8;
}
.perm-picker {
  border: 1px solid #e5e9f0;
  border-radius: 12px;
  padding: 10px 12px;
  max-height: 340px;
  overflow: auto;
}
.perm-ops {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef2f7;
  margin-bottom: 8px;
}
.perm-ops .btn { padding: 4px 10px; font-size: 12px; min-height: 30px; }
.perm-ops-tip {
  flex: 1 1 220px;
  font-size: 12px;
  color: #8a94a6;
  line-height: 1.5;
}
.perm-group { padding: 6px 0; }
.perm-group + .perm-group { border-top: 1px solid #f1f4f8; }
.perm-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #1f2937;
  padding: 2px 0 4px;
}
.perm-group-head .btn { padding: 2px 8px; font-size: 12px; min-height: 26px; }
.perm-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 2px 12px;
}
.perm-items label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #445166;
  cursor: pointer;
  padding: 3px 0;
  line-height: 1.5;
}
.perm-items input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  min-height: 0 !important;
  border: none !important;
  background: none !important;
  flex: 0 0 16px;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  accent-color: #0d5fc2;
}

/* ===================== 流程设计器：节点类型扩展（审批人/抄送人/办理人/条件分支） ===================== */
.flow-add-wrap {
  position: relative;
  display: flex;
  justify-content: center;
}
.flow-add-wrap.bottom-add { margin-top: 26px; }
.flow-add-menu {
  position: absolute;
  top: 32px;
  left: 50%;
  z-index: 60;
  display: flex;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid #e5eaf1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px #17325726;
  white-space: nowrap;
  transform: translateX(-50%);
}
.flow-add-menu button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 10px;
  padding: 6px 10px;
  background: none;
  color: #445166;
  font-size: 12px;
  cursor: pointer;
}
.flow-add-menu button:hover { background: #f2f7fd; color: #2582df; }
.flow-add-menu .am {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  font-size: 16px;
  font-style: normal;
}
.flow-add-menu .am.approver { background: #fff3de; color: #ee8500; }
.flow-add-menu .am.cc { background: #e8f4ff; color: #2582df; }
.flow-add-menu .am.handler { background: #e4f8f3; color: #0d9c82; }
.flow-add-menu .am.cond { background: #eef2f7; color: #617083; }
.flow-node-card.cc { border-top-color: #4daaf0; }
.flow-node-card.cc .flow-node-type { background: #e8f4ff; color: #2582df; }
.flow-node-card.handler-node { border-top-color: #19bfa4; }
.flow-node-card.handler-node .flow-node-type { background: #e4f8f3; color: #0d9c82; }
.flow-cond-group {
  position: relative;
  border: 1px dashed #cfdae6;
  border-radius: 12px;
  padding: 8px 8px 12px;
  background: #fbfdff;
  cursor: pointer;
}
.flow-cond-group.selected {
  border-color: #2f84e6;
  box-shadow: 0 0 0 3px #2f84e61c;
}
.flow-cond-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 8px;
  color: #617083;
  font-size: 12px;
}
.flow-cond-group-head em { font-style: normal; color: #98a4b3; }
.flow-branch-grid.nested { gap: 26px; margin-top: 4px; padding-top: 10px; min-width: 0; }
.flow-branch-grid.nested::before { left: 70px; right: 70px; }
.flow-branch-grid.nested .flow-branch { min-width: 200px; }
.flow-subbranch {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid #e5eaf1;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #fbfdff;
}
.flow-subbranch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #1f2937;
}
.flow-subbranch-head .btn { padding: 3px 10px; font-size: 12px; min-height: 28px; }
.flow-subbranch-meta { color: #8a94a6; font-size: 12px; line-height: 1.6; }
.empty-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

/* ===================== 下单表单设置：明细子控件 / 关联控件 ===================== */
.fd-child-title { font-size: 13px; font-weight: 650; color: #1f2937; margin: 4px 0 8px; }
.fd-child-title small { font-weight: 400; color: #8a94a6; margin-left: 6px; }
.fd-child-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e5eaf1;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: #fbfdff;
}
.fd-child-row input:first-child { flex: 1 1 130px; min-height: 34px; }
.fd-child-row select { flex: 0 0 110px; min-height: 34px; }
.fd-child-req { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #64748b; white-space: nowrap; cursor: pointer; }
.fd-child-req input { width: 14px !important; min-height: 0 !important; height: 14px !important; accent-color: #0d5fc2; }
.fd-child-row .fd-del { flex: 0 0 auto; }
.fd-child-add { display: flex; align-items: center; gap: 8px; }
.fd-child-add select { min-height: 34px; }

/* ===================== 派工多选工程师 ===================== */
.engineer-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid #e5eaf1;
  border-radius: 10px;
  padding: 10px;
  background: #fbfdff;
}
.engineer-pick-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid #dde5ef;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
}
.engineer-pick-item:hover { border-color: #0d5fc2; color: #0d5fc2; }
.engineer-pick-item input { width: 14px !important; min-height: 0 !important; height: 14px !important; accent-color: #0d5fc2; margin: 0; }

/* ===================== 模板启用 / 停用 ===================== */
.fd-ops .fd-toggle.on { border-color: #16a34a; color: #16a34a; background: #f0fdf4; }
.fd-ops .fd-toggle.on:hover { border-color: #16a34a; color: #15803d; background: #dcfce7; }
.fd-tpl.off .fd-tpl-main b { color: #94a3b8; }
.fd-tpl.off { opacity: .85; }
.fd-tag.on { background: #e8f7ee; color: #16a34a; }

/* ===================== 审批管理整合页 ===================== */
.aa-tpls { display: flex; flex-wrap: wrap; gap: 8px; }
.fd-tpl-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid #dde5ef; background: #fff; border-radius: 999px;
  padding: 8px 14px; font-size: 13px; color: #334155; cursor: pointer;
}
.fd-tpl-chip:hover { border-color: #0d5fc2; color: #0d5fc2; }
.fd-tpl-chip.active { border-color: #0d5fc2; background: #eef5ff; color: #0d5fc2; font-weight: 650; }
.fd-tpl-chip.off { opacity: .7; }
.aa-tabs { display: flex; gap: 4px; border-bottom: 2px solid #e5eaf1; margin: 0 0 16px; }
.aa-tab {
  border: none; background: none; padding: 10px 18px; font-size: 14px;
  color: #64748b; cursor: pointer; border-radius: 10px 10px 0 0;
}
.aa-tab:hover { color: #0d5fc2; }
.aa-tab.active { color: #0d5fc2; font-weight: 650; background: #eef5ff; }

/* 审批管理：下单审批 / 立项审批 两类审批切换 */
.aa-scopes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin: 0 0 18px; }
.aa-scope {
  display: block; text-align: left; border: 1px solid #e2e8f0; background: #fff;
  border-radius: 14px; padding: 14px 18px; cursor: pointer; transition: all .15s;
}
.aa-scope b { display: block; font-size: 15px; color: #0f172a; }
.aa-scope small { display: block; margin-top: 4px; font-size: 12px; line-height: 18px; color: #8494a7; }
.aa-scope:hover { border-color: #9cc2f5; box-shadow: 0 6px 18px rgba(15, 23, 42, .08); }
.aa-scope.active { border-color: #0d5fc2; background: linear-gradient(135deg, #eff6ff, #ffffff); }
.aa-scope.active b { color: #0d5fc2; }

/* 表格内可直接点击修改的单元格 */
.cell-edit {
  display: inline-flex; align-items: center; gap: 4px;
  border: none; background: none; padding: 0; margin: 0;
  font: inherit; color: #1f2937; text-align: left; cursor: pointer;
  border-bottom: 1px dashed #c7d2e0;
}
.cell-edit:hover { color: #0d5fc2; border-bottom-color: #0d5fc2; }
.cell-edit i { font-style: normal; font-size: 11px; color: #94a3b8; }
.cell-edit:hover i { color: #0d5fc2; }

/* 附件标签 */
.att-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.att-chips .tag.blue button { border: none; background: none; color: inherit; cursor: pointer; margin-left: 2px; font-size: 12px; }

/* 审批模板 chip 上的启用/停用按钮 */
.fd-tpl-chip { user-select: none; }
.fd-chip-op {
  border: 1px solid #d7e0ec; background: #fff; color: #64748b;
  border-radius: 999px; padding: 2px 8px; font-size: 12px; cursor: pointer;
}
.fd-chip-op:hover { border-color: #0d5fc2; color: #0d5fc2; }
.fd-tpl-chip.off .fd-chip-op { border-color: #f0b4b4; color: #d9534f; }
.fd-tpl-chip.off .fd-chip-op:hover { background: #fff1f1; }

/* 立项状态列：行内下拉 */
.status-select { padding: 3px 8px; border: 1px solid #dbe3ee; border-radius: 8px; background: #fff; font-size: 13px; color: #334155; outline: none; cursor: pointer; }
.status-select:hover { border-color: #9db4d0; }
.status-select:focus { border-color: #0d5fc2; }
.status-select.ok { color: #0a7d43; border-color: #b3dfc5; background: #f0faf4; }
.status-select.bad { color: #b4232a; border-color: #efc4c7; background: #fdf3f3; }

/* 点击示意标记：鼠标划过可以点开的位置时变色提示 */
.yh-hover {
  outline: 2px solid rgba(13, 95, 194, 0.45);
  outline-offset: 1px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 999px rgba(13, 95, 194, 0.07);
}

/* 审批成员选择列表（从管理人员中选择） */
.member-pick-list {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.member-pick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
}
.member-pick-item:hover { border-color: #9db4d0; background: #f6f9fd; }
.member-pick-item input { width: 16px; height: 16px; flex: none; }
.member-pick-item b {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: #2e6fdb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.member-pick-item span { display: flex; flex-direction: column; font-size: 14px; color: #1f2a37; }
.member-pick-item small { color: #8494a7; font-size: 12px; }

/* ===== 全屏适配（2026-09-22）：任意浏览器/屏幕下表格不挤压、布局不塌 ===== */
.table-wrap table {
  min-width: 760px;
}
.table-wrap td.wrap-cell,
.table-wrap th.wrap-cell {
  white-space: normal;
  word-break: break-word;
  min-width: 120px;
}
.table-wrap td strong {
  white-space: nowrap;
}
.top-actions {
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 820px) {
  .top-actions .btn {
    padding: 7px 10px;
    font-size: 12px;
  }
  #yhNoticeBell {
    display: inline-flex !important;
    align-items: center;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card.metric {
    min-width: 0;
  }
  .modal-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .table-wrap table {
    min-width: 680px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
}

/* ===== 手机版适配（2026-09-22）：安卓 / iOS / 鸿蒙 等手机浏览器 ===== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body {
  overflow-x: hidden;
}
.table-wrap {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.main,
.content {
  min-height: 0;
}
@media (max-width: 820px) {
  /* 顶部栏 / 内容区贴边安全区（iOS 刘海屏与手势条） */
  .topbar {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-top: env(safe-area-inset-top);
  }
  .content {
    padding: 14px max(12px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }
  .sidebar {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 40;
  }
  /* 触控目标 ≥40px、输入字号 ≥16px（避免 iOS 聚焦自动放大） */
  button,
  .btn,
  select,
  .status-select {
    min-height: 40px;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
  .row-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
  .row-actions .btn {
    padding: 8px 12px;
  }
  th,
  td {
    padding: 10px 12px;
    font-size: 14px;
  }
  .page-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  /* 弹窗改为近全屏面板，内容可滚动 */
  .modal {
    align-items: stretch;
    padding: 0;
  }
  .modal > form,
  .modal > div {
    width: 100%;
    max-width: none;
    max-height: 100dvh;
    border-radius: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-content {
    max-height: none;
  }
  .modal-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}
@media (max-width: 560px) {
  .top-actions .btn {
    padding: 8px 10px;
  }
  .metric-value {
    font-size: 20px;
  }
}

/* 手机版补充：卡片/网格子项不被表格内容撑开（表格由 table-wrap 内部滚动） */
.card,
.card.panel,
.grid-2 > *,
.grid-3 > *,
.cards > * {
  min-width: 0;
}
.grid-2 .table-wrap,
.card.panel .table-wrap {
  max-width: 100%;
}
.summary-list {
  min-width: 0;
}

/* ===== 关联控件（选项联动）设计器样式（2026-09-28 第十八轮） ===== */
.fd-link-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed #e6eaf0; }
.fd-link-row:last-child { border-bottom: 0; }
.fd-link-opt { flex: 0 0 132px; font-size: 13px; font-weight: 600; color: #334155; line-height: 30px; }
.fd-link-boxes { display: flex; flex-wrap: wrap; gap: 6px 8px; min-width: 0; }
.fd-link-item { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #334155; background: #f6f9fd; border: 1px solid #e3eaf3; border-radius: 8px; padding: 5px 10px; cursor: pointer; user-select: none; }
.fd-link-item:has(input:checked) { background: #e8f1fd; border-color: #0d5fc2; }
.fd-link-item input { accent-color: #0d5fc2; margin: 0; }
.fd-link-item small { color: #8494a7; }
@media (max-width: 820px) {
  .fd-link-row { flex-direction: column; gap: 6px; }
  .fd-link-opt { flex-basis: auto; line-height: 1.6; }
}

/* ===== 第二十五轮（2026-09-28）保留项 + 第二十六轮调整：研究院徽标 / 移除底部状态文字 ===== */
/* 徽标改为圆形图片（登录页与侧栏共用 .logo 尺寸）；第二十六轮：侧栏顶部只保留徽标（文字与收起按钮已按用户要求移除） */
.logo.logo-img {
  padding: 0;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

/* ===== 第三十三轮（2026-09-29）：订单详情两列信息格在手机上折为单列（inline 网格样式需 !important 覆盖） ===== */
@media (max-width: 560px) {
  .od-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ===== 第三十八轮（2026-09-29）：手机版一级列表只显示前三项信息 + 操作列；点行/查看进详情 =====
   第 4~N-1 列隐藏（保留最后的操作列保证各页面可用），表格不再强制最小宽度，竖排紧凑 */
@media (max-width: 560px) {
  .table-wrap th:nth-child(n + 4):not(:last-child),
  .table-wrap td:nth-child(n + 4):not(:last-child) {
    display: none;
  }
  .table-wrap table {
    min-width: 0 !important;
    width: 100%;
  }
  .table-wrap th,
  .table-wrap td {
    white-space: normal;
  }
  .table-wrap td[onclick] {
    cursor: pointer;
  }
}


/* ===== 第三十九轮（2026-09-30）：手机版隐藏右下角「☁ 云端数据库 · 已连接」悬浮徽标（遮挡列表内容；桌面保留） ===== */
@media (max-width: 768px) {
  #__yh_cloud_badge {
    display: none !important;
  }
}

/* ===== 第四十四轮（2026-09-30）：手机端显示「开启手机通知」按钮（豁免 820px 下 .top-actions .outline 隐藏规则） ===== */
@media (max-width: 820px) {
  #yhNotifyBtn {
    display: inline-flex !important;
  }
}

/* ===== 第五十三轮（2026-10-10）：手机端显示「💬 微信通知」按钮（豁免 820px 下 .top-actions .outline 隐藏规则，同 r44） ===== */
@media (max-width: 820px) {
  #yhWxPushBtn {
    display: inline-flex !important;
  }
}

/* ===== 第八十八轮（2026-10-24）：长表格滚动时表头固定 =====
   表格容器高度超过一屏（约 减去顶栏与页边距）时启用内部滚动，表头 sticky 固定在容器顶部；
   短表格不受影响。横宽表格的横向滚动保持不变。 */
.table-wrap {
  max-height: calc(100vh - 230px);
}
.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #f8fafc;
  box-shadow: 0 1px 0 #e4eaf1;
}
/* 弹窗内的表格跟随弹窗滚动，不启用内滚吸顶 */
#modal .table-wrap {
  max-height: none;
}
#modal .table-wrap thead th {
  position: static;
  box-shadow: none;
}

/* ===== 第七十二轮（2026-10-19）：手机端「项目立项」可查看详情 =====
   立项表共 13 列，操作列在第 12、「立项审批」（查看/审批入口）在第 10，而第三十八轮通用规则只保留
   前 3 列 + 最后一列（备注），把这两列一起隐藏了——手机上看不到任何详情入口。
   立项表专用豁免：手机显示 项目名称 / 项目编号 / 立项审批 / 操作 四列，隐藏 排序(1) 与 备注(13)；
   项目名称整格可点开「立项关联视图」（代码里 td onclick）。 */
@media (max-width: 560px) {
  .table-wrap.yh-projects-table th:nth-child(1),
  .table-wrap.yh-projects-table td:nth-child(1),
  .table-wrap.yh-projects-table th:nth-child(13),
  .table-wrap.yh-projects-table td:nth-child(13) {
    display: none;
  }
  .table-wrap.yh-projects-table th:nth-child(10),
  .table-wrap.yh-projects-table td:nth-child(10),
  .table-wrap.yh-projects-table th:nth-child(12),
  .table-wrap.yh-projects-table td:nth-child(12) {
    display: table-cell;
  }
  .table-wrap.yh-projects-table td:nth-child(12) .row-actions {
    flex-wrap: wrap;
    gap: 4px;
  }
}
