.hgsl-side-rail {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 1rem;
  min-width: 0;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.hgsl-side-rail > .sidebar {
  position: static;
  top: auto;
  max-height: none;
  overflow: visible;
}

.hgsl-comment-sidebar {
  min-width: 0;
  padding: 1.15rem 1.2rem 1.25rem;
  border: 1px solid var(--rule);
  border-top: 3px solid #567b95;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 .28rem 1.2rem rgba(0, 0, 0, .045);
}

.sentence.has-comments {
  padding-bottom: .08em;
  border-bottom: 1px dashed rgba(86, 123, 149, .78);
  cursor: pointer;
}

.sentence.has-comments:hover {
  background: rgba(86, 123, 149, .075);
}

.sentence.is-comment-selected {
  background: rgba(86, 123, 149, .11);
}

.byline-author.has-comments {
  border-bottom: 1px dashed rgba(86, 123, 149, .78);
}

.byline-author.is-comment-selected {
  background: rgba(86, 123, 149, .11);
}

.paragraph-pair p[lang="zh-CN"] .sentence {
  cursor: pointer;
}

.paragraph-pair p[lang="zh-CN"] .sentence:hover {
  background: rgba(86, 123, 149, .075);
}

.section-heading .sentence {
  cursor: pointer;
}

.hgsl-comments-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.hgsl-comments-heading h2 {
  margin: 0;
  color: #555;
  font: 700 .74rem/1.2 Arial, Helvetica, sans-serif;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.hgsl-comment-count {
  color: #777;
  font: 600 .7rem/1.2 Arial, Helvetica, sans-serif;
}

.hgsl-comment-target {
  margin: .55rem 0 0;
  color: #222;
  font: 700 .78rem/1.35 Arial, Helvetica, sans-serif;
}

.hgsl-comment-quote {
  max-height: 7rem;
  margin: .5rem 0 0;
  padding: .1rem 0 .1rem .72rem;
  overflow: auto;
  border-left: 2px solid #b8c5ce;
  color: #505050;
  font: italic .87rem/1.5 Georgia, "Times New Roman", serif;
}

.hgsl-sentence-engagement {
  display: flex;
  justify-content: flex-start;
  margin-top: .55rem;
}

.hgsl-like-button,
.hgsl-comment-like {
  display: inline-flex;
  min-height: 1.7rem;
  align-items: center;
  gap: .28rem;
  padding: .18rem .2rem;
  border: 0;
  color: #555;
  background: transparent;
  font: 700 .67rem/1.2 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.hgsl-like-button:hover,
.hgsl-like-button:focus-visible,
.hgsl-comment-like:hover,
.hgsl-comment-like:focus-visible,
.hgsl-like-button.is-liked,
.hgsl-comment-like.is-liked {
  color: #9f201b;
  outline: none;
}

.hgsl-like-button:focus-visible,
.hgsl-comment-like:focus-visible,
.hgsl-comment-privacy:focus-visible {
  border-radius: 2px;
  box-shadow: 0 0 0 2px rgba(86, 123, 149, .25);
}

.hgsl-action-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.hgsl-heart-icon {
  width: 1.06rem;
  height: 1.06rem;
}

.hgsl-like-button.is-liked .hgsl-heart-icon,
.hgsl-comment-like.is-liked .hgsl-heart-icon {
  fill: currentColor;
}

.hgsl-like-count {
  min-width: .7em;
  color: inherit;
  font-variant-numeric: tabular-nums;
}

.hgsl-like-button:disabled,
.hgsl-comment-like:disabled {
  cursor: wait;
  opacity: 1;
}

.hgsl-comment-list {
  display: grid;
  gap: 0;
  margin-top: .9rem;
  border-top: 1px solid #ddd;
}

.hgsl-comment-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: .9rem;
}

.hgsl-comment-actions[hidden],
.hgsl-comment-form[hidden] {
  display: none;
}

.hgsl-comment-compose {
  min-height: 2.1rem;
  padding: .45rem .82rem;
  border: 1px solid #121212;
  border-radius: 2px;
  color: #fff;
  background: #121212;
  font: 700 .7rem/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.hgsl-comment-compose:hover,
.hgsl-comment-compose:focus-visible {
  background: #333;
  outline: 2px solid rgba(18, 18, 18, .2);
  outline-offset: 2px;
}

.hgsl-comment-item {
  min-width: 0;
  padding: .82rem 0 .88rem;
  border-bottom: 1px solid #e2e2e2;
  transition: opacity .16s ease, background-color .16s ease;
}

.hgsl-comment-item.is-private,
.hgsl-comment-replies.is-private-thread .hgsl-comment-item {
  background: rgba(0, 0, 0, .018);
  opacity: .58;
}

.hgsl-comment-replies {
  margin-left: 1rem;
  padding-left: .78rem;
  border-left: 1px solid #cbd4da;
}

.hgsl-comment-replies[hidden] {
  display: none;
}

.hgsl-comment-replies .hgsl-comment-item:last-child {
  border-bottom-color: #d7d7d7;
}

.hgsl-comment-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .7rem;
  color: #666;
  font: .68rem/1.35 Arial, Helvetica, sans-serif;
}

.hgsl-comment-author {
  overflow: hidden;
  color: #222;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hgsl-comment-author-line {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: .42rem;
}

.hgsl-comment-footer {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .45rem .8rem;
  margin-top: .5rem;
}

.hgsl-comment-footer-left,
.hgsl-comment-footer-right {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .58rem;
}

.hgsl-comment-footer-right {
  margin-left: auto;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.hgsl-comment-time {
  flex: 0 0 auto;
}

.hgsl-comment-reply,
.hgsl-comment-like,
.hgsl-comment-privacy,
.hgsl-comment-delete {
  padding: 0;
  border: 0;
  color: #555;
  background: transparent;
  font: 700 .67rem/1.2 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.hgsl-comment-privacy {
  display: inline-flex;
  min-width: 1.7rem;
  min-height: 1.7rem;
  align-items: center;
  justify-content: center;
}

.hgsl-comment-privacy.is-private {
  color: #8f8f8f;
}

.hgsl-comment-reply:hover,
.hgsl-comment-reply:focus-visible,
.hgsl-comment-privacy:hover,
.hgsl-comment-privacy:focus-visible,
.hgsl-comment-delete:hover,
.hgsl-comment-delete:focus-visible {
  color: #111;
  text-decoration: underline;
  text-underline-offset: .18em;
  outline: none;
}

.hgsl-comment-privacy:disabled {
  cursor: wait;
  opacity: 1;
}

.hgsl-comment-delete:hover,
.hgsl-comment-delete:focus-visible {
  color: #8b1f19;
}

.hgsl-comment-delete:disabled {
  cursor: wait;
  opacity: .58;
}

.hgsl-comment-thread-toggle {
  margin: 0;
  padding: .18rem 0;
  border: 0;
  color: #47677c;
  background: transparent;
  font: 700 .68rem/1.25 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.hgsl-comment-thread-toggle:hover,
.hgsl-comment-thread-toggle:focus-visible {
  color: #111;
  text-decoration: underline;
  text-underline-offset: .18em;
  outline: none;
}

.hgsl-comment-body {
  margin: .4rem 0 0;
  color: #202020;
  font: .92rem/1.54 Georgia, "Times New Roman", serif;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.hgsl-comment-mention {
  color: #3f6178;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .82rem;
  font-weight: 700;
}

.hgsl-comment-status {
  margin: .82rem 0 0;
  color: #777;
  font: .78rem/1.45 Arial, Helvetica, sans-serif;
}

.hgsl-comment-form {
  display: grid;
  gap: .55rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #bdbdbd;
}

.hgsl-comment-form-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  color: #333;
  font: 700 .72rem/1.35 Arial, Helvetica, sans-serif;
}

.hgsl-comment-cancel {
  padding: 0;
  border: 0;
  color: #666;
  background: transparent;
  font: 600 .68rem/1.2 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.hgsl-comment-cancel:hover,
.hgsl-comment-cancel:focus-visible {
  color: #111;
  text-decoration: underline;
  text-underline-offset: .18em;
  outline: none;
}

.hgsl-comment-form textarea {
  width: 100%;
  min-height: 6.5rem;
  max-height: 18rem;
  padding: .65rem .7rem;
  resize: vertical;
  border: 1px solid #888;
  border-radius: 2px;
  color: #121212;
  background: #fff;
  font: .92rem/1.48 Georgia, "Times New Roman", serif;
}

.hgsl-comment-form textarea:focus {
  border-color: #121212;
  outline: 1px solid #121212;
}

.hgsl-comment-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.hgsl-comment-character-count {
  color: #777;
  font: .68rem/1.3 Arial, Helvetica, sans-serif;
}

.hgsl-comment-post {
  min-width: 4.6rem;
  min-height: 2.15rem;
  padding: .45rem .8rem;
  border: 1px solid #121212;
  border-radius: 2px;
  color: #fff;
  background: #121212;
  font: 700 .72rem/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.hgsl-comment-post:hover,
.hgsl-comment-post:focus-visible {
  background: #333;
  outline: 2px solid rgba(18, 18, 18, .2);
  outline-offset: 2px;
}

.hgsl-comment-post:disabled {
  cursor: wait;
  opacity: .6;
}

.hgsl-comment-error {
  margin: 0;
  color: #8b1f19;
  font: .75rem/1.42 Arial, Helvetica, sans-serif;
}

.hgsl-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 820px) {
  .hgsl-side-rail {
    position: sticky;
    z-index: 5;
    top: auto;
    bottom: .6rem;
    max-height: 48vh;
  }

  .hgsl-comment-replies {
    margin-left: .55rem;
    padding-left: .62rem;
  }
}
