/* Solitude tokens on Twikoo 2's public comments; the admin drawer stays native. */
#twikoo > .tk-comments {
  color: var(--efu-fontcolor);
}

#twikoo > .tk-comments .tk-submit {
  margin-top: 0;
  min-width: 0;
}

#twikoo > .tk-comments .tk-comment > .tk-main > .tk-submit {
  --efu-fontcolor: #2b2d32;
  --efu-secondtext: #777d87;
  --efu-secondbg: #f7f8fa;
  --efu-card-bg: #fff;
  --style-border-always: 1px solid #e3e6ec;
  grid-column: 1 / -1;
  margin-top: 12px;
}

#twikoo > .tk-comments .tk-comment > .tk-main > .tk-submit > .tk-submit-footer {
  margin-bottom: 0;
}

#twikoo > .tk-comments .tk-submit > .tk-comment-editor textarea {
  font-size: 16px;
}

#twikoo > .tk-comments .tk-submit .tk-meta-input {
  display: flex;
  flex-direction: row;
  gap: 6px;
  width: auto;
  min-width: 0;
  margin: 0;
}

#twikoo > .tk-comments .tk-submit .tk-meta-input > .tk-input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  margin: 0;
}

#twikoo > .tk-comments .tk-submit .tk-input__inner,
#twikoo > .tk-comments .tk-submit .tk-input-group__prepend {
  box-sizing: border-box;
  height: 40px;
  border: var(--style-border-always);
  color: var(--efu-fontcolor);
  background-color: var(--efu-secondbg);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

#twikoo > .tk-comments .tk-submit .tk-input__inner {
  min-width: 0;
  padding: 8px 12px;
  border-radius: 12px;
}

#twikoo > .tk-comments .tk-submit .tk-input-group__prepend {
  flex: 0 0 auto;
  padding: 0 12px;
  border-right: 0;
  border-radius: 12px 0 0 12px;
  color: var(--efu-secondtext);
}

#twikoo > .tk-comments .tk-submit .tk-input--group > .tk-input__inner {
  border-radius: 0 12px 12px 0;
}

#twikoo > .tk-comments .tk-submit .tk-input__inner::placeholder {
  color: var(--efu-secondtext);
  opacity: 0.75;
}

#twikoo > .tk-comments .tk-submit .tk-input__inner:hover {
  border-color: var(--efu-main);
}

#twikoo > .tk-comments .tk-submit .tk-input__inner:focus-visible {
  outline: none;
  border-color: var(--efu-main);
  box-shadow: 0 0 0 3px var(--efu-main-op);
}

#twikoo > .tk-comments .tk-submit .tk-textarea {
  min-width: 0;
}

#twikoo > .tk-comments .tk-submit textarea.tk-textarea__inner {
  display: block;
  width: 100%;
  height: auto;
  min-height: 140px;
  padding: 14px 16px 60px;
  border-radius: 12px;
  resize: vertical;
  line-height: 1.7;
}

#twikoo > .tk-comments .tk-submit .tk-input__count {
  right: 12px;
  bottom: 20px;
  line-height: 18px;
  color: var(--efu-secondtext);
  background: transparent;
}

#twikoo > .tk-comments .tk-submit > .tk-row.actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 10px 0 18px;
}

#twikoo > .tk-comments > .tk-submit > .tk-row.actions {
  margin-left: 0;
}

#twikoo > .tk-comments .tk-submit > .tk-row.actions > .tk-button {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 52px;
  min-height: 32px;
  height: auto;
  margin: 0;
  padding: 6px 12px;
  border: var(--style-border-always);
  border-radius: 9px;
  color: var(--efu-fontcolor);
  background: var(--efu-secondbg);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.4;
}

/* Composer controls use the site theme rather than the article cover accent. */
#twikoo > .tk-comments .tk-submit :is(.tk-identity-action, .tk-guest-switch) {
  --tk-action-accent: var(--efu-theme);
}

#twikoo > .tk-comments .tk-submit > .tk-row.actions > .tk-button:not(.is-disabled):is(:hover, :focus-visible, :active) {
  border-color: var(--efu-theme);
  color: var(--efu-theme);
  background: var(--efu-theme-op);
}

#twikoo > .tk-comments .tk-submit > .tk-row.actions > .tk-send {
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--efu-theme) 17%, transparent);
  border-radius: 999px;
  color: var(--efu-theme);
  background: color-mix(in srgb, var(--efu-theme) 8%, var(--efu-card-bg));
  font-size: 11px;
  line-height: 18px;
}

#twikoo > .tk-comments .tk-submit > .tk-row.actions > .tk-send:not(.is-disabled):is(:hover, :focus-visible) {
  border-color: color-mix(in srgb, var(--efu-theme) 30%, transparent);
  color: var(--efu-theme);
  background: color-mix(in srgb, var(--efu-theme) 15%, var(--efu-card-bg));
}

#twikoo > .tk-comments .tk-submit > .tk-row.actions > .tk-send:not(.is-disabled):active {
  background: color-mix(in srgb, var(--efu-theme) 20%, var(--efu-card-bg));
}

@media (pointer: coarse) {
  #twikoo > .tk-comments .tk-submit > .tk-row.actions > .tk-send { min-height: 36px; }
}

#twikoo > .tk-comments .tk-submit > .tk-row.actions > .tk-button:focus-visible,
#twikoo > .tk-comments .tk-submit :is(.tk-identity-action, .tk-guest-switch):focus-visible {
  outline: 2px solid var(--efu-theme);
  outline-offset: 3px;
}

#twikoo > .tk-comments .tk-submit > .tk-row.actions > .tk-button.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* SVGs participate in their button's layout, including empty-avatar SVGs. */
#twikoo > .tk-comments .tk-icon {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

#twikoo > .tk-comments .tk-icon > svg {
  display: block;
  flex-shrink: 0;
}

#twikoo > .tk-comments .tk-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  margin-right: 12px;
  border-radius: 50%;
  overflow: hidden;
}

#twikoo > .tk-comments .tk-avatar > .tk-avatar-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1;
  color: var(--efu-secondtext);
  object-fit: cover;
}

#twikoo > .tk-comments .tk-avatar .tk-icon,
#twikoo > .tk-comments .tk-avatar .tk-icon > svg {
  width: 100%;
  height: 100%;
}

#twikoo > .tk-comments .tk-replies .tk-avatar {
  width: 28px;
  height: 28px;
  margin-right: 10px;
}

/* Compact identity and send controls share the composer's bottom row. */
#twikoo > .tk-comments .tk-submit-footer > .tk-avatar {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin: 0;
  border: var(--style-border-always);
  border-radius: 50%;
  background: var(--efu-secondbg);
}
#twikoo > .tk-comments .tk-submit-footer > .tk-avatar > .tk-avatar-img {
  width: 100%;
  height: 100%;
  line-height: 1;
}
#twikoo > .tk-comments .tk-submit-footer .tk-meta-input {
  flex: 1 1 0;
}
#twikoo > .tk-comments .tk-submit-footer .tk-input__inner {
  height: 32px;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 12px;
}

#twikoo > .tk-comments > .tk-comments-container {
  min-height: 0;
}

/* 一条主评论与其所有回复共用卡片，背景与评论输入框保持一致。 */
#twikoo > .tk-comments > .tk-comments-container > .tk-comment {
  box-sizing: border-box;
  min-width: 0;
  margin-top: 12px;
  padding: 12px 16px;
  border: var(--style-border-always);
  border-radius: 12px;
  background-color: var(--efu-secondbg);
}

#twikoo > .tk-comments .tk-replies > .tk-comment {
  margin-top: 10px;
  padding-top: 10px;
  border-top: var(--style-border-always);
}

#twikoo > .tk-comments .tk-comment .tk-nick {
  line-height: 1.35;
}

#twikoo > .tk-comments .tk-comment .tk-time {
  font-size: 12px;
  line-height: 1.3;
}

#twikoo > .tk-comments .tk-comment .tk-content {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.55;
}

#twikoo > .tk-comments .tk-comment .tk-content p {
  margin: 0 0 4px;
  line-height: inherit;
}

#twikoo > .tk-comments .tk-comment .tk-content p:last-child {
  margin-bottom: 0;
}

/* 正文图片以紧凑缩略图显示，头像、表情和灯箱保持原尺寸。 */
#twikoo > .tk-comments .tk-comment .tk-content img:not(.tk-owo-emotion):not(.vemoji) {
  width: auto;
  height: auto;
  max-width: min(140px, 100%);
  max-height: 110px;
  object-fit: contain;
}

#twikoo > .tk-comments .tk-comment .tk-content :is(blockquote, ul, ol, pre) {
  margin-top: 6px;
  margin-bottom: 6px;
  line-height: inherit;
}

/* 内置代码窗口自己控制行号、缩进与滚动，不继承正文的紧凑行距。 */
#twikoo > .tk-comments .tk-comment .tk-content .tk-code-window pre.tk-code-pre {
  margin: 0;
  line-height: 1.75;
}

#twikoo > .tk-comments .tk-comment .tk-content li {
  margin: 2px 0;
  line-height: inherit;
}

#twikoo > .tk-comments > .tk-comments-container > .tk-comments-no {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 80px;
  padding: 24px;
  color: var(--efu-secondtext);
}

#twikoo > .tk-comments .tk-comment .tk-action {
  gap: 6px;
}

#twikoo > .tk-comments .tk-comment .tk-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 36px;
  margin: 0;
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--efu-secondtext);
}

#twikoo > .tk-comments .tk-comment .tk-action-link:hover {
  color: var(--efu-main);
  background: var(--efu-main-op);
}

#twikoo > .tk-comments .tk-comment .tk-action-icon {
  color: inherit;
}

#twikoo > .tk-comments .tk-comment .tk-time,
#twikoo > .tk-comments .twikoo-info {
  color: var(--efu-secondtext);
}

#twikoo > .tk-comments .tk-comment .tk-extras {
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.35;
}

/* 属地、操作系统、浏览器分别保留为独立的信息胶囊。 */
#twikoo > .tk-comments .tk-comment .tk-extra {
  box-sizing: border-box;
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 3px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  color: #111;
  background: #fff;
  font-size: inherit;
  line-height: inherit;
}

#twikoo > .tk-comments .tk-comment .tk-extra-text {
  min-width: 0;
  line-height: inherit;
  overflow-wrap: anywhere;
  word-break: normal;
}

#twikoo > .tk-comments .tk-submit .OwO-body {
  border: var(--style-border-always);
  border-radius: 12px;
  color: var(--efu-fontcolor);
  background: var(--efu-card-bg);
}

@media (max-width: 768px) {
  #twikoo > .tk-comments .tk-comment > .tk-main > .tk-submit { margin-top: 10px; }

  #twikoo > .tk-comments > .tk-comments-container > .tk-comment {
    padding: 12px;
  }

  #twikoo > .tk-comments .tk-submit .tk-input__inner {
    font-size: 16px;
  }

  #twikoo > .tk-comments .tk-submit > .tk-row.actions {
    gap: 8px;
    margin-left: 0;
  }

  #twikoo > .tk-comments .tk-submit > .tk-row.actions > .tk-button {
    min-width: 48px;
    padding-right: 9px;
    padding-left: 9px;
  }

}

@media (max-width: 600px) {
  #twikoo > .tk-comments .tk-submit > .tk-submit-footer.is-guest-method {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto auto;
    gap: 8px;
  }
  #twikoo > .tk-comments .tk-submit-footer.is-guest-method .tk-meta-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    overflow: visible;
    padding: 0;
  }
  #twikoo > .tk-comments .tk-submit-footer.is-guest-method .tk-meta-input > .tk-input { flex: none; width: 100%; min-width: 0; }
  #twikoo > .tk-comments .tk-submit > .tk-submit-footer { gap: 6px; }
  #twikoo > .tk-comments .tk-submit-footer .tk-meta-input > .tk-input {
    flex: 0 0 120px;
    width: 120px;
  }
  #twikoo > .tk-comments .tk-submit-footer .tk-input__inner { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  #twikoo > .tk-comments .tk-submit .tk-input__inner,
  #twikoo > .tk-comments .tk-submit > .tk-row.actions > .tk-button {
    transition: none;
  }
}
