/* 全站 B 页头。独立样式保证原生 HTML 交互图与 Astro 页面显示一致。 */
.site-header, .site-header * { box-sizing: border-box; }
.site-header {
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  background: #173d35;
  color: #f7f2e7;
  font-family: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: normal;
}
.site-header .site-nav { margin: 0; padding: 0; border: 0; background: none; }
.site-header .site-nav-inner {
  max-width: 1128px;
  min-height: 84px;
  margin: 0 auto;
  padding: 2px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-header .site-brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  flex: 0 0 auto;
  white-space: nowrap;
  color: inherit;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
}
.site-header .site-brand:hover { color: inherit; text-decoration: none; }
.site-header .brand-bear {
  display: block;
  height: 80px;
  width: auto;
  max-width: none;
  flex: none;
  object-fit: contain;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.site-header .site-brand-type { display: flex; flex-direction: column; gap: 4px; }
.site-header .site-brand-owner { font-size: 20px; font-weight: 500; letter-spacing: .08em; line-height: 1.25; }
.site-header .site-brand-title {
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 33px;
  font-weight: 600;
  letter-spacing: .09em;
  line-height: 1.25;
}
.site-header .site-nav-doors { margin-left: auto; display: flex; gap: 31px; flex: none; }
.site-header .site-nav-doors a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .04em;
  text-decoration: none;
}
.site-header .site-nav-about {
  flex: none;
  margin: 0;
  color: inherit;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: .04em;
  white-space: nowrap;
  text-decoration: none;
  opacity: .8;
}
.site-header .site-nav-doors a:hover, .site-header .site-nav-about:hover { color: inherit; opacity: .7; }
.site-header .site-nav-doors a[aria-current="page"], .site-header .site-nav-about[aria-current="page"] { text-decoration: underline; text-underline-offset: 5px; }
.site-header a:focus-visible { outline: 2px solid #f7f2e7; outline-offset: 3px; }
@media (max-width: 1000px) and (min-width: 641px) {
  .site-header .brand-bear { height: 74px; }
  .site-header .site-nav-doors { gap: 22px; }
  .site-header .site-nav-doors a { font-size: 14px; }
}
@media (max-width: 780px) {
  .site-header .site-nav-inner { min-height: 0; flex-wrap: wrap; justify-content: space-between; gap: 0; padding: 2px 20px 0; }
  .site-header .site-brand { width: 100%; gap: 17px; }
  .site-header .brand-bear { height: 68px; }
  .site-header .site-brand-owner { font-size: 17px; }
  .site-header .site-brand-title { font-size: 28px; }
  .site-header .site-nav-doors { width: calc(100% - 64px); justify-content: space-between; margin: 0; gap: 0; }
  .site-header .site-nav-doors a { flex: 0 0 auto; font-size: 14px; min-height: 32px; }
  .site-header .site-nav-about { display: inline-flex; align-items: center; align-self: flex-end; margin: 0; font-size: 13px; min-height: 32px; line-height: 32px; }
}
@media (max-width: 360px) { .site-header .brand-bear { height: 62px; } }

/* 独立交互图保留原有 body 留白和脚本，只把共享页头扩展到窗口两侧。 */
.site-with-header { --site-diagram-x-pad: 2rem; --site-diagram-y-pad: 2rem; --site-header-height: 84px; }
.site-with-header > .site-header {
  margin-top: calc(-1 * var(--site-diagram-y-pad));
  margin-inline: calc(-1 * var(--site-diagram-x-pad));
  margin-bottom: var(--site-diagram-y-pad);
  width: calc(100% + 2 * var(--site-diagram-x-pad));
}
html:not([data-present="true"]):not([data-embed="true"]) .site-with-header .toolbar { top: calc(2rem + var(--site-header-height)); }
@media (min-width: 768px) and (max-height: 920px) {
  .site-with-header { --site-diagram-y-pad: 1.25rem; }
  html[data-nav-stage-rail="true"] .site-with-header { --site-diagram-y-pad: .375rem; }
}
@media (max-width: 780px) { .site-with-header { --site-header-height: 102px; } }
@media (max-width: 720px) {
  .site-with-header { --site-diagram-x-pad: 1rem; --site-diagram-y-pad: 1rem; }
  html:not([data-present="true"]):not([data-embed="true"]) .site-with-header .toolbar { top: calc(1rem + var(--site-header-height)); }
}
@media (max-width: 360px) { .site-with-header { --site-header-height: 96px; } }
/* 全屏演示/嵌入是图表的原有工作模式，隐藏站点外框保留其完整画布。 */
html[data-present="true"] .site-with-header > .site-header,
html[data-embed="true"] .site-with-header > .site-header { display: none; }
