/* Card library header and canvas; navigation shares the homepage sidebar. */
.library-reference-shell {
  --library-unit: clamp(.62px, .03633721vw, 1px);
  --library-header-height: calc(165 * var(--library-unit));
  --library-shell-text: #33273c;
  --library-shell-muted: #81748a;
  --library-shell-line: #b99bc24d;
  --library-shell-glow: #c66acb;
  --library-shell-accent: #bb468d;
  --library-shell-header: #fcf8fddd;
  --library-shell-sidebar: #f4ecf8ef;
  --library-shell-rail: #f8f1fb;
  --library-shell-control: #fff9ff;
  grid-template-columns: var(--navigation-width) minmax(0, 1fr);
  min-height: 100dvh;
  color: var(--library-shell-text);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: radial-gradient(ellipse at 100% 80%, #f6e3f4 0, transparent 57%), #fbf8fd;
}
html[data-theme="dark"] .library-reference-shell,
.dark .library-reference-shell {
  --library-shell-text: #eeeaf1;
  --library-shell-muted: #9b91a7;
  --library-shell-line: #9b76b04d;
  --library-shell-accent: #df76bc;
  --library-shell-header: #1a1727e8;
  --library-shell-sidebar: #181025f2;
  --library-shell-rail: #100c1e;
  --library-shell-control: #251c32;
  background: radial-gradient(ellipse 40% 95% at 100% 100%, #4d194c99 0, transparent 75%), #100b1e;
}
.library-reference-shell .workspace {
  grid-column: 2;
  min-width: 0;
  padding-top: var(--library-header-height);
  background: transparent;
}
.library-reference-shell :is(h1, h2, h3, h4, a, p, span, strong, small, time, button, input, textarea, select) { font-family: inherit; }
.library-reference-shell .topbar {
  position: fixed;
  inset: 0 0 auto var(--navigation-width);
  z-index: 45;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: flex-start;
  width: auto;
  max-width: none;
  height: var(--library-header-height);
  min-height: 0;
  margin: 0;
  padding: calc(39 * var(--library-unit)) calc(56 * var(--library-unit)) 0 calc(164 * var(--library-unit));
  gap: calc(24 * var(--library-unit));
  border: 1px solid var(--library-shell-line);
  border-top: 0;
  border-radius: 0 0 calc(22 * var(--library-unit)) calc(22 * var(--library-unit));
  color: var(--library-shell-muted);
  background: var(--library-shell-header);
  box-shadow: inset 0 -1px 1px #cc87d47d, 0 0 calc(32 * var(--library-unit)) #bb58cc40, inset 0 0 calc(28 * var(--library-unit)) #a355b61a;
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}
html[data-theme="dark"] .library-reference-shell .topbar,
.dark .library-reference-shell .topbar {
  background: linear-gradient(180deg, #b177c61c, transparent 28%, transparent 70%, #b04bdf33), var(--library-shell-header);
}
.library-reference-shell .plaza-brand-group {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  min-width: 0;
  gap: 0;
  min-height: calc(72 * var(--library-unit));
  font-size: calc(32 * var(--library-unit));
  line-height: 1.4;
}
.library-reference-shell .plaza-brand-group > [data-action="sidebar-toggle"] { display: none; }
.library-reference-shell .topbar .discovery-main-nav {
  flex: none;
  gap: calc(42 * var(--library-unit));
  color: var(--library-shell-muted);
  font-size: inherit;
}
.library-reference-shell .topbar .discovery-main-nav [data-navigation-trigger] { font-weight: 400; }
.library-reference-shell .topbar .discovery-main-nav .discovery-submenu { font-size: max(13px, calc(24 * var(--library-unit))); }
.library-reference-shell .library-current-page {
  display: block;
  flex: none;
  margin-left: calc(31 * var(--library-unit));
  padding-left: calc(31 * var(--library-unit));
  border-left: 1px solid #9e80b064;
  color: var(--library-shell-accent);
  white-space: nowrap;
  font-weight: 400;
  text-decoration: none;
}
.library-reference-shell .topbar-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: calc(22 * var(--library-unit));
  padding: 0;
}
.library-reference-shell .topbar-actions .theme-toggle {
  width: calc(74 * var(--library-unit));
  height: calc(72 * var(--library-unit));
  flex: none;
  min-height: 0;
  padding: calc(20 * var(--library-unit));
  border: 1px solid var(--library-shell-line);
  border-radius: calc(23 * var(--library-unit));
  color: var(--library-shell-muted);
  background: transparent;
}
.library-reference-shell .topbar-actions .theme-toggle .icon { width: 100%; height: 100%; }
.library-reference-shell .topbar-actions .theme-toggle .theme-icon-moon { display: block; }
.library-reference-shell .topbar-actions .theme-toggle .theme-icon-sun { display: none; }
.library-reference-shell .topbar-actions :is(.plaza-create, .recharge-cta) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 0;
  height: calc(72 * var(--library-unit));
  padding: 0 calc(24 * var(--library-unit));
  gap: calc(7 * var(--library-unit));
  border: 1px solid #d079d77a;
  border-radius: 999px;
  color: #fff5ff;
  font-size: calc(32 * var(--library-unit));
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  background: linear-gradient(110deg, #719af4, #a768db 53%, #e84b9b);
  box-shadow: inset 0 0 12px #f4b2fb20, 0 0 calc(25 * var(--library-unit)) #d858be36;
}
.library-reference-shell .topbar-actions :is(.plaza-create, .recharge-cta) > span { display: inline; }
.library-reference-shell .topbar-actions :is(.plaza-create, .recharge-cta) > .icon {
  display: block;
  width: calc(32 * var(--library-unit));
  height: calc(32 * var(--library-unit));
  stroke-width: 1.8;
}
.library-reference-shell .topbar-actions .recharge-cta {
  padding-inline: calc(12 * var(--library-unit));
  font-size: calc(30 * var(--library-unit));
  border-color: #f37cb76e;
  background: linear-gradient(105deg, #ec8aa9, #f44993 68%, #f32978);
  box-shadow: 0 0 calc(36 * var(--library-unit)) #ec2b8059, inset 0 0 12px #ffaac84d;
}
.library-reference-shell .topbar-actions .recharge-cta > .icon { fill: currentColor; stroke-width: 1; }
.library-reference-shell .topbar .plaza-profile-link {
  position: relative;
  display: grid;
  flex: none;
  width: calc(78 * var(--library-unit));
  height: calc(78 * var(--library-unit));
  border: 1px solid var(--library-shell-line);
  border-radius: 50%;
  color: var(--library-shell-muted);
  background: var(--library-shell-control);
}
.library-reference-shell .topbar .plaza-profile-link .avatar { width: 100%; height: 100%; border-radius: inherit; }
.library-reference-shell .library-user-online { position: relative; }
.library-reference-shell .library-user-online::after {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  width: max(8px, calc(17 * var(--library-unit)));
  height: max(8px, calc(17 * var(--library-unit)));
  border: 2px solid var(--library-shell-sidebar);
  border-radius: 50%;
  background: #16d76e;
  content: "";
}
@media (max-width: 1440px) and (min-width: 761px) {
  .library-reference-shell .topbar { align-items: center; padding: 0 24px; gap: 16px; }
  .library-reference-shell .plaza-brand-group { font-size: 17px; min-height: 44px; }
  .library-reference-shell .topbar .discovery-main-nav { gap: 23px; }
  .library-reference-shell .library-current-page { margin-left: 17px; padding-left: 17px; }
  .library-reference-shell .topbar-actions { gap: 10px; }
  .library-reference-shell .topbar-actions :is(.plaza-create, .recharge-cta) { height: 42px; padding-inline: 15px; font-size: 17px; }
  .library-reference-shell .topbar-actions :is(.plaza-create, .recharge-cta) > .icon { width: 20px; height: 20px; }
  .library-reference-shell .topbar-actions .theme-toggle { width: 42px; height: 42px; padding: 11px; border-radius: 13px; }
  .library-reference-shell .topbar .plaza-profile-link { width: 46px; height: 46px; }
}
@media (max-width: 1200px) and (min-width: 761px) {
  .library-reference-shell { --library-header-height: 118px; }
  .library-reference-shell .topbar { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 44px 28px; align-content: center; gap: 12px; padding: 12px 20px; }
  .library-reference-shell .topbar-actions { grid-row: 1; justify-content: flex-end; }
  .library-reference-shell .plaza-brand-group { grid-row: 2; justify-content: flex-start; min-height: 28px; font-size: 16px; }
  .library-reference-shell .topbar .discovery-main-nav { gap: clamp(15px, 2vw, 23px); }
  .library-reference-shell .library-current-page { margin-left: 17px; padding-left: 17px; }
}
@media (max-width: 760px) {
  .library-reference-shell { --library-header-height: 112px; --navigation-width: 0px; grid-template-columns: minmax(0, 1fr); }
  .library-reference-shell .workspace { grid-column: 1; }
  .library-reference-shell .topbar { inset: 0 0 auto; display: grid; grid-template-columns: 32px minmax(0, 1fr); grid-template-rows: 43px 28px; align-items: center; gap: 12px 10px; padding: 12px 14px 16px; }
  .library-reference-shell .plaza-brand-group { display: contents; font-size: 13px; }
  .library-reference-shell .plaza-brand-group > [data-action="sidebar-toggle"] { display: inline-flex; grid-row: 1; grid-column: 1; width: 32px; height: 36px; min-height: 0; padding: 6px; color: var(--library-shell-muted); }
  .library-reference-shell .topbar .discovery-main-nav { grid-row: 2; grid-column: 1 / -1; gap: 0; justify-content: space-between; padding-right: 85px; font-size: 13px; }
  .library-reference-shell .library-current-page { grid-row: 2; grid-column: 2; justify-self: end; margin-left: 0; padding-left: 13px; font-size: 13px; }
  .library-reference-shell .topbar-actions { grid-row: 1; grid-column: 2; justify-content: flex-end; gap: 9px; }
  .library-reference-shell .topbar-actions .theme-toggle { width: 35px; height: 35px; padding: 8px; border-radius: 11px; }
  .library-reference-shell .topbar-actions :is(.plaza-create, .recharge-cta) { height: 35px; padding-inline: 12px; gap: 3px; font-size: 12px; }
  .library-reference-shell .topbar-actions :is(.plaza-create, .recharge-cta) > .icon { width: 16px; height: 16px; }
  .library-reference-shell .topbar .plaza-profile-link { display: grid; width: 38px; height: 38px; }
  .library-reference-shell .mobile-dimmer { position: fixed; inset: 0; z-index: 55; background: #0c071a88; }
  .library-reference-shell .mobile-dimmer.open { display: block; }
  .library-reference-shell + .mobile-bottom { color: var(--text-muted); background: var(--bg-card); }
  .library-reference-shell + .mobile-bottom > a.active { color: #d16aad; }
}
@media (max-width: 360px) {
  .library-reference-shell .topbar { padding-inline: 10px; gap: 12px 5px; }
  .library-reference-shell .topbar-actions { gap: 5px; }
  .library-reference-shell .topbar-actions :is(.plaza-create, .recharge-cta) { padding-inline: 8px; font-size: 11px; }
  .library-reference-shell .topbar .discovery-main-nav { padding-right: 78px; font-size: 12px; }
  .library-reference-shell .library-current-page { padding-left: 10px; font-size: 12px; }
}
