/* 克制/配合留言板 */
.comment-board {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.comment-compose {
  flex-shrink: 0;
  padding-bottom: 4px;
}

.comment-board-divider {
  flex-shrink: 0;
  height: 0;
  margin: 18px 0 0;
  border: none;
  border-top: 1px solid #3d465c;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.comment-history {
  margin-top: 16px;
  padding: 16px 14px 12px;
  background: #101218;
  border-radius: 10px;
  border: 1px solid #252a38;
}

.comment-history-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: #8b93a8;
  letter-spacing: 0.06em;
  text-transform: none;
}

/* 下拉列表不被卡片 overflow 裁切 */
#heroCommentsCard,
#heroCommentsCard .d-card-body,
#itemCommentsCard,
#itemCommentsCard .d-card-body,
.comment-history,
.comment-compose,
.comment-board-hero .cb-field-grow,
.comment-board-hero .cb-search-wrap,
.comment-board-hero .cb-rel-dropdown,
.comment-board-item .cb-rel-dropdown,
.comment-board-item .comment-rel-search,
.comment-board-hero .comment-hero-sentence,
.comment-board-item .comment-item-sentence {
  overflow: visible;
}

/* 句式行：关系下拉 + 搜索 + 文案 —— 强制同一行（grid） */
.comment-board-hero .comment-hero-sentence,
.comment-board-item .comment-item-sentence {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  grid-template-rows: auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 0;
  padding: 10px 12px;
  background: #141620;
  border: 1px solid #2a2e3d;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
}

.comment-board-hero .comment-hero-sentence > .cb-rel-dropdown,
.comment-board-item .comment-item-sentence > .cb-rel-dropdown {
  grid-column: 1;
  grid-row: 1;
  width: auto !important;
  min-width: 7.5em;
  max-width: 11em;
  justify-self: start;
  position: relative;
  z-index: 20;
}

/* 关系类型自定义下拉 */
.cb-rel-dropdown {
  position: relative;
  flex-shrink: 0;
  user-select: none;
}
.cb-rel-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 36px;
  box-sizing: border-box;
  padding: 0 10px;
  background: #13161e;
  border: 1px solid #2a2e3d;
  border-radius: 6px;
  color: #dde0eb;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, background .15s;
}
.cb-rel-dropdown-btn:hover,
.cb-rel-dropdown.open .cb-rel-dropdown-btn {
  border-color: #3a4460;
  background: #1a1f2e;
}
.cb-rel-dropdown-value {
  flex: 1;
  min-width: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cb-rel-dropdown-arrow {
  display: flex;
  color: #6b7590;
  flex-shrink: 0;
  transition: transform .15s;
}
.cb-rel-dropdown.open .cb-rel-dropdown-arrow {
  transform: rotate(180deg);
}
.cb-rel-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  background: #13161e;
  border: 1px solid #2a3050;
  border-radius: 8px;
  overflow: hidden;
  z-index: 250;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  padding: 4px 0;
}
.cb-rel-dropdown.open .cb-rel-dropdown-menu {
  display: block;
}
.comment-form button.cb-rel-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 9px 14px;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #b0b8cc !important;
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  align-self: stretch;
}
.comment-form button.cb-rel-dropdown-item:hover,
.comment-form button.cb-rel-dropdown-item:focus {
  background: #1e2535 !important;
  color: #fff !important;
}
.comment-form button.cb-rel-dropdown-item.selected {
  color: #fff !important;
  background: #1a2238 !important;
}
.comment-form button.cb-rel-dropdown-item.selected::before {
  content: '✓';
  font-size: 11px;
  color: #4a9eff;
  width: 12px;
  flex-shrink: 0;
}
.comment-form button.cb-rel-dropdown-item:not(.selected)::before {
  content: '';
  width: 12px;
  flex-shrink: 0;
}

.comment-board-hero .comment-hero-sentence > .comment-rel-search,
.comment-board-item .comment-item-sentence > .comment-rel-search {
  grid-column: 2;
  grid-row: 1;
  min-width: 0 !important;
  width: auto !important;
  max-width: none;
}

.comment-board-hero .comment-hero-sentence > .comment-rel-before,
.comment-board-item .comment-item-sentence > .comment-rel-before {
  grid-column: 3;
  grid-row: 1;
  white-space: nowrap;
}

.comment-board-hero .comment-hero-sentence > .comment-rel-subject,
.comment-board-item .comment-item-sentence > .comment-rel-subject {
  grid-column: 4;
  grid-row: 1;
  white-space: nowrap;
}

.comment-board-hero .comment-hero-sentence > .comment-rel-after,
.comment-board-item .comment-item-sentence > .comment-rel-after {
  grid-column: 5;
  grid-row: 1;
  white-space: nowrap;
}

.comment-board-hero .comment-hero-sentence .cb-search-wrap,
.comment-board-item .comment-item-sentence .cb-search-wrap {
  width: 100%;
}

.cb-rel-select,
.cb-item-rel-select {
  appearance: none;
  -webkit-appearance: none;
  background: #1a1c28 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7590' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center;
  border: 1px solid #2a2e3d;
  border-radius: 6px;
  color: #dde0eb;
  font-size: 12px;
  padding: 8px 28px 8px 10px;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}
.cb-rel-select:hover,
.cb-item-rel-select:hover { border-color: #3a4a5a; }
.cb-rel-select:focus,
.cb-item-rel-select:focus { border-color: #4a6fa5; }

.comment-board-hero .comment-rel-before,
.comment-board-item .comment-rel-before {
  font-size: 15px;
  font-weight: 600;
  color: #9ca3af;
  flex-shrink: 0;
}
.comment-board-hero .comment-hero-sentence[data-rel="counter"] .comment-rel-before,
.comment-board-hero .comment-hero-sentence[data-rel="item_counter"] .comment-rel-before {
  color: #e05555;
  font-weight: 700;
}
.comment-board-hero .comment-hero-sentence[data-rel="synergy"] .comment-rel-after {
  color: #6ec86e;
  font-weight: 700;
}
.comment-board-hero .comment-hero-sentence[data-rel="hero_fit"] .comment-rel-before {
  color: #6ec86e;
  font-weight: 700;
}
.comment-board-hero .comment-rel-after,
.comment-board-item .comment-rel-after {
  font-size: 15px;
  font-weight: 600;
  color: #6ec86e;
  flex-shrink: 0;
}
.comment-board-hero .comment-rel-after:empty,
.comment-board-item .comment-rel-after:empty { display: none; }

.comment-board-title {
  font-size: 14px; font-weight: 600; color: #dde0eb;
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.comment-board-title span { font-size: 11px; font-weight: 400; color: #6b7590; }

.comment-rel-subject {
  font-size: 15px;
  font-weight: 700;
  color: #c89b3c;
  flex-shrink: 0;
  user-select: none;
}

.comment-history .comment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 0;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 2px;
}

.comment-list {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 14px; max-height: 360px; overflow-y: auto;
}
.comment-item {
  background: #141620;
  border: 1px solid #2a2e3d;
  border-radius: 8px;
  padding: 10px 12px;
}
.comment-item.is-adopted {
  border-color: rgba(200, 155, 60, 0.35);
  background: linear-gradient(135deg, #1a1820 0%, #141620 100%);
}
.comment-item-layout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.comment-item-body {
  flex: 1;
  min-width: 0;
}
.comment-adopt-status {
  flex-shrink: 0;
  align-self: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  padding: 4px 9px;
  border-radius: 5px;
  white-space: nowrap;
}
.comment-adopt-status.is-adopted {
  color: #1a1408;
  background: linear-gradient(180deg, #e8c468 0%, #c89b3c 100%);
}
.comment-adopt-status.is-pending {
  color: #a8b8d8;
  background: #1e2438;
  border: 1px solid #3a4a68;
}
.comment-adopt-status.is-rejected {
  color: #8a9098;
  background: #1a1e28;
  border: 1px solid #2e3448;
}
.comment-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.comment-author { font-size: 13px; font-weight: 600; color: #c89b3c; }
.comment-rel-tag {
  font-size: 11px; color: #e0a060;
  background: rgba(200,155,60,.12); border: 1px solid rgba(200,155,60,.25);
  border-radius: 4px; padding: 1px 6px;
}
.comment-target {
  font-size: 11px; color: #7dd3fc;
  background: #0d1a28; border: 1px solid #1a3050;
  border-radius: 4px; padding: 1px 6px;
}
.comment-time { font-size: 11px; color: #4b5563; margin-left: auto; }
.comment-content {
  font-size: 13px; color: #b8bcc8; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}
.comment-empty { font-size: 13px; color: #4b5563; padding: 8px 0; }

.comment-form { display: flex; flex-direction: column; gap: 10px; }
.comment-form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.comment-form-selects { align-items: stretch; }

.cb-field { display: flex; flex-direction: column; gap: 5px; min-width: 140px; }
.cb-field-grow { flex: 1; min-width: 200px; }
.cb-field-label { font-size: 11px; color: #6b7590; font-weight: 500; }

.comment-form input[type="text"],
.comment-form textarea {
  background: #141620; border: 1px solid #2a2e3d; border-radius: 6px;
  color: #e0e0e0; font-size: 13px; padding: 8px 10px; outline: none; font-family: inherit;
}
.comment-form input[type="text"]:focus,
.comment-form textarea:focus { border-color: #4a6fa5; }
.comment-form input.author-input { width: 160px; }
.comment-form textarea { width: 100%; min-height: 72px; resize: vertical; }

/* 关系类型下拉（旧版 cb-field 内仍占满宽） */
.cb-field .cb-rel-select {
  width: 100%;
}

/* 可搜索英雄下拉 */
.cb-search-wrap { position: relative; width: 100%; }
.cb-search-input-wrap {
  display: flex; align-items: center;
  background: #141620; border: 1px solid #2a2e3d; border-radius: 6px;
  transition: border-color .2s;
}
.cb-search-input-wrap:focus-within { border-color: #4a6fa5; }
.cb-search-input {
  flex: 1; background: transparent !important; border: none;
  color: #e0e0e0; font-size: 13px; padding: 9px 8px 9px 10px; outline: none;
  font-family: inherit; min-width: 0;
}
.cb-search-input::placeholder { color: #6b7590; }
.cb-search-icon {
  display: flex; align-items: center; padding: 0 4px 0 8px; color: #6b7590; flex-shrink: 0;
}
.cb-search-clear {
  background: none !important; border: none !important; color: #6b7590; cursor: pointer;
  padding: 0 10px; font-size: 12px; line-height: 1; box-shadow: none !important;
}
.cb-search-clear:hover { color: #e0e0e0; }

.cb-search-dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 200;
  max-height: 280px; overflow-y: auto;
  background: #13161e;
  border: 1px solid #2a3448;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  padding: 4px 0;
}
.cb-search-dropdown::-webkit-scrollbar { width: 6px; }
.cb-search-dropdown::-webkit-scrollbar-thumb {
  background: #3a3e4d; border-radius: 3px;
}

/* 下拉项：独立样式，避免被 .comment-form button 覆盖 */
.comment-form button.cb-search-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  margin: 0;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #dde0eb !important;
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  align-self: stretch;
}
.comment-form button.cb-search-option + button.cb-search-option {
  border-top: 1px solid #1e2535 !important;
}
.comment-form button.cb-search-option:hover,
.comment-form button.cb-search-option:focus {
  background: #1e2535 !important;
  color: #fff !important;
}
.comment-form button.cb-search-option:active {
  background: #252d3d !important;
}
.comment-form button.cb-search-option img {
  width: 36px; height: 36px; border-radius: 6px; object-fit: cover;
  background: #0d0f1a; flex-shrink: 0;
  border: 1px solid #2a2e3d;
}
.cb-search-option-text {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
}
.cb-search-option-name {
  font-size: 13px; color: #e8eaf0; font-weight: 600; line-height: 1.3;
}
.cb-search-option-nick {
  font-size: 11px; color: #6b7590; line-height: 1.3;
}
.cb-search-option-slug {
  font-size: 11px; color: #4b5563; font-family: ui-monospace, monospace;
  flex-shrink: 0;
}
.cb-search-empty {
  padding: 14px 12px; font-size: 13px; color: #6b7590; text-align: center;
}

/* 仅「发表留言」使用金色按钮 */
.comment-form button[type="submit"] {
  align-self: flex-end;
  padding: 8px 20px;
  background: #c89b3c;
  border: none;
  border-radius: 6px;
  color: #0d0f1a;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.comment-form button[type="submit"]:hover { background: #e0b04e; }
.comment-form button[type="submit"]:disabled { opacity: .5; cursor: not-allowed; }

.comment-msg { font-size: 12px; margin-top: 2px; }
.comment-msg.error { color: #fca5a5; }
.comment-msg.ok { color: #6ec86e; }

/* 物品页旧版 select */
.comment-form select.target-select {
  flex: 1; min-width: 160px;
  background: #141620; border: 1px solid #2a2e3d; border-radius: 6px;
  color: #e0e0e0; font-size: 13px; padding: 8px 10px; outline: none;
}
