body { background: #fff; }
.company-detail-container { padding: 48px 0 24px; }
.header-with-logo { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }

.header-with-logo h1 { margin: 0; color: #1f2937; }
.section h2 { border-bottom-color: #0f766e; }

@media (max-width: 640px) {
  .company-detail-container { padding-top: 32px; }
}

/* 公司信息卡片 */
.basic-info { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.info-item { margin: 0; }
.info-item p { margin: 0; line-height: 1.8; }
.info-item.full-width { grid-column: 1 / -1; }
.info-label { color: #868d9a; font-weight: 500; }
.info-value { color: #111827; }
a.info-value { text-decoration: none; }
a.info-value:hover { text-decoration: underline; }
a.info-value.info-map { white-space: nowrap; color: #6b7280; }
.ecommerce:not(:last-child)::after { content: ", "; }

/* 社交媒体图标样式 */
.social { display: inline-block; margin: 0 4px; }
.social a.info-value { color: #6b7280; transition: all 0.3s ease; display: inline-flex; align-items: center; justify-content: center; }
.social a.info-value:hover { text-decoration: none; transform: scale(1.3); }
.social a.info-value i { font-size: 20px; }

/* 各社交媒体悬停颜色 */
.social a.info-value:hover .fa-facebook { color: #1877f2; }
.social a.info-value:hover .fa-linkedin { color: #0a66c2; }
.social a.info-value:hover .fa-x-twitter { color: #000000; }
.social a.info-value:hover .fa-youtube { color: #ff0000; }
.social a.info-value:hover .fa-tiktok { color: #000000; }
.social a.info-value:hover .fa-instagram { color: #e4405f; }
.social a.info-value:hover .fa-pinterest { color: #e60023; }

.review { background: #f9fafb; border-radius: 8px; padding: 24px; border-left: 4px solid #0f766e; }
.review-title { color: #0f766e; display: block; }
.review-title i { margin-right: 6px; }
.review p { line-height: 2; margin-top: 12px; margin-bottom: 0;}

/* Tree View 样式 */

.tree { margin: 0; padding: 0; list-style: none; }
.tree ul { margin: 0; padding: 0 0 0 24px; list-style: none; }
.tree li { position: relative; padding: 0 0 0 24px; }

/* 垂直线 - 连接兄弟节点 */
.tree li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #d1d5db;
}

/* 最后一个子节点：垂直线只到 div.tree-node 的中心 */
.tree li:last-child::before {
  bottom: auto;
  height: var(--line-height, 40px);
}

/* 根节点不需要连接线 */
.tree > li::before {
  display: none;
}
.tree > li { padding-left: 0; }
.tree > li > .tree-node::before { display: none; }

/* 节点样式 - div.tree-node */
.tree-node {
  display: inline-flex;
  align-items: stretch;
  margin-top: 16px;
  padding: 0;
  background: #f3f4f6;
  border: 1px solid #f3f4f6;
  border-radius: 6px;
  font-size: 14px;
  color: #374151;
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
  box-sizing: border-box;
  max-width: min(800px, calc(100vw - 32px));
}

/* 文字区域 */
.tree-node-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 12px;
}

.tree-node-name {
  font-weight: 500;
  color: #374151;
  font-size: 14px;
  margin: 0;
  line-height: 1.6;
  text-decoration: none;
  display: -webkit-box;
  line-clamp: 1;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tree-node-name a {
  text-decoration: none;
  color: inherit;
}

/* summary：最多两行 */
.tree-node-summary {
  margin: 4px 0 0;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.4;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 有 summary 时固定高度，确保 case2 和 case3 高度一致 */
.tree-node.has-summary {
  min-height: 68px;
}

/* 缩略图区域 */
.tree-node-thumb {
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  align-items: stretch;
}

.tree-node-thumb img {
  width: 90px;
  height: 90px;
  display: block;
  object-fit: cover;
  border-radius: 0 6px 6px 0;
}

/* 水平线 - 在 div.tree-node 上，自动垂直居中 */
.tree-node::before {
  content: "";
  position: absolute;
  right: calc(100% + 1px);
  top: 50%;
  width: 24px;
  height: 1px;
  background: #d1d5db;
}

@media (hover: hover) {
  .tree-node:hover {
    background: rgba(15, 118, 110, 0.12);
  }

  .tree-node.is-catalog-series:hover {
    background: #fff;
  }
}

.tree-node.is-catalog-series {
  background: #fff;
  border: 1px solid #111827;
}

/* 根节点第一个元素取消上边距 */
.tree > li:first-child > .tree-node {
  margin-top: 0;
}

/* catalog series 锁点定位时预留上方间距 */
.tree .is-catalog-series { scroll-margin-top: 16px; }

/* 空状态 */
.empty-state { text-align: center; padding: 48px 24px; color: #6b7280; }
.empty-state i { font-size: 48px; color: #d1d5db; margin-bottom: 16px; display: block; }

/* 图片轮播: company-detail 特有的 grid-column 覆盖 */
.image-carousel { grid-column: 1 / -1; margin: 8px 0; }

@media (max-width: 768px) {
  .basic-info { padding: 16px; }
}

@media (max-width: 480px) {
  .basic-info { padding: 10px; grid-template-columns: 1fr; }
  .tree ul { padding-left: 12px; }
  .tree li { padding-left: 12px; }
  .tree > li { padding-left: 0; }
  .tree-node::before { width: 12px; }
}

/* ── Series layout + TOC ──────────────────────────────────────────────────── */
.series-layout {
  display: flex;
  align-items: flex-start;
  gap: 40px;
}
.series-main { flex: none; min-width: 0; order: 1; }

/* 桌面端：右侧悬浮目录 */
.series-toc {
  width: max-content;
  min-width: 180px;
  max-width: 260px;
  flex-shrink: 0;
  order: 2;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.series-toc:empty { display: none; }

/* 目录内容（JS 填充后可见） */
.toc-header { display: none; }   /* 桌面隐藏 header */
.toc-list { margin: 0; padding: 0; list-style: none; }
.toc-item a {
  display: block;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #9ca3af;
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  line-height: 1.4;
  transition: color 0.15s, border-left-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.toc-item a:active { color: inherit; }
.toc-item a:hover { color: #374151; }
.toc-item.is-active > a,
.toc-item.is-active > .toc-item-header > a {
  color: #0f766e;
  border-left-color: #0f766e;
}
.toc-item.is-ancestor > a,
.toc-item.is-ancestor > .toc-item-header > a {
  color: #5eab9e;
  border-left-color: transparent;
}

/* 手风琴 + 多级层次 */
.toc-sub {
  margin: 0; padding: 0; list-style: none;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}
.toc-item.is-open > .toc-sub { max-height: 600px; }
.toc-item-header { display: flex; align-items: center; }
.toc-item-header > a { flex: 1; min-width: 0; }
.toc-acc-toggle {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 4px 8px 4px 4px;
  cursor: pointer;
  color: #c4c4c4;
  font-size: 10px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.toc-acc-toggle:focus-visible { outline: none; }
.toc-acc-toggle:active { color: #c4c4c4; }
.toc-acc-toggle i { display: inline-block; transition: transform 0.2s; }
.toc-item.is-open > .toc-item-header .toc-acc-toggle i { transform: rotate(90deg); }
/* 层级缩进 */
.toc-item[data-level="1"] > a,
.toc-item[data-level="1"] > .toc-item-header > a { padding-left: 24px; }
.toc-item[data-level="2"] > a,
.toc-item[data-level="2"] > .toc-item-header > a { padding-left: 36px; }

/* 空间不够时：顶部 sticky 折叠条（由 ResizeObserver 动态切换） */
.series-layout.is-compact { display: block; }
.section.is-compact > h2 { margin-bottom: 0; }
.series-layout.is-compact .series-toc {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  min-width: 0;
  max-width: none;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 16px;
  max-height: none;
  overflow: visible;
}
.series-layout.is-compact .toc-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 0;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.series-layout.is-compact .toc-label {
  font-size: 11px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.series-layout.is-compact .toc-sep { font-size: 11px; color: #d1d5db; flex-shrink: 0; }
.series-layout.is-compact .toc-current-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: #0f766e;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}
.series-layout.is-compact .toc-toggle {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  color: #9ca3af;
  font-size: 11px;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.series-layout.is-compact .toc-toggle:active { color: #9ca3af; }
.series-layout.is-compact .toc-toggle i { display: inline-block; transition: transform 0.2s; }
.series-layout.is-compact .series-toc.is-open .toc-toggle i { transform: rotate(180deg); }
.series-layout.is-compact .toc-list {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 6px 12px rgba(0,0,0,0.06);
  padding: 4px 0 8px;
  max-height: 60vh;
  overflow-y: auto;
}
.series-layout.is-compact .series-toc.is-open .toc-list { display: block; }
.series-layout.is-compact .toc-item a {
  font-size: 13px;
  padding: 6px 4px;
  border-left: none;
  border-radius: 4px;
}
.series-layout.is-compact .toc-item.is-active > a,
.series-layout.is-compact .toc-item.is-active > .toc-item-header > a { color: #0f766e; background: #f0fdf9; }
.series-layout.is-compact .toc-item.is-ancestor > a,
.series-layout.is-compact .toc-item.is-ancestor > .toc-item-header > a { color: #5eab9e; background: #f7fffe; }
.series-layout.is-compact .toc-item[data-level="1"] > a,
.series-layout.is-compact .toc-item[data-level="1"] > .toc-item-header > a { padding-left: 20px; }
.series-layout.is-compact .toc-item[data-level="2"] > a,
.series-layout.is-compact .toc-item[data-level="2"] > .toc-item-header > a { padding-left: 32px; }
