/* ADG Help Document overlay — PC only, scoped styles */
#help-docs-ui {
  --help-bg: #050608;
  --help-bg-panel: #0B0F14;
  --help-surface: #11161D;
  --help-accent: #FF6A45;
  --help-text: #F2F4F7;
  --help-text-secondary: rgba(242, 244, 247, 0.62);
  --help-text-muted: rgba(242, 244, 247, 0.38);
  --help-border: rgba(255, 255, 255, 0.08);
  --help-nav-height: 56px;
  --help-toc-width: 180px;
  --help-banner-pad-right: 16px;

  display: none;
  position: fixed;
  inset: 0;
  z-index: 200000;
  flex-direction: column;
  background: var(--help-bg);
  color: var(--help-text);
  font-family: "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
  pointer-events: auto;
}

#help-docs-ui.show {
  display: flex;
}

/* F1 仅播片：不显示 Document 正文，只留播放窗 / toast */
#help-docs-ui.video-only {
  background: transparent;
}

#help-docs-ui.video-only .help-docs-banner,
#help-docs-ui.video-only .help-docs-body {
  display: none;
}

/* 覆盖 viewer.css 全局 button { width:100%; … } */
#help-docs-ui button {
  width: auto;
  margin-top: 0;
  font-weight: 500;
  box-shadow: none;
}

.help-docs-banner {
  flex: 0 0 var(--help-nav-height);
  height: var(--help-nav-height);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 var(--help-banner-pad-right) 0 20px;
  background: #050608;
  border-bottom: 1px solid var(--help-border);
  box-sizing: border-box;
}

.help-docs-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
  user-select: none;
}

.help-docs-logo img {
  height: 32px;
  width: auto;
  display: block;
}

.help-docs-logo-text {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.help-docs-logo-adg {
  color: var(--help-accent);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.help-docs-logo-space {
  color: var(--help-text);
  margin-left: 0.2em;
}

.help-docs-search-wrap {
  flex: 1 1 auto;
  max-width: 360px;
  min-width: 140px;
  margin-left: 8px;
}

#help-docs-search {
  width: 100%;
  box-sizing: border-box;
  height: 34px;
  padding: 0 12px 0 34px;
  border-radius: 8px;
  border: 1px solid var(--help-border);
  background: rgba(255, 255, 255, 0.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='rgba(242,244,247,0.45)' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3-3' stroke-linecap='round'/%3E%3C/svg%3E") 10px center no-repeat;
  color: var(--help-text);
  font-size: 13px;
  outline: none;
}

#help-docs-search::placeholder {
  color: var(--help-text-muted);
}

#help-docs-search:focus {
  border-color: rgba(255, 106, 69, 0.45);
}

.help-docs-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  /* 右缘对齐「本页目录」左侧竖线，整组落在竖线左手边 */
  margin-right: calc(var(--help-toc-width) - var(--help-banner-pad-right));
  flex-shrink: 0;
}

.help-docs-tab {
  background: transparent;
  border: none;
  color: var(--help-text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  width: auto;
  margin: 0;
}

.help-docs-tab:hover:not(:disabled):not(.is-disabled) {
  color: var(--help-text);
  background: rgba(255, 255, 255, 0.06);
}

.help-docs-tab.active {
  color: var(--help-accent);
}

.help-docs-tab.is-disabled,
.help-docs-tab:disabled {
  color: var(--help-text-muted);
  cursor: not-allowed;
  opacity: 0.7;
}

/* 提高优先级，避免被 #help-docs-ui button { width:auto } 压成竖条 */
#help-docs-ui #help-docs-close {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  aspect-ratio: 1;
  box-sizing: border-box;
  margin: 0 0 0 8px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--help-text-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#help-docs-ui #help-docs-close:hover {
  color: var(--help-text);
  background: rgba(255, 255, 255, 0.08);
}

.help-docs-body {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) var(--help-toc-width);
  min-height: 0;
  overflow: hidden;
}

.help-docs-nav,
.help-docs-toc {
  background: var(--help-bg-panel);
  border-right: 1px solid var(--help-border);
  overflow-y: auto;
  padding: 20px 14px;
  box-sizing: border-box;
}

.help-docs-toc {
  border-right: none;
  border-left: 1px solid var(--help-border);
}

.help-docs-nav-version {
  margin: 0 0 14px 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--help-text-secondary);
}

.help-docs-nav-group {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--help-accent);
  margin: 16px 0 10px 8px;
}

.help-docs-nav-version + .help-docs-nav-group {
  margin-top: 0;
}

.help-docs-nav-group:first-child {
  margin-top: 0;
}

.help-docs-nav-group.is-hidden {
  display: none;
}

.help-docs-nav-item {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0 0 4px;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--help-text-secondary);
  font-size: 13px;
  cursor: pointer;
}

.help-docs-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--help-text);
}

.help-docs-nav-item.active {
  background: rgba(255, 106, 69, 0.12);
  color: var(--help-accent);
}

.help-docs-nav-item.is-hidden {
  display: none;
}

.help-docs-main {
  overflow-y: auto;
  padding: 28px 36px 48px;
  box-sizing: border-box;
  background: var(--help-bg);
}

.help-docs-main h1 {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 500;
  color: var(--help-text);
}

.help-docs-main h2 {
  margin: 28px 0 12px;
  font-size: 18px;
  font-weight: 600;
  color: var(--help-text);
}

.help-docs-main p {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--help-text-secondary);
}

#help-docs-player {
  display: block;
  width: 100%;
  max-width: 960px;
  background: #000;
  border-radius: 12px;
  border: 1px solid var(--help-border);
  margin: 0;
}

.help-docs-article {
  display: none;
}

.help-docs-article.is-active {
  display: block;
}

.help-docs-video-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.help-docs-video-list li {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--help-border);
}

.help-docs-video-list li.is-target {
  border-color: rgba(255, 106, 69, 0.45);
  background: rgba(255, 106, 69, 0.08);
}

.help-docs-video-link {
  color: var(--help-accent);
  font-size: 15px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.help-docs-video-link:hover {
  color: #FF7B5A;
}

.help-docs-video-link.is-pending {
  color: var(--help-text-muted);
  text-decoration: none;
  cursor: default;
  font-weight: 500;
}

.help-docs-video-link.is-pending:hover {
  color: var(--help-text-secondary);
}

.help-docs-video-meta {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--help-text-muted);
  word-break: break-all;
}

.help-docs-video-desc {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--help-text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.help-docs-video-desc a {
  color: var(--help-accent);
  text-decoration: underline;
  word-break: break-all;
}

.help-docs-video-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--help-text-muted);
  background: rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.help-docs-toast {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 20;
  max-width: min(90vw, 420px);
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--help-surface);
  border: 1px solid var(--help-border);
  color: var(--help-text);
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.help-docs-toast[hidden] {
  display: none !important;
}

.help-docs-video-modal {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 24px;
  box-sizing: border-box;
}

.help-docs-video-modal.show {
  display: flex;
}

.help-docs-video-dialog {
  width: min(92vw, 960px);
  background: var(--help-surface);
  border: 1px solid var(--help-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.help-docs-video-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--help-border);
  font-size: 14px;
  color: var(--help-text-secondary);
}

#help-docs-ui #help-docs-video-modal-close {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  max-width: 32px;
  max-height: 32px;
  aspect-ratio: 1;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--help-text-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#help-docs-ui #help-docs-video-modal-close:hover {
  color: var(--help-text);
  background: rgba(255, 255, 255, 0.08);
}

.help-docs-toc-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--help-text-muted);
  margin: 0 0 12px;
}

.help-docs-toc a {
  display: block;
  padding: 6px 0;
  font-size: 13px;
  color: var(--help-text-secondary);
  text-decoration: none;
}

.help-docs-toc a:hover {
  color: var(--help-accent);
}

@media (max-width: 950px) {
  #help-docs-ui {
    display: none !important;
  }
}
