/* NovaForge 统一文档选择器（下拉选择 + 文档面板） */
.docsel {
  --ds-border: rgba(28, 25, 23, .12);
  --ds-bg: #fff;
  --ds-soft: #FAF9F5;
  position: relative;
  margin-top: 22px;
}

.docsel-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.docsel-label {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6b6560;
  font-weight: 600;
  min-width: 64px;
}

.docsel-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--ds-border);
  border-radius: 12px;
  background: var(--ds-bg);
  color: #1c1917;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.docsel-trigger:hover { border-color: rgba(217, 119, 87, .55); }
.docsel-trigger:focus-visible {
  outline: none;
  border-color: #D97757;
  box-shadow: 0 0 0 3px rgba(217, 119, 87, .18);
}
.docsel-trigger .ds-ico {
  width: 22px; height: 22px; flex: 0 0 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; background: var(--ds-soft);
  font-size: 12px; font-weight: 700; color: #B85C3E;
}
.docsel-trigger .ds-name { flex: 1 1 auto; text-align: left; }
.docsel-trigger .ds-chev {
  flex: 0 0 auto; color: #8a827c; font-size: 12px;
  transition: transform .18s ease;
}
.docsel[data-open="1"] .docsel-trigger .ds-chev { transform: rotate(180deg); }

.docsel-menu {
  position: absolute;
  z-index: 40;
  left: 76px;
  top: calc(100% - 2px);
  width: min(360px, calc(100vw - 40px));
  max-height: 340px;
  overflow: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--ds-bg);
  border: 1px solid var(--ds-border);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(28, 25, 23, .14);
  display: none;
}
.docsel[data-open="1"] .docsel-menu { display: block; }

.docsel-menu li { margin: 0; }
.docsel-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: #1c1917;
  text-align: left;
  cursor: pointer;
}
.docsel-opt:hover, .docsel-opt:focus-visible {
  background: var(--ds-soft);
  outline: none;
}
.docsel-opt[aria-selected="true"] {
  background: rgba(217, 119, 87, .10);
  color: #B85C3E;
  font-weight: 600;
}
.docsel-opt .ds-ico {
  width: 22px; height: 22px; flex: 0 0 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; background: var(--ds-soft);
  font-size: 12px; font-weight: 700; color: #6b6560;
}
.docsel-opt[aria-selected="true"] .ds-ico { background: #fff; color: #B85C3E; }
.docsel-opt .ds-txt { flex: 1 1 auto; min-width: 0; }
.docsel-opt .ds-sub {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: #8a827c;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docsel-panels { margin-top: 20px; }
.docsel-panel { display: none; }
.docsel-panel[data-active="1"] { display: block; }

.docsel-panel .ds-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.docsel-panel .ds-head h3 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -.01em;
}
.docsel-panel .ds-tag {
  font-size: 12px;
  color: #B85C3E;
  background: rgba(217, 119, 87, .10);
  border-radius: 999px;
  padding: 3px 9px;
  font-weight: 600;
}
.docsel-panel > p:first-of-type { margin-top: 6px; }

@media (max-width: 720px) {
  .docsel-label { width: 100%; }
  .docsel-trigger { min-width: 0; width: 100%; }
  .docsel-menu { left: 0; width: 100%; }
}
/* 初始隐藏，避免 JS 未执行时十份文档全部平铺 */
[data-docsel] [data-docsel-panel] { display: none; }
[data-docsel] [data-docsel-panel][data-active="1"] { display: block; }
