/* ═══════════════════════════════════════════════════════════
   Cases page · 列表 + 详情
   ═══════════════════════════════════════════════════════════ */

/* Layout shell · 左侧功能 + 右侧内容 */
.cases-shell {
  display: flex;
  gap: 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 5rem 2.5rem 4rem 3.5rem;
  min-height: 100vh;
}

/* ===== Left sidebar ===== */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: calc(4.4rem + 2rem);
  height: calc(100vh - 4.4rem - 4rem);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sidebar-title {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
/* Sidebar list scrolls independently when there are too many entries. */
.sidebar-list-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  position: relative;
  /* Bottom padding so the last entry sits clear of the fade mask. */
  padding-bottom: 28px;
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  /* Bottom fade hints there's more below (only visible when content overflows;
     the JS removes the mask when fully scrolled). The fade region is wider so
     the last entry never sits behind the gradient. */
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 64px), transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 64px), transparent 100%);
  transition: mask-image .2s;
}
/* WebKit · thin neutral scrollbar so it doesn't shout. */
.sidebar-list-wrap::-webkit-scrollbar {
  width: 6px;
}
.sidebar-list-wrap::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-list-wrap::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.sidebar-list-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
/* "More below" hint · small chevron pinned to the bottom of the wrap. Hidden
   when the list isn't scrollable or when the user has scrolled to the end. */
.sidebar-list-wrap::after {
  content: '';
  position: sticky;
  display: block;
  height: 14px;
  margin-top: -14px;
  pointer-events: none;
  background:
    linear-gradient(to bottom, transparent, var(--bg)) center/100% 14px no-repeat,
    radial-gradient(circle at center, var(--text-muted) 0 1.4px, transparent 1.6px) center 9px/2px 6px no-repeat;
  opacity: 1;
  transition: opacity .25s;
}
.sidebar-list-wrap.is-at-end::after { opacity: 0; }
.sidebar-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 0;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: .82rem;
  color: var(--text-sub);
  transition: all .2s;
  border: 1px solid transparent;
}
.sidebar-link.active {
  background: var(--white);
  border-color: var(--border);
  color: var(--text);
  font-weight: 600;
}
.sidebar-link:hover {
  background: var(--white);
  color: var(--text);
}
.sidebar-num {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 24px;
}
.sidebar-link-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.sidebar-foot {
  padding-top: 1.2rem;
  margin-top: 1.2rem;
  border-top: 1px solid var(--border);
  font-size: .82rem;
  color: var(--text-sub);
  line-height: 1.7;
  flex-shrink: 0;
  background: var(--bg);
}
.sidebar-foot strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  letter-spacing: .04em;
  margin-bottom: 2px;
}
.sidebar-foot span { color: var(--text-muted); font-size: .75rem; }

/* Newsletter · sits below the FDE description block. */
.sidebar-newsletter {
  margin: 1rem 0 0;
  padding: 0;
  border: 0;
}
.sidebar-newsletter-title {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .02em;
  margin-bottom: .55rem;
}
.sidebar-newsletter-row {
  display: flex;
  gap: .55rem;
  align-items: stretch;
}
.sidebar-newsletter-input {
  flex: 1;
  /* 让输入框可见宽度比按钮大 ~3x,即使 sidebar 很窄也保持这个比例 */
  min-width: 0;
  flex-basis: 70%;
  height: 38px;
  padding: 0 .9rem;
  font-size: .82rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.sidebar-newsletter-input::placeholder { color: var(--text-muted); }
.sidebar-newsletter-input:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(34, 34, 34, .06);
}
.sidebar-newsletter-btn {
  flex-shrink: 0;
  flex-basis: auto;
  height: 38px;
  padding: 0 1rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .02em;
  font-family: inherit;
  color: #fff;
  background: #ec5b1c;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background .18s ease, transform .12s ease;
}
.sidebar-newsletter-btn:hover {
  background: #d54d12;
}
.sidebar-newsletter-btn:active {
  transform: translateY(1px);
}

/* ===== Right content ===== */
.content {
  flex: 1;
  min-width: 0;
}

/* Search bar */
.search-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  transition: all .2s;
  margin-bottom: 1.2rem;
}
.search-bar:focus-within {
  border-color: rgba(0,0,0,.25);
  box-shadow: 0 0 0 3px rgba(0,0,0,.04), var(--shadow);
}
.search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: .92rem;
  color: var(--text);
}
.search-input::placeholder { color: var(--text-muted); }
.search-action {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .18s ease, opacity .18s ease;
}
.search-action:hover {
  transform: translateX(2px);
  opacity: .85;
}
.search-action-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

/* Category tabs · "全部" 单独一列(居中), 其他标签 flex-wrap 单独一列(贴左对齐换行) */
.category-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  column-gap: 12px;
  row-gap: 6px;
  margin-bottom: 1.6rem;
  line-height: 1.2;
}
/* "全部" 按钮: grid col 1, 文字居中 (水平 + 垂直) */
.cat-tab--all {
  grid-column: 1;
  justify-self: start;
  align-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
}
/* 其他标签的 wrapper: grid col 2, 内部用 flex-wrap 多行排版 */
.cat-tabs-wrap {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}
.cat-tab {
  padding: 4px 10px;
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-sub);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 1px;
}
.cat-tab.is-overflow { flex-shrink: 0; }
.cat-tab:hover { background: var(--white); color: var(--text); }
@media (max-width: 600px) {
  .cat-tab { font-size: .72rem; padding: 3px 8px; }
}
.cat-tab.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
  font-weight: 600;
}
.cat-tab-num {
  font-size: .65rem;
  font-weight: 700;
  padding: 0 5px;
  border-radius: 100px;
  background: var(--bg-soft, rgba(0,0,0,.06));
  color: var(--text-muted);
  letter-spacing: .04em;
  line-height: 1.5;
  /* Sit tight against the label text */
  margin-left: 2px;
}
.cat-tab.active .cat-tab-num {
  background: rgba(255,255,255,.18);
  color: var(--bg);
}

/* Section heading */
.section-heading {
  margin: 1rem 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.section-heading h2 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
}
.section-heading .meta {
  font-size: .78rem;
  color: var(--text-muted);
  letter-spacing: .04em;
}

/* Case grid · portfolio projects 同款 */
.case-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
/* scroll-margin so the sticky topbar doesn't cover the top of the card */
.case-card {
  scroll-margin-top: 5.5rem;
  background: var(--white);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
  display: block;
  transition: all .3s;
  position: relative;
  overflow: hidden;
}
.case-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  transform: translateY(-2px);
}
.case-card-inner {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.case-cover {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.case-cover.has-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.45));
  pointer-events: none;
}
.case-cover.has-img .case-cover-inner {
  position: relative;
  z-index: 1;
  margin-top: auto;
  align-self: flex-end;
  padding-bottom: 6px;
}
.case-cover-num {
  font-family: var(--font-body);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.case-cover-label {
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .9;
}
.case-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.case-title {
  word-break: break-word;
}
.case-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.tag {
  font-size: .68rem;
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: .04em;
  font-weight: 500;
  border: 1px solid;
  white-space: nowrap;
  flex-shrink: 0;
}
.tag-ind { background: rgba(107,83,68,.08); color: #6b5344; border-color: rgba(107,83,68,.2); }
.tag-scl { background: rgba(74,111,165,.08); color: #4a6fa5; border-color: rgba(74,111,165,.2); }
.tag-type { background: rgba(46,139,87,.08); color: #2e8b57; border-color: rgba(46,139,87,.2); }

.case-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
  line-height: 1.3;
}
.case-sub {
  font-size: .88rem;
  color: var(--text-sub);
  line-height: 1.5;
}
.case-highlight {
  margin-left: auto;
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent-deep);
  letter-spacing: -.01em;
  padding-left: 1rem;
  max-width: 260px;
  text-align: right;
  line-height: 1.4;
}
.case-card-foot {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: .78rem;
  color: var(--text-muted);
}
.case-card-foot .case-go {
  /* 让箭头垂直贴底部, 跟 intro 文本第二行对齐 */
  align-self: flex-end;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: .8rem;
}
.case-card-foot .case-intro-mini {
  color: var(--text-sub);
  font-size: .82rem;
  line-height: 1.5;
  max-width: 600px;
}

.empty {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--border);
}

/* Brief highlight when the sidebar scrolls the user to a card. */
@keyframes case-flash {
  0%   { box-shadow: var(--shadow); }
  35%  { box-shadow: 0 0 0 3px rgba(191,171,144,.35), var(--shadow); }
  100% { box-shadow: var(--shadow); }
}
.case-card.case-flash {
  animation: case-flash 1.2s ease-out;
}

/* ===== Detail page ===== */
.detail-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 3.5rem 3rem 4rem;
}
/* Small, muted "Back to Cases" link rendered by case-detail.js. */
.detail-shell .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid transparent;
  background: transparent;
  margin-bottom: 1.5rem;
  transition: all .2s;
}
.detail-shell .back-link:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--white);
}
.detail-shell .back-link::before {
  content: '←';
  margin-right: 2px;
  font-size: .85em;
  letter-spacing: 0;
}

.detail-card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.detail-cover {
  width: 100%;
  aspect-ratio: 16/5;
  min-height: 180px;
  display: flex;
  align-items: flex-end;
  padding: 2rem;
  color: #fff;
  position: relative;
  background-size: cover;
  background-position: center;
}
.detail-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.15));
  pointer-events: none;
}
/* When a real cover image is loaded, replace the soft gradient with a
   stronger bottom-up wash so the CASE / industry meta text stays legible. */
.detail-cover.has-img::after {
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.55));
}
.detail-cover-inner {
  position: relative;
  z-index: 1;
}
.detail-cover-meta {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .9;
  margin-bottom: 6px;
}
.detail-cover-name {
  font-size: 1rem;
  opacity: .9;
}

.detail-body { padding: 2.5rem 3rem 3rem; }

.detail-id {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--text-muted);
  margin-bottom: .3rem;
}
.detail-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.03em;
  margin-bottom: .5rem;
  line-height: 1.15;
}
.detail-sub {
  font-size: 1.1rem;
  color: var(--text-sub);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.detail-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.detail-intro {
  font-size: .92rem;
  color: var(--text-sub);
  line-height: 1.7;
  margin-bottom: 6rem;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
}
.detail-intro strong { color: var(--text); font-weight: 600; }

.section-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 3rem;
  margin-bottom: .4rem;
  letter-spacing: .01em;
}
.section-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
}
.section-label-text {
  display: inline-block;
}
/* The first section-label (需求形成) follows the intro callout — give it
   some breathing room even if its preceding sibling has no margin. */
.section-label:first-of-type {
  margin-top: 0;
  padding-top: 2rem;
}
.lb-demand { color: #b8763a; }
.lb-process { color: #3a6fa5; }
.lb-result { color: #2e8b57; }

.detail-body p {
  font-size: .92rem;
  color: var(--text-sub);
  line-height: 1.85;
  margin-bottom: .8rem;
}
.detail-body p strong {
  color: var(--text);
  font-weight: 600;
}

/* Bulleted list inside the detail body — small accent dot, sits in line with
   surrounding paragraphs. Used when a paragraph is list-shaped content. */
.detail-body .content-list {
  list-style: none;
  margin: .8rem 0 1.2rem;
  padding: 0;
}
.detail-body .content-list li {
  position: relative;
  padding-left: 1.3rem;
  font-size: .92rem;
  color: var(--text-sub);
  line-height: 1.55;
  margin-bottom: .25rem;
}
.detail-body .content-list li::before {
  content: '';
  position: absolute;
  left: .3rem;
  top: .78em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.detail-body .content-list li strong {
  color: var(--text);
  font-weight: 600;
}

.compare {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  font-size: .85rem;
  background: var(--white);
}
.compare-hdr {
  display: grid;
  /* 维度列稍宽 · 第3 列(FDE 模式)略缩,容纳长内容不换行 */
  grid-template-columns: 160px 1fr 1.5fr;
  background: var(--text);
  color: var(--bg);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.compare-hdr div { padding: 10px 16px; }
.compare-row {
  display: grid;
  /* 与 .compare-hdr 列宽对齐 */
  grid-template-columns: 160px 1fr 1.5fr;
  border-top: 1px solid var(--border);
}
.compare-row:nth-child(even) { background: rgba(0,0,0,.015); }
.compare-row div { padding: 10px 16px; color: var(--text-sub); }
.compare-row .c-label { font-weight: 600; color: var(--text); }
.compare-row .c-old { color: #a08775; }
.compare-row .c-new { color: #2e8b57; font-weight: 600; }

.case-ref {
  margin-top: 1.5rem;
  font-size: .82rem;
  color: var(--text-sub);
  display: block;
}
.case-ref-heading {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  margin-bottom: .75rem;
  color: var(--text);
  font-size: .95rem;
  font-weight: 600;
}
.case-ref-heading-note {
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 400;
}
.case-ref-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
}
.case-ref a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.case-ref a:hover { color: var(--accent-deep); }

.detail-nav {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.detail-nav-link {
  padding: 1.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all .25s;
}
.detail-nav-link.next { text-align: right; }
.detail-nav-link:hover {
  border-color: rgba(0,0,0,.25);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.detail-nav-tag {
  font-size: .68rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: .5rem;
}
.detail-nav-link h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  letter-spacing: -.01em;
  line-height: 1.3;
}
.detail-nav-link span {
  font-size: .82rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1024px) {
  .cases-shell {
    flex-direction: column;
    gap: 2rem;
    padding: 3rem 1.5rem;
  }
  .sidebar {
    width: 100%;
    position: static;
  }
  /* 保留 flex row: cover(左) + main(中) + highlight(右上), 限宽让 highlight 折行 */
  .case-card-inner { gap: 1rem; }
  .case-cover { width: 72px; height: 72px; }
  /* highlight 限宽让它折行, 不再无限制撑开挤压主区 */
  .case-highlight {
    max-width: 220px;
    text-align: right;
    padding-left: 0;
  }
  .compare-hdr, .compare-row { grid-template-columns: 100px 1fr 1fr; font-size: .8rem; }
  .compare-hdr div, .compare-row div { padding: 8px 12px; }
  .detail-shell { padding: 3rem 1.5rem; }
  .detail-body { padding: 2rem 1.5rem 2.5rem; }
}
@media (max-width: 640px) {
  .detail-nav { grid-template-columns: 1fr; }
  .compare-hdr, .compare-row { grid-template-columns: 90px 1fr 1fr; font-size: .75rem; }
  .compare-hdr div, .compare-row div { padding: 8px 10px; }
  /* 小屏: 卡片更紧凑, 缩略图缩小, View case 文字隐藏只留箭头, 结论文本也隐藏 */
  .case-card { padding: 1.2rem; }
  .case-cover { width: 56px; height: 56px; }
  .case-cover-inner { font-size: .65rem; }
  .case-cover-num { font-size: .8rem; }
  .case-title { font-size: .92rem; }
  .case-sub { font-size: .8rem; }
  .case-go-text { display: none; }
  /* 小屏: 隐藏结论文本 highlight, 让标题/副标题拿满宽度 */
  .case-highlight { display: none; }
}

/* === 案例详情 · 原文参考折叠块 ===
 * 三段结构:图标行(icon + links) → 折叠块(原文 + 来源)
 * 整体左对齐到图标位置,折叠块独立模块化 */
.case-ref-icon-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-top: .25rem;
}
.case-ref-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 1.1rem;
}
.case-ref-link {
  font-size: .82rem;
  color: var(--text-muted, #6e6b66);
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, .18);
  text-underline-offset: 2px;
}
.case-ref-link:hover {
  color: var(--text, #3a3a36);
  text-decoration-color: currentColor;
}
.ref-detail {
  display: block;
  /* 顶部留白让它跟图标行有呼吸感 */
  margin-top: 1.4rem;
  margin-left: 0;
  max-width: 760px;
  background: rgba(0, 0, 0, 0.012);
  border: 1px solid var(--border, #e6e3da);
  border-radius: 6px;
  overflow: hidden;
}
.ref-detail > summary {
  list-style: none;
  cursor: pointer;
  padding: .65rem 1rem;
  display: flex;
  align-items: center;
  gap: .8rem;
  font-size: .78rem;
  color: #888;
  transition: background .15s, color .15s;
  user-select: none;
}
.ref-detail > summary::-webkit-details-marker { display: none; }
.ref-detail > summary:hover {
  background: rgba(0, 0, 0, 0.025);
  color: var(--text, #3a3a36);
}
.ref-detail[open] > summary {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text, #3a3a36);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.ref-detail .ref-summary-meta {
  flex: 1;
  font-size: .72rem;
  color: #b8b3a8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
}
.ref-chevron {
  width: 12px;
  height: 12px;
  color: currentColor;
  opacity: .55;
  flex-shrink: 0;
  transition: transform .2s;
}
.ref-detail[open] > summary .ref-chevron {
  transform: rotate(180deg);
  opacity: .85;
}
.ref-body {
  padding: 1rem 1.2rem 1.1rem;
}
/* 用 .ref-detail .ref-excerpt 双 class 提高特异性,
 * 避免被 .detail-body p { color: var(--text-sub) } 覆盖 */
.ref-detail .ref-excerpt {
  margin: 0 0 .7rem;
  font-size: .76rem;
  line-height: 1.75;
  color: #9a958a;
}
.ref-detail .ref-excerpt:last-of-type {
  margin-bottom: .85rem;
}
.ref-detail .ref-excerpt.placeholder {
  color: #8f887c;
  font-size: .72rem;
  margin-bottom: .85rem;
}
.ref-empty {
  padding: .8rem 1rem;
  border: 1px dashed var(--border, #e6e3da);
  border-radius: 6px;
}
.case-ref-no-link {
  color: var(--text-muted);
  font-size: .78rem;
}
.ref-detail .ref-source {
  display: inline-block;
  font-size: .72rem;
  color: #5ba882;
  text-decoration: none;
  letter-spacing: .02em;
  padding-top: .4rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
  width: 100%;
}
.ref-detail .ref-source:hover {
  text-decoration: underline;
}
