.icon-heart  { background-image: url(../images/heart.png); }
.icon-heart-off  { background-image: url(../images/heart_off.png); }

.heart-link-with-count { display: inline-block; }
.heart-count-number { padding-left: 1ex; }

@media screen and (max-width: 899px) {
  .heart-link-with-count > *:nth-child(1) {
    margin-right: 0 !important;
  }
  .heart-link-with-count > *:nth-child(2) {
    margin-left: 0 !important;
    border-left: 0 !important;
  }

  #content > .contextual > .heart-link-with-count > * {
    font-weight: bold;

    display: inline-block;

    margin: 5px 0;
    margin-right: 2px;
    padding: 9px 9px 9px 9px;

    border: 1px solid #ddd;
    -webkit-border-radius: 3px;
    border-radius: 3px;
  }

  #history .journal .contextual .heart-link-with-count .heart-link-label,
  .message.reply .contextual .heart-link-with-count .heart-link-label,
  .news-article .contextual .heart-link-with-count .heart-link-label {
    display: none;
  }
}

/* Smile #75253: journal / attachment — icon only (no label / count text) */
#history .journal .contextual .heart-link-with-count .heart-link-label,
#history .journal .journal-actions .heart-link-with-count .heart-link-label,
#history .journal .contextual .heart-link-with-count .heart-count-number,
#history .journal .journal-actions .heart-link-with-count .heart-count-number,
div.attachments .heart-link-with-count .heart-link-label,
div.attachments .heart-link-with-count .heart-count-number,
.journal_attachments .heart-link-with-count .heart-link-label,
.journal_attachments .heart-link-with-count .heart-count-number,
#history .heart-link-with-count.attachment-heart-placed .heart-link-label,
#history .heart-link-with-count.attachment-heart-placed .heart-count-number {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

/* hearts#index / hearted_by */
.recent-heart-list {
  border: none;
  padding: 0;
  list-style: none;
  margin: 0;
}
.recent-heart-list > li {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
}
.recent-heart-list .heartable-link {
  display: block;
  margin-right: 0;
  line-height: 1.45;
}
.recent-heart-list .hearted-time {
  color: #888;
  font-size: 12px;
}

/* Smile #75328: hearted_by 筛选区（类型/时间/项目统一面板） */
#content .heart-filter-bar {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: #f7f9fb;
  border: 1px solid #e4e9ef;
  border-radius: 8px;
}
#content .heart-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 12px;
}
#content .heart-filter-row + .heart-filter-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e8edf2;
}
#content .heart-filter-label {
  flex: 0 0 40px;
  margin-top: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #6a737d;
  line-height: 22px;
}
#content ul.heart-filter-tags {
  display: flex;
  flex-wrap: wrap;
  flex: 1 1 200px;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}
/* 项目行：名称可能较长，tag 间距再松一点 */
#content ul.heart-filter-project-tags {
  gap: 10px 12px;
}
/* Smile #75630 smile.50: 折叠式下拉多选（非固定高度 listbox；不引入 Select2） */
#content .heart-project-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  flex: 1 1 200px;
  margin: 0;
}
#content .heart-project-dd {
  position: relative;
  flex: 1 1 220px;
  min-width: 200px;
  max-width: 420px;
}
#content .heart-project-dd-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: normal;
  line-height: 20px;
  color: #333;
  text-align: left;
  background: #fff;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  cursor: pointer;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
#content .heart-project-dd-toggle:hover,
#content .heart-project-dd.is-open .heart-project-dd-toggle {
  border-color: #9bb8d4;
  box-shadow: 0 0 0 2px rgba(58, 127, 193, 0.15);
}
#content .heart-project-dd-label {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#content .heart-project-dd-caret {
  flex: 0 0 auto;
  color: #6a737d;
  font-size: 12px;
}
#content .heart-project-dd-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}
#content .heart-project-dd-bulk {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 6px;
  padding: 0 2px 6px;
  border-bottom: 1px solid #e8edf2;
}
#content .heart-project-dd-bulk-btn {
  margin: 0;
  padding: 2px 10px;
  font-size: 12px;
  line-height: 18px;
  color: #2f5f8f;
  background: #f7f9fb;
  border: 1px solid #d8dee4;
  border-radius: 12px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
#content .heart-project-dd-bulk-btn:hover {
  color: #fff;
  background: #3a7fc1;
  border-color: #3a7fc1;
}
#content label.heart-project-dd-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: normal;
  line-height: 18px;
  color: #333;
  border-radius: 6px;
  cursor: pointer;
}
#content label.heart-project-dd-opt:hover {
  background: #eef5fb;
}
#content label.heart-project-dd-opt input {
  margin: 0;
  flex: 0 0 auto;
}
#content .heart-project-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  flex: 0 0 auto;
}
#content .heart-project-filter-actions .heart-project-filter-clear {
  display: inline-block;
  margin: 0;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: normal;
  line-height: 20px;
  color: #555;
  text-decoration: none;
  background: #fff;
  border: 1px solid #d8dee4;
  border-radius: 14px;
  cursor: pointer;
  box-sizing: border-box;
}
#content .heart-project-filter-actions .heart-project-filter-clear.selected,
#content .heart-project-filter-actions .heart-project-filter-clear:hover {
  color: #fff;
  background: #3a7fc1;
  border-color: #3a7fc1;
}
#content ul.heart-filter-tags > li {
  display: inline-block;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  list-style: none;
}
#content ul.heart-filter-tags a {
  display: inline-block;
  padding: 4px 12px;
  font-size: 13px;
  line-height: 20px;
  color: #555;
  text-decoration: none;
  background: #fff;
  border: 1px solid #d8dee4;
  border-radius: 14px;
}
#content ul.heart-filter-tags a:hover {
  color: #1a5a96;
  border-color: #9bb8d4;
  background: #eef5fb;
}
#content ul.heart-filter-tags a.selected {
  color: #fff;
  background: #3a7fc1;
  border-color: #3a7fc1;
}
/* 项目多选：选中略深，便于区分「可多选」 */
#content ul.heart-filter-project-tags a.selected {
  background: #2f6f9f;
  border-color: #2f6f9f;
}
@media screen and (max-width: 700px) {
  #content .heart-filter-bar { padding: 8px 10px; }
  #content .heart-filter-label { flex-basis: 100%; margin-top: 0; margin-bottom: -2px; }
}

/* hearted_by cards — high specificity vs theme li rules */
#content ul.recent-heart-list.heart-card-list {
  display: block;
  border: none;
  padding: 0;
  margin: 0;
  list-style: none;
  background: transparent;
}
#content ul.heart-card-list > li.heart-card {
  display: block !important;
  position: relative !important;
  margin: 0 0 14px !important;
  padding: 12px 14px 14px 14px !important;
  background: #fff !important;
  border: 1px solid #e2e6ea !important;
  border-left: 4px solid #5b9bd5 !important;
  border-radius: 6px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  list-style: none !important;
}
/* Smile #75328 smile.45/46: 取消钮进 meta 行，不再绝对定位挤时间 */
#content a.heart-card-unheart {
  position: static;
  flex: 0 0 auto;
  display: inline-block;
  margin-left: 4px;
  padding: 3px 10px;
  font-size: 12px;
  line-height: 20px;
  color: #9a5b5b;
  background: #fff8f8;
  border: 1px solid #e5c4c4;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
}
#content a.heart-card-unheart:hover {
  color: #fff;
  background: #c45c5c;
  border-color: #c45c5c;
}
#content > .contextual .heart-link-with-count {
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
}
#content > .contextual .attachment-heart-placed {
  float: none;
}
#content ul.heart-card-list > li.heart-card-attachment { border-left-color: #d4a017 !important; }
#content ul.heart-card-list > li.heart-card-journal { border-left-color: #3d9a5f !important; }
#content ul.heart-card-list > li.heart-card-issue { border-left-color: #3a7fc1 !important; }
#content ul.heart-card-list > li.heart-card-wiki_page,
#content ul.heart-card-list > li.heart-card-wiki,
#content ul.heart-card-list > li.heart-card-wiki_page_section { border-left-color: #6b7c93 !important; }
#content ul.heart-card-list > li.heart-card-news { border-left-color: #c45c26 !important; }
#content ul.heart-card-list > li.heart-card-message,
#content ul.heart-card-list > li.heart-card-board { border-left-color: #7a6bb0 !important; }

/* Smile #75328 smile.45/46: meta 用 flex，序号/类型/项目 与 时间/取消 分行不挤 */
#content .heart-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 10px;
  line-height: 1.45;
  overflow: visible;
}
#content .heart-card-meta-spacer {
  flex: 1 1 16px;
  min-width: 16px;
  height: 1px;
}
#content .heart-card-index {
  display: inline-block;
  vertical-align: middle;
  flex: 0 0 auto;
  min-width: 28px;
  height: 22px;
  line-height: 22px;
  margin-right: 0;
  padding: 0 7px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: bold;
  text-align: center;
  color: #fff;
  background: #4a5563;
  box-sizing: border-box;
}
#content .heart-type-badge {
  display: inline-block;
  vertical-align: middle;
  flex: 0 0 auto;
  margin-right: 0;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: bold;
  color: #fff;
  background: #5b9bd5;
}
#content .heart-type-attachment { background: #d4a017; }
#content .heart-type-journal { background: #3d9a5f; }
#content .heart-type-issue { background: #3a7fc1; }
#content .heart-type-wiki_page,
#content .heart-type-wiki,
#content .heart-type-wiki_page_section { background: #6b7c93; }

/* Smile #75616 / smile.44: Wiki 章节收藏方钮；亮态用实心金星（浅描边几乎看不出「变亮」） */
.wiki.wiki-page div.contextual[id^="section-"] {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.wiki.wiki-page a.wiki-section-heart-btn {
  box-sizing: border-box;
  width: 26px;
  height: 26px;
  padding: 0 !important;
  margin: 0;
  display: inline-block;
  vertical-align: middle;
  font-size: 0 !important;
  line-height: 26px;
  overflow: hidden;
  text-indent: -999px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background-color: #fff !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 14px 14px !important;
  cursor: pointer;
  text-decoration: none !important;
  transition: background-color .12s, border-color .12s, transform .12s;
}
.wiki.wiki-page a.wiki-section-heart-btn.icon-heart-off {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M8 2.8l1.5 3.1 3.4.5-2.45 2.4.6 3.4L8 10.6 4.95 12.2l.6-3.4L3.1 6.4l3.4-.5L8 2.8z' stroke='%2364748b' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}
.wiki.wiki-page a.wiki-section-heart-btn.icon-heart,
.wiki.wiki-page a.wiki-section-heart-btn.is-hearted {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M8 2.8l1.5 3.1 3.4.5-2.45 2.4.6 3.4L8 10.6 4.95 12.2l.6-3.4L3.1 6.4l3.4-.5L8 2.8z' fill='%23fbbf24' stroke='%23d97706' stroke-width='1' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  border-color: #fcd34d !important;
  background-color: #fffbeb !important;
  transform: scale(1.06);
}
.wiki.wiki-page a.wiki-section-heart-btn:hover {
  border-color: #fcd34d;
  background-color: #fffbeb !important;
}
.wiki.wiki-page a.wiki-section-heart-btn.is-busy {
  opacity: 0.55;
  pointer-events: none;
}
#content .heart-type-news { background: #c45c26; }
#content .heart-type-message,
#content .heart-type-board { background: #7a6bb0; }

#content .heart-project-badge {
  display: inline-block;
  vertical-align: middle;
  flex: 0 1 auto;
  max-width: 100%;
  margin-right: 0;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 18px;
  background: #eef3f7;
  border: 1px solid #d5dee6;
  color: #445;
  box-sizing: border-box;
}
#content .heart-project-badge a {
  color: #2f5f8f;
  text-decoration: none;
  word-break: break-all;
}
#content .heart-card-meta .hearted-time {
  display: inline-block;
  vertical-align: middle;
  float: none;
  flex: 0 0 auto;
  margin: 0;
  color: #8a939c;
  font-size: 12px;
  line-height: 22px;
  white-space: nowrap;
}
#content .heart-card-body {
  clear: both;
}

/* hearted_by：关联任务元信息 */
#content .issue-heart-meta {
  display: block;
  margin-top: 0;
  margin-bottom: 8px;
  padding: 8px 10px;
  background: #f7f9fb;
  border: 1px solid #e4e9ee;
  border-radius: 4px;
}
#content .heart-card-issue .issue-heart-meta {
  margin-bottom: 0;
}
#content .issue-heart-title {
  display: block;
  margin-bottom: 6px;
  line-height: 1.45;
  font-size: 14px;
}
#content .issue-heart-id {
  display: inline-block;
  margin-right: 8px;
  font-weight: bold;
  color: #2f5f8f;
  white-space: nowrap;
}
#content .issue-heart-subject {
  color: #222;
  font-weight: 600;
  text-decoration: none;
}
#content .issue-heart-subject:hover {
  text-decoration: underline;
}
#content .issue-heart-attrs {
  display: block;
  font-size: 12px;
  line-height: 1.7;
  color: #556;
}
#content .issue-heart-attr {
  display: inline-block;
  margin-right: 14px;
  vertical-align: middle;
}
#content .issue-heart-attr em {
  margin-right: 4px;
  font-style: normal;
  color: #8a939c;
}
#content .issue-heart-status {
  display: inline-block;
  padding: 0 6px;
  border-radius: 3px;
  background: #e8eef5;
  color: #2f5f8f;
  font-weight: bold;
}
#content .issue-heart-empty {
  color: #aaa;
}
#content .issue-heart-updated {
  color: #6a737d;
}

#content .journal-heart-item .journal-heart-line1,
#content .attachment-heart-line1 {
  font-size: 14px;
  line-height: 1.5;
}
#content .journal-heart-icon,
#content .attachment-heart-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 2px;
  vertical-align: middle;
  opacity: 0.75;
}

/* large thumbs — beat theme img { width:... } */
#content .attachment-heart-item {
  display: block;
  margin-top: 2px;
}
#content .attachment-heart-line1 {
  display: block;
  margin-bottom: 2px;
}
#content .attachment-heart-line2 {
  display: block;
  margin-top: 10px;
  overflow: visible;
}
#content a.attachment-heart-thumb {
  display: inline-block !important;
  vertical-align: top;
  margin-right: 14px;
  line-height: 0;
  padding: 6px !important;
  background: #f4f6f8 !important;
  border: 1px solid #d9dee3 !important;
  border-radius: 4px;
  max-width: none !important;
  width: auto !important;
  height: auto !important;
}
/* 勿套到 video/audio：否则 width/height:auto 会盖掉 contain 居中（#75253 阶段 Z） */
#content a.attachment-heart-thumb:not(.attachment-heart-video-link):not(.attachment-heart-audio-link) img,
#content .attachment-heart-fallback-img {
  max-width: 320px !important;
  max-height: 240px !important;
  width: auto !important;
  height: auto !important;
  min-width: 80px;
  min-height: 80px;
}

/* hearted_by 视频缩略/占位 */
#content a.attachment-heart-video-link {
  text-decoration: none !important;
  color: inherit;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
}
#content .attachment-heart-video-box {
  position: relative;
  display: inline-block;
  vertical-align: top;
  width: 320px;
  max-width: 100%;
  min-height: 180px;
  background: #1a1d21;
  border: 1px solid #d9dee3;
  border-radius: 4px;
  overflow: hidden;
  box-sizing: border-box;
}
/* Smile #75320 */
#content a.attachment-heart-audio-link {
  text-decoration: none !important;
  color: inherit;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
}
#content .attachment-heart-audio-box {
  min-height: 96px;
}
#content .attachment-heart-audio-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 72px;
  background: #2a2e33;
  color: #eee;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
/* Smile #75253 stage W/Z: 与播放一致——contain 居中；选择器须压过 thumb img 的 auto */
#content a.attachment-heart-video-link img.attachment-heart-video-el,
#content .attachment-heart-video-el {
  display: block !important;
  width: 100% !important;
  height: 180px !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: #111;
  pointer-events: none;
  border: 0 !important;
}
/* Smile #75253 stage W: 任务详情「文件」缩略区视频 poster 同样居中 */
div.attachments .thumbnails a[data-hearts-poster] {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 120px;
  background: #111;
  box-sizing: border-box;
}
div.attachments .thumbnails img.attachment-heart-video-poster {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
  object-position: center center;
  background: #111;
}
#content .attachment-heart-video-play {
  position: absolute;
  left: 50%;
  top: 72px;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-sizing: border-box;
  pointer-events: none;
}
#content .attachment-heart-video-play::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -5px;
  margin-top: -8px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 0 8px 14px;
  border-color: transparent transparent transparent #fff;
}
#content .attachment-heart-video-meta {
  display: block;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.4;
  color: #e8ecef;
  background: rgba(0, 0, 0, 0.72);
  word-break: break-all;
}
#content .attachment-heart-video-meta .vh-name {
  font-weight: 600;
}
#content .attachment-heart-actions {
  display: inline-block;
  vertical-align: top;
  padding-top: 6px;
}
#content .attachment-heart-actions a {
  display: inline-block;
  margin: 0 8px 8px 0;
  vertical-align: middle;
}
#content .attachment-heart-file {
  display: inline-block;
  vertical-align: middle;
  margin-right: 12px;
  padding: 8px 10px;
  background: #f4f6f8;
  border: 1px solid #d9dee3;
  border-radius: 4px;
}
#content .attachment-heart-filename {
  color: #444;
  font-weight: 600;
}

.journal-heart-holder *,
.attachment-heart-holder *,
.news-heart-holder * {
  display: none;
}

/* attachment hearts: fixed slot next to download — no jitter when toggling */
div.attachments .heart-link-with-count.attachment-heart-placed,
.journal_attachments .heart-link-with-count.attachment-heart-placed,
#history .vc-att-box .heart-link-with-count.attachment-heart-placed,
#history .heart-link-with-count.attachment-heart-placed {
  display: inline-block;
  vertical-align: middle;
  width: 18px;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  margin-left: 4px;
  margin-right: 0;
  float: none;
  overflow: hidden;
  box-sizing: border-box;
}
div.attachments .heart-link-with-count.attachment-heart-placed > a.icon,
.journal_attachments .heart-link-with-count.attachment-heart-placed > a.icon,
#history .heart-link-with-count.attachment-heart-placed > a.icon {
  display: inline-block !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  padding: 0 0 0 16px !important;
  margin: 0 !important;
  background-size: 16px 16px !important;
  background-position: 0 50% !important;
  background-repeat: no-repeat !important;
  box-sizing: border-box;
  vertical-align: middle;
}

/* thumbnails must never show hearts */
div.attachments .thumbnails .heart-link-with-count {
  display: none !important;
}

/* —— 移动端 —— */
@media (max-width: 700px) {
  #content ul.heart-card-list > li.heart-card {
    padding: 10px 12px 12px 10px !important;
    margin-bottom: 10px !important;
  }
  #content a.heart-card-unheart {
    padding: 2px 8px;
    font-size: 11px;
    line-height: 18px;
  }
  #content .heart-card-meta {
    margin-bottom: 8px;
    gap: 8px 10px;
  }
  #content .heart-card-meta-spacer {
    flex-basis: 100%;
    height: 0;
    min-width: 0;
  }
  #content .heart-card-meta .hearted-time {
    float: none;
    display: inline-block;
    margin: 0;
    white-space: normal;
  }
  #content .heart-card-index {
    min-width: 24px;
    height: 20px;
    line-height: 20px;
    font-size: 12px;
  }
  #content .heart-type-badge,
  #content .heart-project-badge {
    margin-right: 0;
    font-size: 11px;
    padding: 1px 7px;
  }
  #content .issue-heart-meta {
    padding: 8px;
  }
  #content .issue-heart-title {
    font-size: 13px;
  }
  #content .issue-heart-id {
    display: block;
    margin: 0 0 2px;
  }
  #content .issue-heart-subject {
    display: block;
  }
  #content .issue-heart-attrs {
    font-size: 11px;
  }
  #content .issue-heart-attr {
    display: block;
    margin: 2px 0 0;
  }
  #content a.attachment-heart-thumb {
    display: block !important;
    margin: 8px 0 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  #content a.attachment-heart-thumb:not(.attachment-heart-video-link):not(.attachment-heart-audio-link) img,
  #content .attachment-heart-fallback-img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
  }
  #content .attachment-heart-video-box {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 140px;
  }
  #content a.attachment-heart-video-link img.attachment-heart-video-el,
  #content .attachment-heart-video-el {
    height: 140px !important;
    width: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
  }
  #content .attachment-heart-video-play {
    top: 56px;
  }
  #content .attachment-heart-actions {
    display: block;
    margin-top: 8px;
  }
  #content .attachment-heart-line1,
  #content .journal-heart-item .journal-heart-line1 {
    font-size: 13px;
    word-break: break-word;
  }
  /* 附件详情顶栏：下载 + 收藏可换行 */
  #content > .contextual {
    float: none !important;
    display: block;
    text-align: left;
    margin: 0 0 8px;
  }
  #content > .contextual .heart-link-with-count {
    display: inline-block;
    margin: 4px 0 0 0;
  }
  #content > .contextual .heart-link-with-count .heart-link-label {
    /* 窄屏保留文字，但不要紧贴 */
  }
}

/* Smile #75370 / smile.32: fancybox 工具栏心形 + 常驻浮钮（不受 idle 隐藏） */
.fancybox-button--heart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fancybox-button--heart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.fancybox-button--heart svg path {
  fill: currentColor;
  stroke-width: 0;
}
.fancybox-button--heart.is-hearted {
  color: #ff6b8a;
  opacity: 1;
}
.fancybox-button--heart.is-hearted:hover {
  color: #ff8aa3;
}

.fancybox-heart-float {
  position: absolute;
  /* #75370 smile.34: 下移避开顶栏工具条（约 44px），避免叠在一起 */
  top: 56px;
  right: 14px;
  z-index: 100020;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px 0 10px;
  border: 0;
  border-radius: 20px;
  cursor: pointer;
  color: #fff;
  background: rgba(30, 30, 30, 0.78);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  font-size: 14px;
  line-height: 1;
}
.fancybox-heart-float svg {
  width: 20px;
  height: 20px;
  display: block;
}
.fancybox-heart-float svg path {
  fill: currentColor;
}
.fancybox-heart-float:hover {
  background: rgba(50, 50, 50, 0.92);
}
.fancybox-heart-float.is-hearted {
  color: #ff6b8a;
  background: rgba(30, 30, 30, 0.9);
}
.fancybox-heart-float-label {
  font-weight: 600;
  letter-spacing: 0.02em;
}

