* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  // font-family: 'PingFang SC', Arial, 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  margin: 0;
  padding: 0;
}

a {
  text-decoration: none;
}

hr {
  // transform: scaleY(0.25);
  margin: 20px 0;
  border: none;
  height: 1px;
  background-color: var(--vscode-editorIndentGuide-background);
}

.container {
  min-width: 400px;
  max-width: 700px;
  padding: 20px;
  margin: 0 auto;
}

.topic-header {
  display: flex;
  flex-direction: row;
  align-items: center;

  h1 {
    flex: 1;
    font-size: 22px;
  }
  img {
    width: 73px;
    height: 73px;
    margin-left: 20px;
    flex-shrink: 0;
    border-radius: 4px;
  }
}

.topic-meta {
  display: flex;
  align-items: center;
  margin-top: 10px;

  .node {
    flex-shrink: 0;
    border-radius: 4px;
    padding: 5px 10px;
    background-color: var(--vscode-editor-inactiveSelectionBackground);
    color: var(--vscode-editor-foreground);
  }

  .user {
    margin-left: 10px;
  }

  .time {
    margin-left: 10px;
    opacity: 0.5;
  }
}

.topic-content {
  line-height: 1.5;
  word-break: break-all;
  overflow-wrap: break-word;

  p {
    margin: 10px 0;
  }
  a {
    word-break: break-all;

    &:has(img) {
      // 让a标签适应img标签的宽高
      display: inline-block;
      line-height: 0;
      vertical-align: top;
    }
  }
  img {
    max-width: 100% !important;
  }
  pre {
    font-family: inherit;
    white-space: pre;
    word-break: break-all;
  }
  code {
    font-family: inherit;
    white-space: pre-wrap;
    word-break: break-all;
  }
  ul {
    list-style: inside;
  }

  &.append {
    h2 {
      padding-bottom: 10px;
    }
  }
}

.topic-toolbar {
  margin-top: 20px;
  display: flex;
  flex-direction: row;

  .op {
    margin-right: 10px;
  }

  .text {
    opacity: 0.5;
    & + .text {
      padding-left: 10px;
    }
  }

  .count {
    margin-left: auto;
  }
}

.reply {
  h2 {
    padding-bottom: 10px;
  }
}

.reply-item {
  display: flex;
  flex-direction: row;

  .avatar {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    margin-right: 10px;
  }

  &:hover .thankReply {
    visibility: visible !important;
  }
  &:hover .floorReply {
    visibility: visible !important;
  }
}

.reply-item-wrap {
  flex: 1;
  overflow: hidden;

  .meta {
    display: flex;
    flex-direction: row;
    align-items: center;

    .user {
      &--author::after {
        content: '楼主';
        padding: 1px;
        border: 1px solid var(--vscode-textLink-foreground);
        border-radius: 4px;
        margin-left: 5px;
        font-size: 0.8em;
        box-sizing: border-box;
        font-weight: normal;
        display: inline-flex;
        align-items: center;
        justify-content: center;
      }
    }

    .time {
      padding-left: 10px;
      opacity: 0.5;
    }

    .thanks {
      padding-left: 10px;
      flex: 1;
      opacity: 0.5;
    }

    .reply-right {
      margin-left: auto;
      .thankReply {
        visibility: hidden;
      }
      .floorReply {
        margin-left: 6px;
        visibility: hidden;
      }
      .thanked {
        opacity: 0.5;
      }

      .floor {
        margin-left: 10px;
        font-size: 10px;
        min-width: 20px;
        height: 20px;
        line-height: 20px;
        text-align: center;
        font-weight: 500;
        border-radius: 10px;
        display: inline-block;
        // background-color: darkslategray;
        // color: lightgray;
        background-color: var(--vscode-editor-inactiveSelectionBackground);
        padding: 0 5px;
      }
    }
  }

  .content {
    margin-top: 5px;
  }
}

.post-reply {
  textarea {
    display: block;
    width: 100%;
    min-height: 120px;
    resize: vertical;
    overflow-y: scroll;
    overflow-wrap: break-word;
    border-radius: 3px;
    padding: 5px;
    font-family: inherit;
    font-size: 14px;
    border: 1px solid var(--vscode-editorIndentGuide-background);
    box-sizing: border-box;
    background-color: transparent;
    color: var(--vscode-editor-foreground);
  }

  .submit {
    margin-top: 10px;
    border: none;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    outline: none;
    border-radius: 4px;
    padding: 5px 10px;
    background-color: var(--vscode-editor-inactiveSelectionBackground);
    color: var(--vscode-editor-foreground);
    cursor: pointer;
  }
}
