/* Comment section — PC + H5 via media queries */

.comment-section {
  --comment-text: var(--text-primary, #fff);
  --comment-muted: var(--text-secondary, rgba(255, 255, 255, 0.55));
  --comment-surface: var(--surface-input, rgba(255, 255, 255, 0.05));
  --comment-border: var(--color-black-alpha-5, rgba(255, 255, 255, 0.05));
  --comment-accent: var(--color-primary-500, #ecd227);
  --comment-ink: #0d0d0d;
  --comment-time-h5: #757575;
  --comment-toggle-h5: #bdbdbd;
  --comment-font: "PingFang SC", "Noto Sans SC", sans-serif;

  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
  width: 100%;
  box-sizing: border-box;
  font-family: var(--comment-font);
}

.comment-section *,
.comment-section *::before,
.comment-section *::after {
  box-sizing: border-box;
}

.comment-composer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  width: 100%;
}

.comment-section__title {
  margin: 0;
  color: var(--comment-text);
  font-size: 24px;
  font-weight: 400;
  line-height: 32px;
}

.comment-form {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 18px;
  width: 100%;
  padding: 24px 16px;
  border-radius: 12px;
  border: 1px solid var(--comment-border);
  background: var(--comment-surface);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.comment-form__textarea {
  width: 100%;
  min-height: 88px;
  border: none;
  outline: none;
  resize: vertical;
  background: transparent;
  color: var(--comment-text);
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  line-height: 22px;
}

.comment-form__textarea::placeholder {
  color: var(--comment-muted);
  font-weight: 600;
}

.comment-form__submit {
  appearance: none;
  padding: 13px 36px;
  border: 1px solid var(--comment-accent);
  border-radius: 4px;
  background: var(--comment-accent);
  color: #000;
  font-size: 13px;
  font-family: inherit;
  font-weight: 400;
  line-height: 20px;
  cursor: pointer;
  text-align: center;
}

.comment-form__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.comment-reply-form {
  margin-top: 2px;
}

.comment-reply-form[hidden] {
  display: none !important;
}

.comment-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
}

.comment-list__count {
  margin: 0;
  color: var(--comment-muted);
  font-size: 20px;
  font-weight: 400;
  line-height: 28px;
}

.comment-list__threads {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  width: 100%;
}

.comment-thread {
  width: 100%;
}

.comment-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.comment-item__avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
  background: #e0e0e0;
}

.comment-item--reply {
  gap: 10px;
}

.comment-item--reply .comment-item__avatar {
  width: 24px;
  height: 24px;
}

.comment-item__body {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.comment-item--reply .comment-item__body {
  gap: 10px;
}

.comment-item__main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}

.comment-item__name {
  color: var(--comment-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

.comment-item__text {
  margin: 0;
  width: 100%;
  color: var(--comment-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  word-break: break-word;
}

.comment-item__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.comment-item__time {
  color: var(--comment-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
}

.comment-item__reply {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  color: var(--comment-text);
  font-size: 12px;
  font-family: inherit;
  font-weight: 400;
  line-height: 18px;
  cursor: pointer;
}

.comment-replies {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.comment-thread.is-collapsed .comment-item--reply.is-extra {
  display: none;
}

.comment-item__toggle-group {
  display: inline-flex;
  align-items: flex-start;
  gap: 29px;
}

.comment-item__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  color: var(--comment-muted);
  font-size: 12px;
  font-family: inherit;
  font-weight: 400;
  line-height: 18px;
  cursor: pointer;
}

.comment-item__toggle[hidden] {
  display: none !important;
}

.comment-thread.is-collapsed .comment-item__toggle--fold {
  display: none !important;
}

.comment-thread.is-expanded .comment-item__toggle--more {
  display: none !important;
}

.comment-item__toggle-line {
  width: 20px;
  height: 1px;
  background: var(--comment-muted);
  border-radius: 0.5px;
  flex-shrink: 0;
}

.comment-item__chevron {
  position: relative;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.comment-item__chevron::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 5.5px;
  width: 7.5px;
  height: 7.5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  box-sizing: border-box;
}

.comment-item__chevron--up::before {
  top: 8px;
  transform: rotate(-135deg);
}

.comment-list__end {
  align-self: stretch;
  opacity: 0.3;
  text-align: center;
  color: var(--comment-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
}

.comment-list__end--empty {
  opacity: 1;
}

@media (max-width: 768px) {
  .comment-section {
    gap: 18px;
  }

  .comment-composer {
    gap: 12px;
  }

  .comment-section__title {
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
  }

  .comment-form {
    padding: 18px 12px;
    gap: 12px;
    box-shadow: none;
  }

  .comment-form__textarea {
    min-height: 80px;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
  }

  .comment-form__textarea::placeholder {
    font-weight: 400;
  }

  .comment-form__submit {
    padding: 10px 24px;
    border-radius: 999px;
    color: var(--comment-ink);
  }

  .comment-list {
    gap: 12px;
  }

  .comment-list__count {
    font-size: 14px;
    line-height: 20px;
  }

  .comment-item__name {
    color: var(--comment-muted);
  }

  .comment-item__reply {
    color: var(--comment-muted);
  }

  .comment-item__time {
    color: var(--comment-time-h5);
  }

  .comment-item__toggle {
    color: var(--comment-toggle-h5);
  }

  .comment-item__toggle-line {
    background: var(--comment-toggle-h5);
  }

  .comment-list__end {
    display: none;
  }

  .comment-list__end--empty {
    display: block;
    opacity: 1;
  }
}
