/* 卡片只露出目录短标题；悬浮始终横向展开，不改变卡片高度。 */
.thread-strip { --thread-label-width: 104px; display: flex; align-items: center; gap: 8px; min-width: 0; height: 40px; }
.thread-strip-group { display: inline-flex; align-items: center; flex: none; }
.thread-summary-node { display: inline-flex; align-items: center; flex: none; height: 36px; padding: 0 2px; color: var(--muted); font-size: 13px; line-height: 22px; }
.thread-summary-node:hover { text-decoration: none; }
.thread-summary-node:first-child { padding-left: 0; }
.thread-summary-avatar { width: 18px; height: 18px; flex: none; border-radius: 50%; object-fit: cover; background: var(--band-soft); }
.thread-summary-node:first-child .thread-summary-avatar { width: 32px; height: 32px; }
/* 按标题实际长度展开，最长仍受上限约束，短标题后不留占位空白。 */
.thread-summary-label { display: block; max-width: 0; margin-left: 0; opacity: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: left; transition: max-width .2s ease, margin-left .2s ease, opacity .15s ease; }
.thread-summary-node[aria-expanded="true"] { color: var(--link); }
.thread-summary-node[aria-expanded="true"] .thread-summary-label { max-width: var(--thread-label-width); margin-left: 8px; opacity: 1; }
.thread-summary-line { width: 10px; height: 1px; flex: none; background: color-mix(in srgb, var(--muted) 22%, var(--surface)); }
.thread-more { display: inline-flex; align-items: center; justify-content: center; flex: none; gap: 3px; min-height: 28px; margin-left: auto; color: var(--link); font-size: 11px; white-space: nowrap; }
.thread-more-arrow { font-size: 16px; line-height: 20px; }
.thread-more:hover { text-decoration: none; }
.thread-more:hover .thread-more-text { text-decoration: underline; }
.thread-single { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; font-size: 13px; line-height: 22px; }
.thread-single:hover { text-decoration: none; }
.thread-single:hover .thread-single-title { text-decoration: underline; }
.thread-single-kicker { flex: none; color: var(--muted); font-size: 12px; }
.thread-single-title { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.thread-fallback { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }
@container (max-width: 340px) {
  .thread-strip.has-more { --thread-label-width: 52px; gap: 4px; }
  .thread-strip.has-more .thread-summary-node { padding-right: 1px; padding-left: 1px; }
  .thread-strip.has-more .thread-summary-node:first-child { padding-left: 0; }
  .thread-strip.has-more .thread-summary-node:not(:first-child) .thread-summary-avatar { width: 16px; height: 16px; }
  .thread-strip.has-more .thread-summary-line { width: 6px; }
}

/* 详情沿用 X 的左右两列，头像连线止于最后一条，正文不拆成独立卡片。 */
.thread-overview { padding: 0 16px 16px; }
.thread-kicker { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.thread-overview h1 { margin: 0 0 8px; color: var(--fg); font-size: 20px; font-weight: 650; line-height: 1.4; }
.thread-intro { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.thread-contents { margin-top: 12px; }
.thread-contents summary { display: inline-flex; align-items: center; gap: 6px; color: var(--link); font-size: 12px; cursor: pointer; list-style: none; }
.thread-contents summary::-webkit-details-marker { display: none; }
.thread-contents[open] summary > span { transform: rotate(180deg); }
.thread-contents nav { display: grid; margin-top: 8px; padding: 4px 0; }
.thread-contents nav a { display: flex; gap: 12px; padding: 6px 0; font-size: 13px; }
.thread-contents nav a > span { color: var(--muted); font-size: 11px; line-height: 23px; }
.thread-story { border: 1px solid var(--line); background: var(--surface); }
.thread-post { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; padding: 12px 16px 16px 12px; scroll-margin-top: 12px; }
.thread-post:hover { background: var(--band); }
.thread-post-content { min-width: 0; }
.thread-rail { position: relative; align-self: stretch; }
.thread-rail .avatar { display: block; width: 40px; height: 40px; border-radius: 4px; }
.thread-post:not(:last-child) .thread-rail::after { content: ""; position: absolute; top: 46px; bottom: -22px; left: 19px; width: 2px; background: #cfd9de; }
:root[data-theme="dark"] .thread-rail::after { background: #333639; }
.thread-author { display: flex; align-items: center; gap: 7px; min-height: 20px; white-space: nowrap; }
.thread-author-name { display: inline-flex; align-items: center; flex: none; gap: 4px; font-size: 14px; font-weight: 650; line-height: 20px; }
.thread-author-name .author-badge { margin-left: 0; }
.thread-handle { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 13px; line-height: 20px; }
.thread-source { flex: none; margin-left: auto; color: var(--muted); font-size: 13px; }
.thread-post .translation-meta { margin-top: 0; font-size: 12px; line-height: 19px; }
.thread-post .body { margin: 2px 0 12px; font-size: 15px; line-height: 1.5; }
.thread-post .media { margin: 12px 0; height: auto; max-height: 640px; object-fit: contain; border: 1px solid var(--line); border-radius: 14px; background: var(--band); }
.thread-doc { display: inline-flex; align-items: center; gap: 10px; margin: -4px 0 2px; font-size: 13px; overflow-wrap: anywhere; }
.thread-stats { display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 10px; margin-top: 12px; font-size: 12px; }
.thread-stats .stat { gap: 5px; }
.thread-stats .stat b { color: var(--muted); font-weight: 400; }
.thread-stats .stat svg { width: 16px; height: 16px; }
.thread-actions { padding: 0 16px; }
.thread-partial { margin: 0; padding: 12px 16px; color: var(--muted); font-size: 12px; }
@media (max-width: 480px) {
  .page:has(.thread-story) { width: 100%; margin-top: 10px; }
  .page:has(.thread-story) .site-head { padding: 0 12px; margin-bottom: 16px; }
  .thread-overview { padding: 0 12px 14px; }
  .thread-story { border-right: 0; border-left: 0; }
  .thread-post { gap: 8px; padding: 12px 12px 16px; }
  .thread-author-name { font-size: 13px; }
  .thread-handle { font-size: 12px; }
  .thread-post .body { font-size: 14px; }
  .thread-stats { gap: 5px; font-size: 11px; }
  .thread-stats .stat { gap: 3px; }
  .thread-stats .stat svg { width: 14px; height: 14px; }
}
@media (prefers-reduced-motion: reduce) { .thread-summary-label { transition: none; } }
