/* 变量定义 */
$primary-color: #3880ff; // 主色调
$secondary-color: #f4f4f4; // 辅助色调
$accent-color: #ff4081; // 强调色
$font-family: 'Helvetica Neue', Arial, sans-serif;
$border-radius: 8px; // 圆角半径
$box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); // 阴影样式

/* 主样式 */
ion-header {
  background-color: $primary-color;
  color: white;

  ion-toolbar {
    display: flex;
    justify-content: center;
    align-items: center;

    ion-title {
      font-size: 24px;
      font-weight: bold;
    }
  }
}

ion-content {
  padding: 16px;
  background-color: $secondary-color;

  /* 自定义段落样式 */
  .custom-segment {
    display: flex;
    justify-content: space-around;
    margin-bottom: 16px;

    .nav-button {
      flex: 1;
      text-align: center;
      padding: 10px;
      font-size: 16px;
      color: $primary-color;
      transition: background-color 0.3s;

      &.activated {
        background-color: $primary-color;
        color: white;
      }

      &:hover {
        background-color: lighten($primary-color, 30%);
      }
    }
  }

  /* 输入框和显示区域 */
  .info-section {
    background-color: white;
    border-radius: $border-radius;
    padding: 16px;
    box-shadow: $box-shadow;
    margin-bottom: 16px;

    .input-row {
      display: flex;
      justify-content: center;
      margin-bottom: 16px;

      .input-group {
        width: 60%;
        max-width: 300px;
        display: flex;
        flex-direction: column;
        align-items: center;

        label {
          font-weight: bold;
          margin-bottom: 4px;
          text-align: center;
        }

        .input-box {
          width: 100%;
          padding: 8px;
          border: 1px solid #ccc;
          border-radius: 4px;
          transition: border-color 0.3s;

          &:focus {
            border-color: $primary-color; // 聚焦时边框颜色
          }
        }

        .unit {
          font-size: 14px;
          margin-top: 4px;
        }
      }
    }
  }

  /* BMI输出框 */
  .textarea-section {
    background-color: white;
    border-radius: $border-radius;
    padding: 16px;
    box-shadow: $box-shadow;
    margin-bottom: 16px;

    .textarea-input {
      width: 100%;
      height: 120px;
      border: 1px solid #ccc;
      border-radius: 4px;
      padding: 8px;
      resize: none;
      transition: border-color 0.3s;

      &:focus {
        border-color: $primary-color; // 聚焦时边框颜色
      }
    }
  }

  /* 按钮 */
  .analysis-button {
    width: 100%;
    margin-top: 16px;
    background-color: $primary-color;
    color: white;
    padding: 12px;
    border-radius: 4px;
    font-size: 16px;
    transition: background-color 0.3s;

    &.generating {
      background-color: $accent-color;
    }

    &:hover {
      background-color: darken($primary-color, 10%);
    }
  }

  /* 内容框 */
  .bigbox1 {
    background-color: white;
    border-radius: $border-radius;
    padding: 16px;
    box-shadow: $box-shadow;
    margin-top: 16px;

    .content-style {
      font-size: 16px;
      line-height: 1.5;
    }
  }

  /* 居中按钮容器 */
  .center-button {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    height: 100%;
    text-align: center;
    padding-top: 40px;

    ion-button {
      font-size: 18px;
      padding: 14px 24px;
      border-radius: $border-radius;
      transition: background-color 0.3s;

      &:hover {
        background-color: lighten($primary-color, 20%);
      }
    }
  }
}

/* 媒体查询，增强响应性 */
@media (max-width: 768px) {
  .info-section .input-group {
    width: 80%; /* 在小屏幕上增加输入框宽度 */
  }

  .custom-segment {
    flex-direction: column; /* 垂直排列 */
    align-items: center;

    .nav-button {
      margin-bottom: 8px; /* 按钮之间的间距 */
      width: 100%; /* 按钮宽度100% */
    }
  }
}