/**
 * WebPosLogin 主组件样式
 */
.webpos-login {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;

  /* 背景模糊遮罩层 */
  &__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    background-size: inherit;
    background-position: inherit;
    filter: blur(20px);
    transform: scale(1.1); /* 放大以避免边缘模糊不完整 */
    z-index: 0;

    /* 添加暗色遮罩增强对比 */
    &::after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.3);
    }
  }

  /* 主内容卡片 */
  &__card {
    position: relative;
    display: flex;
    width: 83%;
    max-width: 1600px;
    min-height: 620px;
    max-height: 700px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    z-index: 1;
    height: 81%;
  }

  /* 右侧交互区 */
  &__right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 400px;
    padding: 32px 40px;
    background: #fafafa;
    border-radius: 0 24px 24px 0;
    height: 100%;
  }

  /* 头部区域 */
  &__header {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 40px;
    margin-bottom: 24px;
  }

  /* 返回按钮 */
  &__back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;

    &:hover {
      background: rgba(0, 0, 0, 0.05);
    }

    &:active {
      background: rgba(0, 0, 0, 0.1);
    }
  }

  /* 步骤标题 */
  &__title {
    flex: 1;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
    padding-right: 56px; /* 平衡返回按钮的宽度，使标题居中 */
  }

  /* 内容区 */
  &__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* 底部用户信息区域 */
  &__footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #eee;

    &:empty {
      display: none;
      padding: 0;
      border: none;
    }
  }

  &--mobile {
    align-items: stretch;
    justify-content: stretch;

    .webpos-login__card {
      width: 100%;
      max-width: none;
      height: 100%;
      min-height: 0;
      max-height: none;
      border-radius: 0;
      box-shadow: none;
    }

    .webpos-login-brand-panel {
      display: none;
    }

    .webpos-login__right-panel {
      min-width: 0;
      width: 100%;
      height: 100%;
      min-height: 0;
      padding: 16px;
      border-radius: 0;
      box-sizing: border-box;
    }

    .webpos-login__header {
      flex-shrink: 0;
      gap: 8px;
      min-height: 36px;
      margin-bottom: 12px;
    }

    .webpos-login__back-btn {
      width: 36px;
      height: 36px;
    }

    .webpos-login__title {
      font-size: 18px;
      line-height: 24px;
      padding-right: 44px;
    }

    .webpos-login__content {
      min-height: 0;
      overflow: hidden;
    }

    .webpos-login__footer {
      flex-shrink: 0;
      padding-top: 12px;
    }

    .login-panel {
      justify-content: flex-start;
      padding: 12px 0;

      > * {
        max-width: 100%;
      }
    }

    .select-store,
    .select-device,
    .select-channel {
      min-height: 0;
    }

    .select-store__search,
    .select-device__search {
      padding-bottom: 8px;

      .ant-input-affix-wrapper,
      .pisell-lowcode-input-affix-wrapper {
        height: 40px;
      }

      .ant-input,
      .pisell-lowcode-input {
        font-size: 14px;
      }
    }

    .select-store__list,
    .select-device__list,
    .select-channel__list {
      min-height: 0;
      padding-right: 0;
    }

    .select-store__loading,
    .select-store__empty,
    .select-device__loading,
    .select-device__empty,
    .select-channel__loading,
    .select-channel__empty {
      height: 160px;
    }

    .select-store__item,
    .select-device__item,
    .select-channel__item {
      gap: 10px;
      padding: 10px;
      margin-bottom: 6px;
      border-radius: 10px;
    }

    .select-store__item-icon,
    .select-device__item-icon,
    .select-channel__item-icon {
      width: 40px;
      height: 40px;
    }

    .select-store__item-name,
    .select-device__item-name,
    .select-channel__item-name {
      font-size: 14px;
    }

    .select-device__item-desc,
    .select-channel__item-desc {
      font-size: 12px;
    }

    .select-store__item-tag,
    .select-device__item-tag,
    .select-channel__item-tag {
      padding: 2px 8px;
      font-size: 11px;
    }

    .user-footer {
      align-items: stretch;
      flex-direction: column;
      gap: 8px;
      padding: 10px 0 0;
    }

    .user-footer__user,
    .user-footer__store {
      width: 100%;
      max-width: none;
      gap: 8px;
    }

    .user-footer__avatar {
      width: 36px;
      height: 36px;
    }

    .user-footer__name {
      font-size: 13px;
    }

    .user-footer__action {
      font-size: 12px;
    }
  }
}

.webpos-login__iot-device {
  width: 100%;
  height: 100%;
  background: #fff;
}

/* 响应式适配 */
@media screen and (max-width: 1024px) {
  .webpos-login {
    &__card {
      width: 83%;
      min-height: 550px;
    }

    &__right-panel {
      padding: 24px 28px;
    }

    &__title {
      font-size: 18px;
      padding-right: 48px;
    }
  }
}

/* 小屏幕适配 */
@media screen and (max-width: 768px) {
  .webpos-login {
    &__card {
      flex-direction: column;
      width: 95%;
      min-height: auto;
    }

    &__right-panel {
      min-width: auto;
      border-radius: 0 0 24px 24px;
    }
  }
}

