.container {
  padding: 12px;
  background: linear-gradient(180deg, rgba(241, 248, 255, 1) 0%, rgba(246, 250, 255, 1) 100%);
  min-height: 100%;

  .overview {
    background: rgba(255, 255, 255, 0.75);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(226, 232, 240, 0.7);
    margin-bottom: 12px;

    .overviewHeader {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 12px;

      .overviewTitle {
        display: flex;
        align-items: center;
        gap: 10px;

        .overviewIcon {
          width: 44px;
          height: 44px;
          border-radius: 12px;
          display: flex;
          align-items: center;
          justify-content: center;
          background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(99, 102, 241, 0.10));
          color: #2f66ff;
          font-size: 20px;
        }

        .overviewText {
          .overviewMainTitle {
            font-size: 16px;
            font-weight: 700;
            color: #0f172a;
            line-height: 20px;
          }

          .overviewSubTitle {
            font-size: 12px;
            color: rgba(15, 23, 42, 0.55);
            line-height: 16px;
            margin-top: 2px;
          }
        }
      }

      .overviewTime {
        font-size: 12px;
        color: rgba(15, 23, 42, 0.55);
      }
    }

    .overviewCards {
      margin-top: 2px;
    }

    .metricCard {
      border-radius: 14px;
      padding: 12px;
      background: rgba(255, 255, 255, 0.85);
      border: 1px solid rgba(226, 232, 240, 0.7);
      box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
      transition: transform 150ms ease, box-shadow 150ms ease;
      height: 78px;

      &:hover {
        transform: translateY(-1px);
        box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
      }

      .metricInner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
      }

      .metricIcon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        flex: 0 0 auto;
      }

      .metricContent {
        flex: 1 1 auto;
        min-width: 0;

        .metricValue {
          font-size: 22px;
          font-weight: 800;
          letter-spacing: 0.3px;
          color: #0f172a;
          line-height: 26px;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;

          .metricSuffix {
            margin-left: 2px;
            font-size: 12px;
            font-weight: 700;
            color: rgba(15, 23, 42, 0.55);
          }
        }

        .metricLabel {
          margin-top: 4px;
          font-size: 12px;
          color: rgba(15, 23, 42, 0.6);
        }
      }
    }

    .metricCard_primary {
      .metricIcon {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(37, 99, 235, 0.10));
        color: #2563eb;
      }
    }

    .metricCard_success {
      background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(255, 255, 255, 0.85));

      .metricIcon {
        background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.08));
        color: #16a34a;
      }
    }

    .metricCard_warning {
      background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(255, 255, 255, 0.85));

      .metricIcon {
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.08));
        color: #d97706;
      }
    }
  }

  .panelCard {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.7);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);

    :global(.ant-card-head) {
      border-bottom: 1px solid rgba(226, 232, 240, 0.6);
      background: rgba(255, 255, 255, 0.75);
      backdrop-filter: blur(8px);
    }

    :global(.ant-card-body) {
      background: rgba(255, 255, 255, 0.9);
    }

    .panelTitle {
      font-weight: 700;
      color: #0f172a;
    }

    .iconBtn {
      color: rgba(15, 23, 42, 0.55);
    }
  }

  .middle {
    .realtimeSummary {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      margin-bottom: 10px;

      .summaryItem {
        border-radius: 12px;
        padding: 12px;
        border: 1px solid rgba(226, 232, 240, 0.7);
        background: rgba(248, 250, 252, 0.8);

        .summaryValue {
          font-size: 22px;
          font-weight: 800;
          color: #0f172a;
          line-height: 26px;

          .summaryUnit {
            margin-left: 2px;
            font-size: 12px;
            color: rgba(15, 23, 42, 0.55);
            font-weight: 700;
          }
        }

        .summaryLabel {
          margin-top: 4px;
          font-size: 12px;
          color: rgba(15, 23, 42, 0.6);
        }
      }

      .summaryItem_primary {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.10), rgba(248, 250, 252, 0.85));
      }

      .summaryItem_danger {
        background: linear-gradient(135deg, rgba(239, 68, 68, 0.10), rgba(248, 250, 252, 0.85));

        .summaryValue {
          color: #ef4444;
        }
      }
    }

    .deviceListWrap {
      max-height: 420px;
      overflow: auto;
      padding-right: 4px;

      &::-webkit-scrollbar {
        width: 6px;
      }
      &::-webkit-scrollbar-thumb {
        background: rgba(148, 163, 184, 0.5);
        border-radius: 8px;
      }
      &::-webkit-scrollbar-track {
        background: transparent;
      }
    }

    .deviceList {
      :global(.ant-list-item) {
        padding: 10px 0;
        border-bottom: 1px dashed rgba(226, 232, 240, 0.9);
      }
    }

    .deviceItem {
      .deviceRow {
        width: 100%;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
      }

      .deviceMain {
        flex: 1 1 auto;
        min-width: 0;
      }

      .deviceTitle {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 4px;

        .deviceName {
          font-weight: 700;
          color: #0f172a;
        }

        .deviceId {
          border-radius: 999px;
          margin: 0;
        }
      }

      .deviceMeta {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
        color: rgba(15, 23, 42, 0.72);
        font-size: 12px;
      }

      .deviceStatus {
        flex: 0 0 auto;
        margin-top: 2px;
      }
    }

    .anomalyBody {
      display: grid;
      grid-template-columns: 150px 1fr;
      gap: 12px;
      min-height: 360px;

      .anomalyTabs {
        display: flex;
        flex-direction: column;
        gap: 10px;
      }

      .anomalyTab {
        border-radius: 12px;
        padding: 12px 12px;
        border: 1px solid rgba(226, 232, 240, 0.7);
        background: rgba(248, 250, 252, 0.7);
        cursor: pointer;
        transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;

        &:hover {
          transform: translateY(-1px);
          box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
        }

        .anomalyTabTitleRow {
          display: flex;
          align-items: center;
          justify-content: space-between;
          gap: 8px;
        }

        .anomalyTabTitle {
          font-weight: 800;
          color: #0f172a;
        }

        .anomalyTabDesc {
          margin-top: 6px;
          font-size: 12px;
          color: rgba(15, 23, 42, 0.55);
        }

        .anomalyBadge {
          :global(.ant-badge-count) {
            background: #2563eb;
          }
        }
      }

      .anomalyTabActive {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(255, 255, 255, 0.7));
        border-color: rgba(59, 130, 246, 0.25);
      }

      .anomalyContent {
        overflow: hidden;
      }

      .anomalyCards {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        padding-bottom: 6px;

        &::-webkit-scrollbar {
          height: 6px;
        }
        &::-webkit-scrollbar-thumb {
          background: rgba(148, 163, 184, 0.5);
          border-radius: 8px;
        }
        &::-webkit-scrollbar-track {
          background: transparent;
        }
      }

      .anomalyCard {
        min-width: 260px;
        max-width: 300px;
        border-radius: 14px;
        border: 1px solid rgba(226, 232, 240, 0.8);
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
        overflow: hidden;

        .anomalyCardHeader {
          padding: 10px 12px;
          background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(255, 255, 255, 0.5));
          border-bottom: 1px solid rgba(226, 232, 240, 0.7);

          .anomalyCardHeaderLeft {
            display: flex;
            align-items: center;
            gap: 8px;
          }

          .anomalyCardHeaderIcon {
            color: #2563eb;
          }

          .anomalyCardHeaderTitle {
            font-weight: 700;
            color: #0f172a;
            font-size: 12px;
          }
        }

        .anomalyCardBody {
          padding: 10px 12px;

          .anomalyField {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 10px;
            padding: 6px 0;
            border-bottom: 1px dashed rgba(226, 232, 240, 0.8);

            &:last-child {
              border-bottom: none;
            }
          }

          .anomalyLabel {
            color: rgba(15, 23, 42, 0.55);
            font-size: 12px;
            white-space: nowrap;
          }

          .anomalyValue {
            color: rgba(15, 23, 42, 0.82);
            font-size: 12px;
            text-align: right;
            flex: 1 1 auto;
          }
        }

        .anomalyCardFooter {
          padding: 6px 12px 10px;
          display: flex;
          justify-content: center;
        }
      }
    }
  }

  .bottom {
    .donutSection {
      display: grid;
      grid-template-columns: 220px 1fr;
      gap: 12px;
      align-items: center;

      .donut {
        width: 200px;
        height: 200px;
        border-radius: 999px;
        background: var(--donut-bg);
        position: relative;
        margin: 4px 0;
        box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.85);

        &::after {
          content: '';
          position: absolute;
          inset: -10px;
          border-radius: 999px;
          background: radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.22), transparent 55%),
            radial-gradient(circle at 70% 80%, rgba(34, 197, 94, 0.18), transparent 55%);
          filter: blur(10px);
          z-index: 0;
        }

        .donutInner {
          position: absolute;
          inset: 42px;
          background: rgba(255, 255, 255, 0.95);
          border-radius: 999px;
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
          border: 1px solid rgba(226, 232, 240, 0.8);
          z-index: 1;

          .donutCenterTitle {
            font-size: 12px;
            color: rgba(15, 23, 42, 0.55);
          }

          .donutCenterValue {
            margin-top: 2px;
            font-size: 18px;
            font-weight: 800;
            color: #0f172a;
          }
        }
      }

      .donutLegends {
        display: flex;
        flex-direction: column;
        gap: 10px;

        .legendItem {
          display: grid;
          grid-template-columns: 10px 1fr auto;
          gap: 10px;
          align-items: center;
          padding: 10px;
          border-radius: 12px;
          border: 1px solid rgba(226, 232, 240, 0.7);
          background: rgba(248, 250, 252, 0.7);
        }

        .legendDot {
          width: 10px;
          height: 10px;
          border-radius: 999px;
        }

        .legendName {
          color: rgba(15, 23, 42, 0.75);
          font-weight: 700;
        }

        .legendValue {
          color: rgba(15, 23, 42, 0.85);
          font-weight: 800;
        }
      }
    }

    .storageSection {
      display: grid;
      grid-template-columns: 1fr 220px;
      gap: 12px;
      align-items: center;

      .storageLegend {
        display: flex;
        flex-direction: column;
        gap: 10px;

        .storageLegendItem {
          display: grid;
          grid-template-columns: 10px 1fr auto;
          gap: 10px;
          align-items: center;
          padding: 10px;
          border-radius: 12px;
          border: 1px solid rgba(226, 232, 240, 0.7);
          background: rgba(248, 250, 252, 0.7);
        }
      }

      .storageRings {
        position: relative;
        width: 220px;
        height: 220px;
        display: flex;
        align-items: center;
        justify-content: center;

        .storageRingLayer {
          position: absolute;
          inset: 0;
          display: flex;
          align-items: center;
          justify-content: center;

          :global(.ant-progress-text) {
            font-weight: 900;
            color: rgba(15, 23, 42, 0.75);
          }
        }

        .storageRingLayer_mid {
          transform: translateY(0);
        }

        .storageRingLayer_inner {
          transform: translateY(0);
        }
      }
    }
  }

  @media (max-width: 992px) {
    .middle {
      .anomalyBody {
        grid-template-columns: 1fr;
      }
    }

    .bottom {
      .donutSection {
        grid-template-columns: 1fr;
        justify-items: center;
      }

      .storageSection {
        grid-template-columns: 1fr;
        justify-items: center;
      }
    }
  }
}
