/* Ghost-style discussion surface, using the theme's color and font tokens. */
#comments {
  color: var(--color-typography);
  font-family: var(--font-body);
}

#comments *,
#comments *::before,
#comments *::after {
  box-sizing: border-box;
}

#comments [hidden] {
  display: none !important;
}

#comments .siwei-fc-panel {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 16px 24px 28px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-background-tone);
}

#comments .siwei-fc-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

#comments .siwei-fc-heading h2 {
  margin: 0;
  color: var(--color-typography);
  font-family: var(--font-headings);
  font-size: 24px;
  font-weight: 750;
  line-height: 36px;
}

#comments .siwei-fc-count {
  flex: none;
  color: var(--color-typography-tone);
  font-size: 16.5px;
  line-height: 1.5;
  white-space: nowrap;
}

#comments .siwei-fc-submit {
  border: 0;
  border-radius: 5px;
  background: var(--color-brand, #d4563f);
  color: var(--color-brand-contrast, #fff);
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s ease;
}

#comments .siwei-fc-submit:hover {
  opacity: .88;
}

#comments .siwei-fc-reply-context {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--color-typography-tone);
  font-size: 13px;
  line-height: 1.5;
}

#comments .siwei-fc-cancel-reply {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-brand);
  font: inherit;
  cursor: pointer;
}

#comments .siwei-fc-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  color: var(--color-typography-tone);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

#comments .siwei-fc-sort {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-background);
}

#comments .siwei-fc-sort button {
  min-width: 52px;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--color-typography-tone);
  font: inherit;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

#comments .siwei-fc-sort button[aria-pressed="true"] {
  border-color: var(--color-border);
  background: var(--color-background-tone);
  color: var(--color-typography);
}

#comments .siwei-fc-sort button:hover:not([aria-pressed="true"]) {
  background: var(--color-background-tone);
  color: var(--color-brand);
}

#comments .siwei-fc-state,
#comments .siwei-fc-form-status {
  color: var(--color-typography-tone);
  font-size: 13px;
  line-height: 1.5;
}

#comments .siwei-fc-state {
  margin: 0 0 12px;
}

#comments .siwei-fc-form-status {
  margin: 0;
}

#comments .siwei-fc-state.is-error,
#comments .siwei-fc-form-status.is-error {
  color: var(--color-error);
}

#comments .siwei-fc-list,
#comments .siwei-fc-comment__replies {
  margin: 0;
  padding: 0;
  list-style: none;
}

#comments .siwei-fc-comment {
  position: relative;
  min-width: 0;
  padding: 0 0 24px;
  overflow-wrap: anywhere;
}

#comments .siwei-fc-comment + .siwei-fc-comment {
  padding-top: 8px;
}

#comments .siwei-fc-comment__row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
}

#comments .siwei-fc-comment__avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  overflow: hidden;
  border-radius: 50%;
  background: #d7a947;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

#comments .siwei-fc-comment__avatar img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#comments .siwei-fc-comment__content {
  min-width: 0;
}

#comments .siwei-fc-comment__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  margin: 1px 0 5px;
  color: var(--color-typography-tone);
  font-size: 12px;
  line-height: 1.5;
}

#comments .siwei-fc-comment__author {
  color: var(--color-typography);
  font-size: 13px;
  font-weight: 700;
}

#comments .siwei-fc-comment__date::before {
  content: "·";
  margin-right: 6px;
}

#comments .siwei-fc-comment__body {
  color: var(--color-typography);
  font-size: 16.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}

#comments .siwei-fc-comment__actions {
  display: flex;
  align-items: center;
  margin-top: 7px;
}

#comments .siwei-fc-comment__reply {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-typography-tone);
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}

#comments .siwei-fc-comment__reply:hover {
  color: var(--color-brand);
}

#comments .siwei-fc-comment__replies {
  margin: 13px 0 0 24px;
}

#comments .siwei-fc-comment__replies > .siwei-fc-comment {
  padding: 11px 0 12px;
}

#comments .siwei-fc-more {
  display: block;
  margin: 8px auto 0;
  padding: 7px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-background);
  color: var(--color-typography);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
}

#comments .siwei-fc-more:hover {
  background: var(--color-background-tone);
}

#comments .siwei-fc-form {
  display: grid;
  gap: 12px;
  margin: 0 0 24px;
}

#comments .siwei-fc-anonymous-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--color-typography);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}

#comments .siwei-fc-anonymous-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--color-brand);
  cursor: pointer;
}

#comments .siwei-fc-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--color-typography);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

#comments .siwei-fc-field-hint {
  display: block;
  margin-top: 6px;
  color: var(--color-typography-tone);
  font-size: 12px;
  line-height: 1.5;
}

#comments .siwei-fc-field input,
#comments .siwei-fc-field textarea {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  outline: 0;
  background: var(--color-background);
  color: var(--color-typography);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  box-shadow: none;
  appearance: none;
}

#comments .siwei-fc-field textarea {
  min-height: 96px;
  resize: vertical;
}

#comments .siwei-fc-field input::placeholder,
#comments .siwei-fc-field textarea::placeholder {
  color: var(--color-typography-tone);
  opacity: .65;
}

#comments .siwei-fc-submit {
  justify-self: start;
  min-width: 128px;
  min-height: 43px;
  padding: 10px 16px;
  font-size: 15px;
  line-height: 1.4;
}

#comments button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

#comments button:focus-visible,
#comments input:focus-visible,
#comments textarea:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  #comments .siwei-fc-panel {
    padding: 18px 18px 22px;
  }

  #comments .siwei-fc-submit {
    width: 100%;
  }
}
