/* ═══════════════════════════════════════════════════════════
   DIXI 对商协通前端的定制（不动原文件，升级时这份会保留）
   ═══════════════════════════════════════════════════════════ */

/* ── ① 企业家会客厅取消，合并进先锋者 ──
   导航和地图页都不再显示「企业家AI会客厅」入口。
   数据已合并：仇瑞锋、苏王钗 现在是 pioneer。 */
.sidebar nav a[href="#lounge"] {
  display: none !important;
}
.feature-entry-grid a[href="#lounge"] {
  display: none !important;
}

/* ── ② 先锋者从「中国 3D 地图」页取消，只保留底部/侧栏跳转 ── */
.feature-entry-grid a[href="#pioneers"] {
  display: none !important;
}

/* ── ③ 手机底部栏：把「先锋者」放出来 ──
   原版 showcase.css 里有一条：
     @media(max-width:580px){.sidebar nav a.desktop-nav-only{display:none}}
   意思是不让会客厅入口占底部栏。DIXI 要「先锋者」常驻，单独放开它。 */
@media (max-width: 580px) {
  .sidebar nav a.desktop-nav-only[data-view="pioneers"] {
    display: flex;
  }

  /* 底部栏从 4 项变 5 项，缩一下内边距让它们排得开 */
  .sidebar nav {
    justify-content: space-between;
  }
  .sidebar nav a {
    min-width: 0;
    flex: 1 1 0;
    padding: 5px 4px;
    font-size: 9px;
  }
  .sidebar nav a > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
}

/* ── ④ 中国地图页的功能入口网格：少了 2 块后重排 ──
   原来 5 块（省级/先锋者/企业家/城市/机构），
   现在只剩 3 块（省级/城市/机构），让它们铺满一行。 */
.feature-entry-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}


/* ═══════════════════════════════════════════════════════════
   先锋者 · 一人一卡
   ═══════════════════════════════════════════════════════════ */

.pc-list { display: grid; gap: 16px; }

.pc-card {
  background: #fff;
  border: 1px solid var(--line, #e8ebe2);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(40, 55, 30, .03);
  transition: border-color .16s, box-shadow .16s;
}
.pc-card:hover { border-color: #dbe4d1; box-shadow: 0 4px 14px rgba(40, 55, 30, .06); }

/* ── 卡头（可点，收起/展开）── */
.pc-head {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 18px 20px;
  border: none; background: none; text-align: left; cursor: pointer;
  font: inherit;
}
.pc-head:hover { background: #fafcf7; }

.pc-mark {
  flex: 0 0 auto;
  width: 56px; height: 56px;
  border-radius: 13px;
  background: linear-gradient(160deg, #f2f5ec 0%, #e7ede0 100%);
  border: 1px solid #dfe6d4;
  display: grid; place-items: center;
  font-size: 23px; font-weight: 600; color: #5c7447;
  font-family: 'Songti SC', 'STSong', serif;
}

.pc-id { flex: 1 1 auto; min-width: 0; display: grid; gap: 3px; }
.pc-name {
  font-size: 19px; font-weight: 600; color: var(--ink, #292b27);
  letter-spacing: .5px; line-height: 1.3;
}
.pc-role { font-size: 12px; color: #5f6d52; line-height: 1.5; }
.pc-org { font-size: 10.5px; color: #9aa88c; line-height: 1.5; }

.pc-badge {
  flex: 0 0 auto;
  font-size: 10px; color: #7c8f68;
  background: #f3f6ee; border: 1px solid #e6ecdd;
  border-radius: 999px; padding: 3px 10px;
  white-space: nowrap;
}

.pc-toggle {
  flex: 0 0 auto; width: 28px; height: 28px;
  display: grid; place-items: center;
  color: #a3b197;
  transition: transform .2s;
}
.pc-card.is-open .pc-toggle { transform: rotate(180deg); }

/* ── 卡身 ── */
.pc-body {
  display: none;
  padding: 0 20px 22px;
  border-top: 1px solid #f2f4ee;
  padding-top: 16px;
}
.pc-card.is-open .pc-body { display: block; }

.pc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-tags span {
  font-size: 10px; padding: 3px 9px; border-radius: 4px;
  background: #f3f6ee; color: #7c8f68; border: 1px solid #e9eee1;
}

.pc-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 2px; margin-top: 16px;
  background: #fafbf7; border: 1px solid #eff2ea; border-radius: 12px;
  overflow: hidden;
}
.pc-stat {
  display: grid; gap: 3px; padding: 13px 12px; text-align: center;
  border-right: 1px solid #eff2ea;
}
.pc-stat:last-child { border-right: 0; }
.pc-stat strong {
  font-size: 20px; font-weight: 600; color: #5c7447;
  line-height: 1.2; font-variant-numeric: tabular-nums;
}
.pc-stat span { font-size: 9.5px; color: #9aa88c; }

.pc-summary {
  margin: 16px 0 0;
  font-size: 13px; line-height: 1.95; color: #4a5444;
  padding-left: 13px; border-left: 3px solid #d6e0c8;
}

.pc-boards {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  margin-top: 16px; padding: 10px 14px;
  background: #f7f9f2; border-radius: 10px; border: 1px dashed #dde6d0;
}
.pc-boards-label { font-size: 10px; color: #96a08a; margin-right: 3px; }
.pc-boards b {
  font-size: 10.5px; font-weight: 500; color: #63764d;
  padding: 3px 9px; background: #fff;
  border: 1px solid #e2e9d6; border-radius: 999px;
}

.pc-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px 28px; margin-top: 20px;
  padding-top: 18px; border-top: 1px solid #f0f2ec;
}
.pc-section h4 {
  margin: 0 0 7px;
  font-size: 12px; font-weight: 600; color: #5c7447; letter-spacing: .5px;
  display: flex; align-items: center; gap: 7px;
}
.pc-section h4::before {
  content: ''; width: 3px; height: 12px; border-radius: 2px; background: #b8cca0;
}
.pc-section p { margin: 0; font-size: 12px; line-height: 1.9; color: #5a6551; }

/* 专栏 */
.pc-column { margin-top: 22px; padding-top: 18px; border-top: 1px solid #f0f2ec; }
.pc-column-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; margin-bottom: 14px;
}
.pc-eyebrow { display: block; font-size: 9px; letter-spacing: 2.2px; color: #9aa88c; margin-bottom: 6px; }
.pc-column-head h3 {
  margin: 0 0 5px; font-size: 16px; font-weight: 600;
  color: var(--ink, #292b27); line-height: 1.5;
}
.pc-column-head p { margin: 0; font-size: 11px; color: #96a08a; line-height: 1.7; }
.pc-count {
  flex: 0 0 auto; font-size: 10px; color: #7c8f68;
  background: #f3f6ee; border: 1px solid #e6ecdd;
  border-radius: 999px; padding: 3px 11px;
}
.pc-article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 7px; margin: 0; padding: 0; list-style: none;
  counter-reset: pc-art;
}
.pc-article-grid li {
  counter-increment: pc-art;
  position: relative; padding: 10px 11px 10px 40px;
  border: 1px solid #eef1e8; border-radius: 9px; background: #fcfdf9;
  transition: border-color .16s, background .16s;
}
.pc-article-grid li:hover { border-color: #d3e0c2; background: #f8fbf3; }
.pc-article-grid li::before {
  content: counter(pc-art, decimal-leading-zero);
  position: absolute; left: 11px; top: 10px;
  font-size: 10px; color: #b3c19f;
  font-variant-numeric: tabular-nums; letter-spacing: .5px;
}
.pc-article-grid h4 {
  margin: 0; font-size: 12px; font-weight: 500; line-height: 1.6; color: #4a5444;
}

/* ── 手机 ── */
@media (max-width: 720px) {
  .pc-head { padding: 15px 16px; gap: 11px; }
  .pc-mark { width: 46px; height: 46px; border-radius: 11px; font-size: 19px; }
  .pc-name { font-size: 17px; }
  .pc-role { font-size: 11px; }
  .pc-body { padding: 0 16px 18px; padding-top: 14px; }
  .pc-badge { display: none; }
  .pc-stats { grid-template-columns: 1fr 1fr; }
  .pc-stat:nth-last-child(-n+2) { border-bottom: 0; }
  .pc-stat strong { font-size: 17px; }
  .pc-sections { grid-template-columns: 1fr; gap: 16px; }
  .pc-article-grid { grid-template-columns: 1fr; }
  .pc-column-head { flex-direction: column; gap: 7px; }
  .pc-summary { font-size: 12.5px; }
}

/* ═══════════════════════════════════════════════════════════
   防横向溢出（手机 390 宽时右侧被裁、底部「会员」被挤出屏）
   ═══════════════════════════════════════════════════════════ */
html, body { max-width: 100%; overflow-x: hidden; }
.workspace, main { max-width: 100%; min-width: 0; box-sizing: border-box; }

.pc-card, .pc-list, .pc-body, .pc-sections, .pc-column,
.pc-article-grid, .pc-stats, .pc-boards {
  min-width: 0; max-width: 100%; box-sizing: border-box;
}
.pc-head { min-width: 0; }
.pc-id { min-width: 0; }
.pc-summary, .pc-section p, .pc-article-grid h4, .pc-org,
.pc-column-head h3, .pc-column-head p { overflow-wrap: anywhere; word-break: break-word; }
.pc-tags { min-width: 0; }
.pc-tags span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 底部栏 5 项（全球/中国/名录/先锋者/会员）必须排得开 */
@media (max-width: 580px) {
  .sidebar { box-sizing: border-box; }
  .sidebar nav {
    justify-content: space-between;
    gap: 0;
    width: 100%;
    min-width: 0;
  }
  .sidebar nav a {
    min-width: 0 !important;
    flex: 1 1 0 !important;
    padding: 5px 2px !important;
    font-size: 9px !important;
    box-sizing: border-box;
  }
  .sidebar nav a > span {
    font-size: 9px;
    line-height: 1.3;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sidebar nav svg { width: 18px; height: 18px; }
}

/* ═══════════════════════════════════════════════════════════
   DIXI 的 AI 助理（右下角浮球）
   ═══════════════════════════════════════════════════════════ */

.sxt-ai { position: fixed; right: 22px; bottom: 22px; z-index: 900; }

/* 浮球 */
.sxt-ai-fab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px 12px 14px;
  border: none; border-radius: 999px;
  background: #0d7f79; color: #fff;
  font-size: 13px; font-weight: 600; letter-spacing: .3px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(13, 127, 121, .30), 0 2px 6px rgba(13, 127, 121, .18);
  transition: transform .16s, box-shadow .16s, background .16s;
}
.sxt-ai-fab:hover {
  transform: translateY(-2px);
  background: #0a6d68;
  box-shadow: 0 12px 28px rgba(13, 127, 121, .34);
}
.sxt-ai-fab-icon { display: grid; place-items: center; }
.sxt-ai.is-open .sxt-ai-fab { display: none; }

/* 面板 */
.sxt-ai-panel {
  position: absolute; right: 0; bottom: 0;
  width: 372px; max-width: calc(100vw - 32px);
  height: 540px; max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid #e4e9e2;
  border-radius: 16px;
  box-shadow: 0 20px 48px rgba(30, 48, 44, .18), 0 2px 8px rgba(30, 48, 44, .06);
  overflow: hidden;
}
.sxt-ai-panel[hidden] { display: none; }

.sxt-ai-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px;
  background: linear-gradient(135deg, #0d7f79 0%, #0f8f88 100%);
  color: #fff;
}
.sxt-ai-head strong { display: block; font-size: 14px; letter-spacing: .3px; }
.sxt-ai-head small { display: block; font-size: 10px; opacity: .78; margin-top: 2px; }
.sxt-ai-close {
  flex: 0 0 auto; width: 28px; height: 28px;
  border: none; border-radius: 8px;
  background: rgba(255, 255, 255, .16); color: #fff;
  font-size: 18px; line-height: 1; cursor: pointer;
}
.sxt-ai-close:hover { background: rgba(255, 255, 255, .28); }

.sxt-ai-body { flex: 1 1 auto; overflow-y: auto; padding: 14px; background: #fafcfa; }
.sxt-ai-list { display: grid; gap: 10px; align-content: start; }

.sxt-ai-msg { display: flex; }
.sxt-ai-msg.user { justify-content: flex-end; }
.sxt-ai-bubble {
  max-width: 84%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 12.5px; line-height: 1.8;
  background: #f1f6f1; color: #3d4f42;
  border: 1px solid #e6eee4;
  word-break: break-word;
}
.sxt-ai-msg.user .sxt-ai-bubble {
  background: #0d7f79; color: #fff; border-color: #0d7f79;
  border-bottom-right-radius: 4px;
}
.sxt-ai-msg.bot .sxt-ai-bubble { border-bottom-left-radius: 4px; }
.sxt-ai-bubble.muted { color: #9bab9c; }

.sxt-ai-input {
  display: flex; gap: 8px; padding: 10px 12px 12px;
  border-top: 1px solid #eef2ec; background: #fff;
}
.sxt-ai-input input {
  flex: 1 1 auto; min-width: 0;
  padding: 10px 13px;
  border: 1px solid #dfe7db; border-radius: 10px;
  font-size: 12.5px; background: #fbfdfa;
}
.sxt-ai-input input:focus { outline: 2px solid #cfe3d3; outline-offset: -1px; }
.sxt-ai-input button {
  flex: 0 0 auto; width: 40px; height: 40px;
  border: none; border-radius: 10px;
  background: #0d7f79; color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.sxt-ai-input button:disabled { opacity: .45; cursor: not-allowed; }

/* 手机 */
@media (max-width: 580px) {
  .sxt-ai { right: 14px; bottom: calc(69px + 14px); }
  .sxt-ai-fab { padding: 11px 15px 11px 12px; font-size: 12px; }
  .sxt-ai-panel {
    position: fixed; inset: auto 0 0 0;
    width: 100%; max-width: 100%;
    height: 76vh; max-height: 76vh;
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
  }
}

/* ═══════════════════════════════════════════════════════════
   地图里「进入浏览」的按钮要醒目
   老板：地图里面，进入浏览的标签要明显一点
   ⚠️ #map 用的是 map3d.js/map3d.css，类名是 sxt-map-*（不是 local-map 的 slm-*）
   ═══════════════════════════════════════════════════════════ */

/* ① 「浏览XX名录 →」：原来是顶边一条线的透明文字链接，改成实心亮按钮 */
.sxt-map-browse {
  margin-top: 12px !important;
  padding: 12px 14px !important;
  border: 0 !important;
  border-radius: 9px !important;
  background: linear-gradient(135deg, #35e6ae 0%, #14c894 100%) !important;
  color: #04241d !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  letter-spacing: .3px !important;
  box-shadow: 0 4px 18px rgba(53, 230, 174, .38) !important;
  transition: transform .16s, box-shadow .16s, filter .16s !important;
}
.sxt-map-browse:hover {
  transform: translateY(-1px) !important;
  filter: brightness(1.06) !important;
  box-shadow: 0 8px 26px rgba(53, 230, 174, .55) !important;
  color: #04241d !important;
}
.sxt-map-browse:active { transform: translateY(0) !important; }
.sxt-map-browse svg { width: 16px !important; }

/* ② 底部地区芯片：未选中的提亮，选中的用亮绿描边 */
.sxt-map-region-nav > button {
  border-color: #35635c !important;
  color: #a6d2c2 !important;
  background: #0e2b34 !important;
  transition: background .16s, border-color .16s, color .16s, box-shadow .16s !important;
}
.sxt-map-region-nav > button span { color: #6fa596 !important; }
.sxt-map-region-nav > button:hover {
  background: #1a4f46 !important;
  color: #e8fff4 !important;
  border-color: #57c9a2 !important;
}
.sxt-map-region-nav > button:hover span { color: #9de0c4 !important; }
.sxt-map-region-nav > button[aria-pressed="true"],
.sxt-map-region-nav > button.is-active {
  background: #1f6355 !important;
  color: #f0fff8 !important;
  border-color: #4fe0b0 !important;
  box-shadow: 0 0 0 1px rgba(79, 224, 176, .45), 0 2px 12px rgba(79, 224, 176, .22) !important;
}
.sxt-map-region-nav > button[aria-pressed="true"] span,
.sxt-map-region-nav > button.is-active span { color: #b6f2d8 !important; }

/* ③ 选中的地区标题后面加个箭头，暗示可点 */
.sxt-map-region-title::after {
  content: ' →';
  font-size: .62em;
  color: #6fd3b0;
  opacity: .9;
}

/* ④ 右上「直接浏览名录」按钮加一点光 */
#content .primary-button {
  box-shadow: 0 4px 16px rgba(8, 127, 114, .28);
  transition: transform .16s, box-shadow .16s;
}
#content .primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(8, 127, 114, .38);
}

/* ⑤ 同一套逻辑也给 local-map（手机上可能走这条）*/
.slm-selection > button[data-slm-browse] {
  margin-top: 12px !important;
  padding: 12px 14px !important;
  border: 0 !important;
  border-radius: 9px !important;
  background: linear-gradient(135deg, #35e6ae 0%, #14c894 100%) !important;
  color: #04241d !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 18px rgba(53, 230, 174, .38) !important;
}
.slm-selection > button[data-slm-browse]:hover {
  filter: brightness(1.06) !important;
  color: #04241d !important;
}
