/* Tabs导航条样式 - 简洁风格 */
:global(.custom-tabs) {
  :global(.ant-tabs-nav) {
    margin-bottom: 0 !important;
    background-color: #EEEFF7;
  }

  /* 移除默认的下划线动画 */
  :global(.ant-tabs-ink-bar) {
    display: none !important;
  }

  /* 未选中状态 - 简洁样式 */
  :global(.ant-tabs-tab) {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    margin-right: 32px !important;
    padding: 12px 0 !important;
    transition: all 0.3s ease !important;
    position: relative !important;
  }

  /* 未选中状态文字 */
  :global(.ant-tabs-tab) :global(.ant-tabs-tab-btn) {
    color: #333 !important;
    font-size: 14px !important;
    font-weight: normal !important;
  }

  /* 选中状态 */
  :global(.ant-tabs-tab-active) {
    background: transparent !important;
  }

  /* 选中状态文字 */
  :global(.ant-tabs-tab-active) :global(.ant-tabs-tab-btn) {
    color: #2E4CD4 !important;
    font-weight: 500 !important;
  }

  /* 选中状态底部蓝色边框 */
  :global(.ant-tabs-tab-active)::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 2px !important;
    background: #2E4CD4 !important;
  }

  /* 底部分隔线 */
  :global(.ant-tabs-nav)::before {
    // border-bottom: 1px solid red !important;
  }

  /* 悬停效果 */
  :global(.ant-tabs-tab):hover :global(.ant-tabs-tab-btn) {
    color: #2E4CD4 !important;
  }
}

.card-container {
  margin: 0;
  background: #fff;
  border-radius: 0;

  :global(.ant-card-body) {
    padding: 15px 24px;
  }
}

/* 主要卡片样式 */
.ant-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

.ant-card-head-title {
  font-weight: 500;
  font-size: 16px;
}

.ant-card-body {
  padding: 20px;
}

/* 功能区域图表样式 */
.chart-container {
  position: relative;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-full-size {
  height: 100%;
  width: 100%;
}

.org-chart {
  position: relative;
  height: 240px;

  .org-top-button {
    text-align: center;
    margin-bottom: 30px;

    .ant-btn {
      border-radius: 20px;
      font-size: 12px;
      height: 36px;
      padding-left: 20px;
      padding-right: 20px;
      background: #5470c6;
      border: none;
      box-shadow: 0 2px 8px rgba(84, 112, 198, 0.3);
    }
  }

  .org-level-1 {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    margin-top: 20px;
    padding-left: 8%;
    padding-right: 8%;

    .org-department {
      text-align: center;
      position: relative;

      .dept-icon {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        margin: 0 auto 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        color: white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);

        &.safety {
          background-color: #52c41a;
          box-shadow: 0 2px 8px rgba(82, 196, 26, 0.3);
        }

        &.production {
          background-color: #1890ff;
          box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);
        }

        &.equipment {
          background-color: #13c2c2;
          box-shadow: 0 2px 8px rgba(19, 194, 194, 0.3);
        }
      }

      .dept-name {
        font-size: 12px;
        color: #374151;
        font-weight: 500;
      }
    }
  }

  .org-level-2 {
    display: flex;
    justify-content: space-between;
    padding-left: 4%;
    padding-right: 4%;

    .dept-group {
      display: flex;
      gap: 16px;

      .sub-department {
        text-align: center;

        .sub-dept-icon {
          width: 36px;
          height: 36px;
          border-radius: 50%;
          margin: 0 auto 6px;
          display: flex;
          align-items: center;
          justify-content: center;
          font-size: 16px;
          color: white;

          &.safety {
            background-color: #52c41a;
          }

          &.production {
            background-color: #1890ff;
          }

          &.equipment {
            background-color: #13c2c2;
          }
        }

        .sub-dept-name {
          font-size: 10px;
          color: #6b7280;
          line-height: 1.2;
        }
      }
    }
  }

  // 连接线样式
  .connect-line {
    position: absolute;

    &.vertical {
      width: 1px;
      border-left: 1px dashed #9ca3af;
    }

    &.horizontal {
      height: 1px;
      border-top: 1px dashed #9ca3af;
    }

    // 主连接线
    &.main-vertical {
      top: 56px;
      left: 50%;
      transform: translateX(-50%);
      height: 20px;
    }

    &.main-horizontal {
      top: 76px;
      left: 20%;
      width: 60%;
    }

    // 第一层连接线
    &.level1-left {
      top: 70px;
      left: 20%;
      height: 12px;
    }

    &.level1-center {
      top: 70px;
      left: 50%;
      height: 12px;
    }

    &.level1-right {
      top: 70px;
      left: 80%;
      height: 12px;
    }
  }
}

/* 风险警告图标 */
.risk-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
  font-size: 32px;
  color: white;
}

/* 提示框样式 */
.risk-tips {
  background-color: #fff2f0;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #ffccc7;

  .tips-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;

    .tips-icon {
      color: #ff4d4f;
      margin-right: 8px;
    }

    .tips-label {
      font-size: 12px;
      font-weight: bold;
    }
  }

  .tips-content {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
  }
}

/* 表格工具栏 */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f0;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .function-block {
    height: auto;
    min-height: 250px;
  }
}

@media (max-width: 768px) {
  .custom-tabs .ant-tabs-tab {
    padding: 6px 12px !important;
    font-size: 12px;
  }

  .org-button {
    padding: 2px;

    .org-icon {
      width: 32px;
      height: 32px;
      font-size: 14px;
    }

    .org-label {
      font-size: 10px;
    }
  }

  .table-toolbar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .function-block {
    padding: 16px;
    height: auto;
  }
}

/* 新增样式类 - 实时风险评估 */
.risk-assessment-container {
  border: 1px solid #FFE8E8;
  border-radius: 4px;
  padding: 20px;
  height: 300px;
  position: relative;
  overflow: hidden;
  background-image: url('~@/assets/basic_information/risk-area-bg.png');
  background-repeat: no-repeat;
  // background-size: cover;
  background-position: center;
}

.risk-background-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: radial-gradient(ellipse at top right, rgba(255, 107, 53, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.risk-background-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: radial-gradient(ellipse at bottom left, rgba(239, 68, 68, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.risk-title {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  position: relative;
  z-index: 2;
}

.risk-title-indicator {
  display: inline-block;
  width: 2px;
  height: 16px;
  background: #FF2526;
  border-radius: 2px;
  margin-right: 8px;
}

.risk-title-text {
  color: #333;
  font-size: 14px;
  font-weight: 500;
}

.risk-content-area {
  display: flex;
  align-items: flex-start;
  height: calc(100% - 60px);
  position: relative;
  z-index: 2;
}

.risk-shield-container {
  // flex: 0 0 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.risk-shield {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 50%, #ffb347 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(255, 107, 53, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.3);
  position: relative;
  transform: perspective(200px) rotateX(5deg) rotateY(-5deg);
}

.risk-shield-icon {
  color: white;
  font-size: 40px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.risk-shield-shadow {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 16px;
  background: linear-gradient(90deg, rgba(255, 107, 53, 0.2) 0%, rgba(255, 107, 53, 0.4) 50%, rgba(255, 107, 53, 0.2) 100%);
  border-radius: 50%;
  filter: blur(2px);
}

.risk-info-container {
  flex: 1;
  // padding-left: 16px;
  margin-top: 50px;
  height: 100%;
}

.risk-level-alert {
  background: #FFD0D0;
  backdrop-filter: blur(4px);
  border-radius: 6px;
  padding: 12px 16px;
  // margin-bottom: 20px;
  // border: 1px solid rgba(255, 196, 209, 0.6);
  // box-shadow: 0 2px 8px rgba(255, 107, 53, 0.1);
}

.risk-level-text {
  color: #333;
  font-size: 14px;
  font-weight: 500;
}

.risk-level-danger {
  color: #FF2626;
  font-weight: 700;
  margin-left: 4px;
}

.risk-tip-container {
  display: flex;
  align-items: flex-start;
  padding: 12px 0;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 8px;
}

.risk-tip-icon {
  width: 20px;
  height: 20px;
  // background: linear-gradient(135deg, #ff6b35, #f7931e);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  margin-top: 2px;
  flex-shrink: 0;
  // box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

.risk-tip-emoji {
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.risk-tip-content {
  flex: 1;
}

.risk-tip-text {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  font-weight: 500;
}

/* 组织架构样式 */
.org-chart-container {
  position: relative;
  height: 240px;
}

.org-top-button-container {
  text-align: center;
  margin-bottom: 30px;
}

.org-top-button {
  border-radius: 20px;
  font-size: 12px;
  height: 36px;
  padding-left: 20px;
  padding-right: 20px;
  background: #2E4CD4;
  border: none;
}

.org-connect-line-vertical {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 20px;
  background: #d1d5db;
  border-left: 1px dashed #9ca3af;
}

.org-connect-line-horizontal {
  position: absolute;
  top: 76px;
  left: 20%;
  width: 60%;
  height: 1px;
  border-top: 1px dashed #9ca3af;
}

.org-connect-line-branch {
  position: absolute;
  top: 70px;
  width: 1px;
  height: 12px;
  border-left: 1px dashed #9ca3af;
}

.org-connect-line-branch-left {
  left: 20%;
}

.org-connect-line-branch-center {
  left: 50%;
}

.org-connect-line-branch-right {
  left: 80%;
}

.org-departments-container {
  display: flex;
  justify-content: space-between;
  margin-bottom: 25px;
  margin-top: 20px;
  padding-left: 8%;
  padding-right: 8%;
}

.org-department {
  text-align: center;
  position: relative;
}

.org-department-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.org-department-icon-safety {
  background-color: #52c41a;
  box-shadow: 0 2px 8px rgba(82, 196, 26, 0.3);
}

.org-department-icon-production {
  background-color: #1890ff;
  box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);
}

.org-department-icon-equipment {
  background-color: #13c2c2;
  box-shadow: 0 2px 8px rgba(19, 194, 194, 0.3);
}

.org-department-label {
  font-size: 12px;
  color: #374151;
  font-weight: 500;
}

.org-department-connect-v {
  position: absolute;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 20px;
  border-left: 1px dashed #9ca3af;
}

.org-department-connect-h {
  position: absolute;
  top: 78px;
  left: 10%;
  width: 80%;
  height: 1px;
  border-top: 1px dashed #9ca3af;
}

.org-department-connect-sub {
  position: absolute;
  top: 72px;
  width: 1px;
  height: 12px;
  border-left: 1px dashed #9ca3af;
}

.org-department-connect-sub-left {
  left: 10%;
}

.org-department-connect-sub-right {
  left: 90%;
}

.button-style {
  border-color: #DFE4F6;
  color: #2E4CD4;
}

/* 表格工具栏样式 */
.table-toolbar-container {
  margin-bottom: 16px;
}

.operateStyle {
  color: #2E4CD4;
}

.search-input {
  width: 300px;
}

.filter-select {
  width: 120px;
}

.func-area-bg {
  background-image: url('~@/assets/basic_information/func-area-bg.png');
  background-repeat: no-repeat;
  // background-size: cover;
  background-position: center;
}

.organ-area-bg {
  background-image: url('~@/assets/basic_information/organ-area-bg.png');
  background-repeat: no-repeat;
  // background-size: cover;
  background-position: center;
}

.warn-area-bg {
  background-image: url('~@/assets/basic_information/warn-area-bg.png');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.stat-card {
  background: #F6F7FF;
  border-radius: 4px;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  min-height: 80px;
}

.stat-card-label {
  color: #666;
  font-size: 14px;
  margin-bottom: 8px;
}

.stat-card-value {
  color: #222;
  font-size: 22px;
  font-weight: 600;
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  // background: rgba(46, 76, 212, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;

  img {
    width: 40px;
    height: 40px;
  }
}

.ryzz-area-bg {
  background-image: url('~@/assets/basic_information/ryzz-area-bg.png');
  background-repeat: no-repeat;
  // background-size: cover;
  background-position: center;
}

.dqtx-area-bg {
  background-image: url('~@/assets/basic_information/dqtx-area-bg.png');
  background-repeat: no-repeat;
  // background-size: cover;
  background-position: center;
}

// 表单组件公共样式
.createForm {
  :global(.ant-modal-content) {
    background: linear-gradient(180deg, #EAEEFF 0%, #FFFFFF 20%, #FFFFFF 100%);
  }

  :global(.ant-modal-header) {
    background-color: transparent;
  }

  :global(.ant-modal-title) {
    text-align: center;
  }

  :global(.ant-modal-footer) {
    text-align: center;
  }

  :global {
    .ant-form {
      margin-right: 24px;
      width: 100%;
      padding: 0 20px;
    }

    .ant-picker,
    .ant-input-number {
      width: 100%;
    }
  }
}

.modal-cancel-btn {
  background: #B6BBD9;
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 88px;
  height: 36px;
  margin-right: 16px;
  font-size: 14px;
  cursor: pointer;
}

.modal-ok-btn {
  background: #2E4CD4;
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 88px;
  height: 36px;
  font-size: 14px;
  cursor: pointer;
}

.view-label {
  color: #666;
  font-size: 14px;
  margin-bottom: 2px;
  margin-right: 20px;
  display: inline-block;
}

.view-value {
  color: #333;
  font-size: 14px;
  font-weight: 500;
  word-break: break-all;
  display: inline-block;
}