/* Icon menu inspired by the Uiverse action reveal. SVG icons are inline so
   their strokes follow the current day/night palette without extra images. */
.flow-menu-toggle,
.flowing-menu-overlay { display: none !important; }

.n1-bubble-nav {
  position: fixed;
  z-index: 9800;
  inset: 18px 28px auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}
.n1-bubble-brand { display: flex; align-items: center; min-width: 0; pointer-events: auto; }
.n1-bubble-main-link { display: inline-flex; align-items: center; justify-content: center; min-height: 43px; margin-right: 10px; padding: 0 13px; border: 1px solid var(--line-bright, #d9aabb); border-radius: 999px; background: var(--surface, #fff); color: var(--accent-dark, #87264e); box-shadow: var(--shadow, 0 8px 22px #71334d24); font-size: 12px; font-weight: 700; white-space: nowrap; }
.n1-bubble-main-link:hover { background: var(--surface-soft, #fdeaf1); }
.n1-bubble-main-link--menu { display: none; }
.n1-bubble-brand #n1UserButton {
  position: static;
  min-height: 48px;
  max-width: min(270px, 58vw);
  overflow: hidden;
  padding: 0 20px;
  border: 1px solid var(--line-bright, #d9aabb);
  border-radius: 999px;
  background: var(--surface, #fff);
  color: var(--ink, #422a38);
  box-shadow: var(--shadow, 0 8px 22px #71334d24);
  font: 700 .92rem/1 "Microsoft YaHei UI", sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.n1-bubble-brand #n1UserButton:hover { transform: translateY(-2px); }
.n1-bubble-toggle {
  position: absolute;
  top: 100px;
  right: 0;
  display: flex;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0;
  border: 1px solid var(--line-bright, #d9aabb);
  border-radius: 50%;
  background: var(--surface, #fff);
  color: var(--ink, #422a38);
  box-shadow: var(--shadow, 0 8px 22px #71334d24);
  pointer-events: auto;
  cursor: pointer;
  transition: transform .22s ease, border-color .22s ease, background .22s ease;
}
.n1-bubble-toggle:hover { transform: scale(1.05); border-color: var(--accent, #a93463); }
.n1-bubble-toggle span { display: block; width: 24px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .24s ease; }
.n1-bubble-toggle.is-open span:first-child { transform: translateY(4.5px) rotate(45deg); }
.n1-bubble-toggle.is-open span:last-child { transform: translateY(-4.5px) rotate(-45deg); }

.n1-bubble-overlay {
  position: fixed;
  z-index: 9700;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 105px 24px 30px;
  background: radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--accent, #a93463) 13%, transparent), transparent 37%), var(--paper, #fff6fa);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.n1-bubble-overlay[hidden] { display: none; }
.n1-bubble-overlay.is-open { opacity: 1; visibility: visible; }
.n1-bubble-panel {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  width: min(920px, 100%);
  margin: auto;
  padding: clamp(26px, 4vw, 56px);
  border: 1px solid var(--line, #ead3dd);
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface, #fff) 88%, transparent);
  box-shadow: 0 25px 70px #71334d1a;
}
.n1-bubble-heading { align-self: center; }
.n1-bubble-heading > span { color: var(--accent, #a93463); font-size: 12px; font-weight: 800; letter-spacing: .18em; }
.n1-bubble-heading h2 { max-width: 8em; margin: 16px 0 18px; color: var(--ink, #422a38); font: 700 clamp(30px, 3vw, 46px)/1.32 "Yu Mincho", "Songti SC", serif; }
.n1-bubble-heading p { margin: 0; color: var(--muted, #765f6d); font-size: 14px; line-height: 1.7; }
.n1-bubble-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.n1-bubble-list li { min-width: 0; }
.n1-bubble-pill {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid var(--line, #ead3dd);
  border-radius: 18px;
  background: var(--surface, #fff);
  color: var(--ink, #422a38);
  font: 700 17px/1.3 "Microsoft YaHei UI", sans-serif;
  text-align: left;
  cursor: pointer;
  transition: border-color .25s ease, background-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.n1-bubble-pill:hover,
.n1-bubble-pill:focus-visible {
  border-color: var(--accent, #a93463);
  background: var(--surface-soft, #fdeaf1);
  box-shadow: 0 10px 25px #71334d16;
  transform: translateY(-2px);
}
.n1-bubble-pill:focus-visible { outline: 2px solid var(--accent, #a93463); outline-offset: 3px; }
.n1-bubble-pill:active { transform: scale(.98); }
.n1-bubble-icon {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: var(--accent-dark, #87264e);
  box-shadow: 0 3px 12px #71334d12;
  transition: transform .32s ease;
}
.n1-bubble-icon::before,
.n1-bubble-icon::after { content: ""; position: absolute; border-radius: inherit; }
.n1-bubble-icon::before {
  inset: -3px;
  background: conic-gradient(from 45deg, var(--accent, #a93463), var(--accent-soft, #fbe1eb), var(--accent-dark, #87264e), var(--accent, #a93463));
  opacity: 0;
  transition: opacity .2s ease;
}
.n1-bubble-icon::after { inset: 0; background: var(--surface, #fff); }
.n1-bubble-icon svg { position: relative; z-index: 1; width: 26px; height: 26px; }
.n1-bubble-pill:is(:hover, :focus, [aria-current="page"]) .n1-bubble-icon::before { opacity: 1; animation: n1-menu-halo 3s linear infinite; }
.n1-bubble-pill:is(:hover, :focus) .n1-bubble-icon { transform: scale(1.08) translateX(3px); }
.n1-bubble-pill[aria-current="page"] { border-color: color-mix(in srgb, var(--accent, #a93463) 55%, var(--line, #ead3dd)); }
.n1-bubble-content {
  display: block;
  max-width: 0;
  overflow: hidden;
  color: var(--accent-dark, #87264e);
  opacity: 0;
  white-space: nowrap;
  transform: translateX(-12px);
  transition: max-width .38s cubic-bezier(.23, 1, .32, 1), opacity .22s ease, transform .38s cubic-bezier(.23, 1, .32, 1);
}
.n1-bubble-pill:is(:hover, :focus, [aria-current="page"]) .n1-bubble-content {
  max-width: 10em;
  opacity: 1;
  transform: translateX(0);
}
.n1-bubble-pill.is-entering { animation: n1-menu-enter .38s cubic-bezier(.18, .88, .28, 1.18) both; animation-delay: var(--bubble-delay, 0ms); }
@keyframes n1-menu-halo { to { rotate: 1turn; } }
@keyframes n1-menu-enter { from { opacity: 0; transform: translateY(12px) scale(.94); } to { opacity: 1; transform: none; } }
body.n1-bubble-nav-open { overflow: hidden; }

@media (min-width: 900px) {
  .n1-bubble-toggle[hidden] { display: none !important; }
  .n1-bubble-overlay.is-side-rail {
    --rail-button: clamp(44px, 7dvh, 48px);
    inset: max(76px, calc(50dvh - 164.5px)) auto auto 14px;
    display: block;
    width: calc(var(--rail-button) + 14px);
    height: auto;
    padding: 6px;
    overflow: visible;
    border: 1px solid var(--line, #ead3dd);
    border-radius: 999px;
    background: var(--surface, #fff);
    box-shadow: var(--shadow, 0 8px 22px #71334d24);
    box-sizing: border-box;
    transform: none;
  }
  .n1-bubble-overlay.is-side-rail .n1-bubble-panel {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .n1-bubble-overlay.is-side-rail .n1-bubble-heading {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .n1-bubble-overlay.is-side-rail .n1-bubble-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  .n1-bubble-overlay.is-side-rail .n1-bubble-pill {
    position: relative;
    display: grid;
    place-items: center;
    width: var(--rail-button);
    height: var(--rail-button);
    min-height: var(--rail-button);
    padding: 0;
    border-radius: 50%;
  }
  .n1-bubble-overlay.is-side-rail .n1-bubble-icon { width: calc(var(--rail-button) - 8px); height: calc(var(--rail-button) - 8px); }
  .n1-bubble-overlay.is-side-rail .n1-bubble-icon svg { width: 22px; height: 22px; }
  .n1-bubble-overlay.is-side-rail .n1-bubble-content {
    position: absolute;
    top: 50%;
    left: calc(100% + 15px);
    display: flex;
    align-items: center;
    width: max-content;
    min-height: 42px;
    max-width: 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: var(--surface, #fff);
    box-shadow: var(--shadow, 0 8px 22px #71334d24);
    opacity: 0;
    transform: translate(-12px, -50%);
    pointer-events: none;
    box-sizing: border-box;
  }
  .n1-bubble-overlay.is-side-rail .n1-bubble-pill:hover .n1-bubble-content,
  .n1-bubble-overlay.is-side-rail .n1-bubble-pill:focus .n1-bubble-content {
    max-width: 180px;
    padding: 0 16px;
    border: 1px solid var(--line, #ead3dd);
    opacity: 1;
    transform: translate(0, -50%);
  }
  .n1-bubble-overlay.is-side-rail .n1-bubble-pill[aria-current="page"]:not(:hover):not(:focus) .n1-bubble-content {
    max-width: 0;
    opacity: 0;
  }
  html[data-theme] .react-shell main { padding-left: clamp(112px, 9vw, 154px); }
}

@media (min-width: 900px) and (max-height: 390px) {
  .n1-bubble-overlay.is-side-rail {
    top: 76px;
    bottom: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 24px;
    scrollbar-width: thin;
  }
}

@media (max-width: 899px) {
  .n1-bubble-brand > .n1-bubble-main-link { display: none; }
  .n1-bubble-main-link--menu { display: inline-flex; min-height: 34px; margin: 0 0 12px; padding: 0 12px; box-shadow: none; font-size: 12px; }
  .n1-bubble-nav { inset: 12px 14px auto; }
  .n1-bubble-toggle { top: 0; right: 0; width: 48px; height: 48px; flex-basis: 48px; }
  .n1-bubble-brand #n1UserButton { min-height: 44px; padding: 0 15px; font-size: .84rem; }
  .n1-bubble-overlay { align-items: start; padding: 126px 16px calc(20px + env(safe-area-inset-bottom)); }
  .n1-bubble-panel { grid-template-columns: 1fr; gap: 20px; width: min(520px, 100%); padding: 23px; border-radius: 22px; }
  .n1-bubble-heading h2 { max-width: none; margin: 7px 0 4px; font-size: 26px; }
  .n1-bubble-heading p { display: none; }
  .n1-bubble-pill { min-height: 68px; padding: 8px; }
  .n1-bubble-content { max-width: 10em; opacity: 1; transform: none; }
}
@media (max-width: 600px) {
  .n1-bubble-panel { width: min(440px, 100%); padding: 19px; }
  .n1-bubble-list { grid-template-columns: 1fr; gap: 8px; }
  .n1-bubble-pill { min-height: 60px; gap: 15px; font-size: 16px; }
  .n1-bubble-icon { width: 44px; height: 44px; }
  .n1-bubble-icon svg { width: 23px; height: 23px; }
}
@media (max-width: 380px) {
  .n1-bubble-nav { inset-inline: 10px; }
  .n1-bubble-brand #n1UserButton { max-width: calc(100vw - 86px); padding-inline: 12px; font-size: .78rem; }
  .n1-bubble-overlay { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .n1-bubble-nav *, .n1-bubble-overlay, .n1-bubble-pill { animation: none !important; transition-duration: .01ms !important; }
}
