/*
 * Source copies for the public shell:
 * - /横幅_clean.html: .banner / .flow / .close and @keyframes move
 * - /文字变换_clean.html: .stage / .dots / .morph / #threshold
 * - /全屏菜单_clean.html: .menu / .word / .row.alt / .char
 * - /液态玻璃按钮_clean.html: .glass-button-wrap / shadow / button / text
 * - /流光按钮_clean.html: @property gradient border / dotted mask / shimmer / breathe
 *
 * The source selector structure and motion formulas are retained. Scoping,
 * theme tokens, responsive sizing, focus states and reduced-motion rules are
 * the Samui MOD production adaptations.
 */

@property --angle-1 {
  syntax: "<angle>";
  inherits: false;
  initial-value: -75deg;
}

@property --angle-2 {
  syntax: "<angle>";
  inherits: false;
  initial-value: -45deg;
}

/* /横幅_clean.html */
.samui-reference-banner.banner {
  position: relative;
  z-index: 50;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  overflow: hidden;
  padding: 0 60px 0 16px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  box-shadow: 0 10px 20px rgb(0 0 0 / 8%);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.samui-reference-banner .flow {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: repeating-linear-gradient(
    70deg,
    color-mix(in srgb, var(--text) 12%, transparent) 0%,
    color-mix(in srgb, var(--text) 12%, transparent) 7.14%,
    transparent 14.28%,
    color-mix(in srgb, var(--text) 12%, transparent) 21.42%,
    transparent 28.56%,
    color-mix(in srgb, var(--text) 12%, transparent) 35.7%,
    transparent 42.84%,
    color-mix(in srgb, var(--text) 12%, transparent) 50%
  );
  background-size: 200% 100%;
  filter: saturate(2);
  mask-image: linear-gradient(to bottom, #fff, transparent), radial-gradient(circle at top center, #fff, transparent);
  mask-composite: intersect;
  animation: move 20s linear infinite;
  pointer-events: none;
}

.samui-reference-banner .banner__message {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.samui-reference-banner a {
  flex: none;
  color: var(--brand-hover);
  font-weight: 650;
  text-decoration: none;
}

.samui-reference-banner a:hover { text-decoration: underline; }

.samui-reference-banner .close {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 40px;
  height: 40px;
  translate: 0 -50%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: color-mix(in srgb, var(--text) 50%, transparent);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.samui-reference-banner .close:hover {
  background: color-mix(in srgb, var(--text) 7%, transparent);
  color: var(--text);
}

@keyframes move {
  to { background-position: 100% 0; }
}

/* /文字变换_clean.html */
.samui-reference-morph.stage {
  position: relative;
  width: 100%;
  height: clamp(64px, 8vw, 96px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

.samui-reference-morph .dots {
  --mask-offset: 18px;
  position: absolute;
  inset: 0;
  opacity: .4;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 18%, transparent) 1px, transparent 1px);
  background-size: 16px 16px;
  -webkit-mask: linear-gradient(to bottom, transparent, #fff var(--mask-offset) calc(100% - var(--mask-offset)), transparent), linear-gradient(to right, transparent, #fff var(--mask-offset) calc(100% - var(--mask-offset)), transparent);
  mask: linear-gradient(to bottom, transparent, #fff var(--mask-offset) calc(100% - var(--mask-offset)), transparent), linear-gradient(to right, transparent, #fff var(--mask-offset) calc(100% - var(--mask-offset)), transparent);
  mask-composite: intersect;
  pointer-events: none;
}

.samui-reference-morph .morph {
  position: relative;
  width: 100%;
  max-width: 768px;
  height: clamp(64px, 8vw, 96px);
  margin: auto;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(53px, 7vw, 96px);
  font-weight: 700;
  line-height: 1;
  text-align: left;
  filter: url(#threshold) blur(.6px);
}

.samui-reference-morph .morph span {
  position: absolute;
  inset: 0;
  width: 100%;
}

.samui-reference-morph .morph span:first-child { opacity: 1; }
.samui-reference-morph .morph span:last-child { opacity: 0; }

/* /全屏菜单_clean.html */
.samui-reference-menu .menu {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 12px 28px;
  list-style: none;
}

.mobile-menu__nav.samui-reference-menu .menu { min-height: 100%; }
.samui-reference-menu .menu li { min-width: 0; cursor: pointer; }
.samui-reference-menu .menu a { display: block; color: var(--text); text-decoration: none; }
.samui-reference-menu .menu a[aria-current="page"] { color: var(--text); }

.samui-reference-menu .word {
  position: relative;
  display: block;
  overflow: hidden;
  font-size: 48px;
  font-weight: 800;
  text-transform: uppercase;
  line-height: .85;
  letter-spacing: -.03em;
}

.samui-reference-menu .row { display: block; white-space: pre; }
.samui-reference-menu .row.alt { position: absolute; inset: 0; }
.samui-reference-menu .char { display: inline-block; transition: transform .32s ease-in-out; }
.samui-reference-menu .alt .char { transform: translateY(100%); }
.samui-reference-menu .menu li:hover .row:not(.alt) .char,
.samui-reference-menu .menu li:focus-within .row:not(.alt) .char { transform: translateY(-100%); }
.samui-reference-menu .menu li:hover .alt .char,
.samui-reference-menu .menu li:focus-within .alt .char { transform: translateY(0); }

/* /液态玻璃按钮_clean.html */
.glass-button-wrap {
  --anim-time: .4s;
  --anim-ease: cubic-bezier(.25, 1, .5, 1);
  --border-width: clamp(1px, .0625em, 4px);
  --foreground: var(--text);
  position: relative;
  z-index: 2;
  border-radius: 9999px;
  transform-style: preserve-3d;
  transition: transform var(--anim-time) var(--anim-ease);
  cursor: pointer;
}

.glass-button-wrap:has(.glass-button:active) { transform: rotateX(25deg); }

.glass-button-shadow {
  --cut: 2em;
  position: absolute;
  width: calc(100% + var(--cut));
  height: calc(100% + var(--cut));
  top: calc(0% - var(--cut) / 2);
  left: calc(0% - var(--cut) / 2);
  border-radius: 9999px;
  filter: blur(clamp(2px, .125em, 12px));
  transition: filter var(--anim-time) var(--anim-ease);
  pointer-events: none;
}

.glass-button-shadow:after {
  content: "";
  position: absolute;
  width: calc(100% - var(--cut) - .25em);
  height: calc(100% - var(--cut) - .25em);
  top: calc(var(--cut) - .5em);
  left: calc(var(--cut) - .875em);
  box-sizing: border-box;
  border-radius: 9999px;
  padding: .125em;
  background: linear-gradient(180deg, oklch(from var(--foreground) l c h / 20%), oklch(from var(--foreground) l c h / 10%));
  opacity: 1;
  transition: all var(--anim-time) var(--anim-ease);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.glass-button {
  position: relative;
  isolation: isolate;
  border: 0;
  outline: 0;
  border-radius: 9999px;
  background: linear-gradient(-75deg, oklch(from var(--background) l c h / 5%), oklch(from var(--background) l c h / 20%), oklch(from var(--background) l c h / 5%));
  color: inherit;
  box-shadow: inset 0 .125em .125em oklch(from var(--foreground) l c h / 5%), inset 0 -.125em .125em oklch(from var(--background) l c h / 50%), 0 .25em .125em -.125em oklch(from var(--foreground) l c h / 20%), 0 0 .1em .25em inset oklch(from var(--background) l c h / 20%), 0 0 oklch(from var(--background) l c h);
  backdrop-filter: blur(clamp(1px, .125em, 4px));
  cursor: pointer;
  transition: all var(--anim-time) var(--anim-ease);
}

.glass-button:hover {
  background: linear-gradient(-75deg, oklch(from var(--background) l c h / 5%), oklch(from var(--background) l c h / 20%), oklch(from var(--background) l c h / 5%));
  color: inherit;
  box-shadow: inset 0 .125em .125em oklch(from var(--foreground) l c h / 5%), inset 0 -.125em .125em oklch(from var(--background) l c h / 50%), 0 .15em .05em -.1em oklch(from var(--foreground) l c h / 25%), 0 0 .05em .1em inset oklch(from var(--background) l c h / 50%), 0 0 oklch(from var(--background) l c h);
  backdrop-filter: blur(.01em);
  transform: scale(.975);
}

.glass-button:after {
  content: "";
  position: absolute;
  z-index: 1;
  width: calc(100% + var(--border-width));
  height: calc(100% + var(--border-width));
  top: calc(0% - var(--border-width) / 2);
  left: calc(0% - var(--border-width) / 2);
  box-sizing: border-box;
  border-radius: 9999px;
  padding: var(--border-width);
  background: conic-gradient(from var(--angle-1) at 50% 50%, oklch(from var(--foreground) l c h / 50%) 0%, transparent 5% 40%, oklch(from var(--foreground) l c h / 50%) 50%, transparent 60% 95%, oklch(from var(--foreground) l c h / 50%) 100%), linear-gradient(180deg, oklch(from var(--background) l c h / 50%), oklch(from var(--background) l c h / 50%));
  box-shadow: inset 0 0 0 calc(var(--border-width) / 2) oklch(from var(--background) l c h / 50%);
  transition: all var(--anim-time) var(--anim-ease), --angle-1 .5s ease;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.glass-button:hover:after { --angle-1: -125deg; }
.glass-button:active:after { --angle-1: -75deg; }

.glass-button-text {
  position: relative;
  z-index: 2;
  display: block;
  border-radius: 9999px;
  color: oklch(from var(--foreground) l c h / 90%);
  letter-spacing: -.025em;
  text-shadow: 0 .25em .05em oklch(from var(--foreground) l c h / 10%);
  transition: all var(--anim-time) var(--anim-ease);
  user-select: none;
}

.glass-button-text:after {
  content: "";
  position: absolute;
  z-index: 3;
  top: calc(var(--border-width) / 2);
  left: calc(var(--border-width) / 2);
  width: calc(100% - var(--border-width));
  height: calc(100% - var(--border-width));
  display: block;
  overflow: hidden;
  box-sizing: border-box;
  border-radius: 9999px;
  background: linear-gradient(var(--angle-2), transparent 0%, oklch(from var(--background) l c h / 50%) 40% 50%, transparent 55%);
  background-position: 0%;
  background-size: 200% 200%;
  mix-blend-mode: screen;
  transition: background-position calc(var(--anim-time) * 1.25) var(--anim-ease), --angle-2 calc(var(--anim-time) * 1.25) var(--anim-ease);
  pointer-events: none;
}

.glass-button:hover .glass-button-text:after { background-position: 25%; }
.glass-button:active .glass-button-text:after { --angle-2: -15deg; background-position: 50% 15%; }
.glass-button-wrap:has(.glass-button:hover) .glass-button-shadow { filter: blur(clamp(2px, .0625em, 6px)); }
.glass-button-wrap:has(.glass-button:hover) .glass-button-shadow:after { top: calc(var(--cut) - .875em); }
.glass-button-wrap:has(.glass-button:active) .glass-button-shadow { filter: blur(clamp(2px, .125em, 12px)); }
.glass-button-wrap:has(.glass-button:active) .glass-button-shadow:after { top: calc(var(--cut) - .5em); opacity: .75; }
.glass-button-wrap.sm { font-size: 14px; font-weight: 500; }
.glass-button-wrap.sm .glass-button-text { padding: 8px 12px; }
.glass-button.theme-switch { min-height: 40px; display: block; padding: 0; }
.glass-button.theme-switch:active { transform: scale(.975); }
.glass-button.theme-switch .glass-button-text { display: flex; align-items: center; justify-content: center; gap: 7px; }
.glass-button.theme-switch svg { position: relative; z-index: 4; width: 17px; height: 17px; }
.mobile-menu__foot .glass-button-wrap { align-self: flex-start; }
.mobile-menu__foot .theme-switch__label { display: inline; }

/* Neutral public-shell adaptation: blue remains an action accent, not a field. */
.site-header { background: color-mix(in srgb, var(--background) 94%, transparent); }
.mobile-menu__frame { background: var(--background); }
.hero { background: var(--background); }
.hero__ambient { display: none; }
.hero__kicker { color: var(--text-muted); font-family: var(--font-body); letter-spacing: .035em; text-transform: none; }
.hero h1 { max-width: 720px; font-size: clamp(2.75rem, 5.6vw, 5rem); line-height: .98; }
.hero .release-preview { border-color: var(--border); background: var(--surface); box-shadow: var(--shadow-md); }
.hero a.release-preview:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.hero .fallback-cover { background: linear-gradient(145deg, var(--surface-soft), var(--background-elevated)); }
.hero .fallback-cover::before { border-color: var(--border-strong); box-shadow: 0 0 0 24px color-mix(in srgb, var(--text) 2%, transparent), 0 0 0 52px color-mix(in srgb, var(--text) 2%, transparent); }
.hero__aside .mod-card { width: min(100%, 420px); margin-left: auto; }
.hero-empty { width: min(100%, 420px); display: grid; gap: .65rem; margin-left: auto; border-radius: 16px; background: var(--surface); padding: clamp(1.5rem, 5vw, 2.5rem); box-shadow: var(--shadow-sm); }
.hero-empty strong { font-family: var(--font-display); font-size: 1.45rem; }
.hero-empty p { color: var(--text-muted); }

/* Source component: 流光按钮_clean.html
   Ported with scoped class names; @property, conic border, dotted mask,
   shimmer, breathe and hover/focus animation activation are retained. */
@property --gradient-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@property --gradient-angle-offset {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@property --gradient-percent {
  syntax: "<percentage>";
  initial-value: 5%;
  inherits: false;
}

@property --gradient-shine {
  syntax: "<color>";
  initial-value: white;
  inherits: false;
}

.samui-shiny {
  --bg: #171719;
  --subtle: #343438;
  --fg: #fff;
  --hi: #3470b8;
  --hi2: #9abbe0;
  --animation: samui-gradient-angle linear infinite;
  --duration: 3s;
  --shadow: 2px;
  --transition: 800ms cubic-bezier(.25, 1, .5, 1);
  isolation: isolate;
  position: relative;
  overflow: hidden;
  min-height: 48px;
  cursor: pointer;
  outline-offset: 4px;
  padding: .85rem 1.45rem;
  font-size: .95rem;
  line-height: 1.2;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 360px;
  color: var(--fg);
  background: linear-gradient(var(--bg), var(--bg)) padding-box, conic-gradient(from calc(var(--gradient-angle) - var(--gradient-angle-offset)), transparent, var(--hi) var(--gradient-percent), var(--gradient-shine) calc(var(--gradient-percent) * 2), var(--hi) calc(var(--gradient-percent) * 3), transparent calc(var(--gradient-percent) * 4)) border-box;
  box-shadow: inset 0 0 0 1px var(--subtle);
  transition: var(--transition);
  transition-property: --gradient-angle-offset, --gradient-percent, --gradient-shine;
}

.samui-shiny:active { translate: 0 1px; }
.samui-shiny::before,
.samui-shiny::after,
.samui-shiny span::before {
  content: "";
  pointer-events: none;
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  z-index: -1;
}

.samui-shiny::before {
  --size: calc(100% - var(--shadow) * 3);
  --pos: 2px;
  --space: calc(var(--pos) * 2);
  width: var(--size);
  height: var(--size);
  background: radial-gradient(circle at var(--pos) var(--pos), white calc(var(--pos) / 4), transparent 0) padding-box;
  background-size: var(--space) var(--space);
  background-repeat: space;
  mask-image: conic-gradient(from calc(var(--gradient-angle) + 45deg), black, transparent 10% 90%, black);
  border-radius: inherit;
  opacity: .28;
}

.samui-shiny::after {
  --animation: samui-shimmer linear infinite;
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(-50deg, transparent, var(--hi), transparent);
  mask-image: radial-gradient(circle at bottom, transparent 40%, black);
  opacity: .42;
}

.samui-shiny span { position: relative; z-index: 1; }
.samui-shiny span::before {
  --size: calc(100% + 1rem);
  width: var(--size);
  height: var(--size);
  box-shadow: inset 0 -1ex 2rem 4px var(--hi);
  opacity: 0;
  transition: opacity var(--transition);
  animation: calc(var(--duration) * 1.5) samui-breathe linear infinite paused;
}

.samui-shiny,
.samui-shiny::before,
.samui-shiny::after {
  animation: var(--animation) var(--duration), var(--animation) calc(var(--duration) / .4) reverse paused;
  animation-composition: add;
}

.samui-shiny:is(:hover, :focus-visible) {
  --gradient-percent: 20%;
  --gradient-angle-offset: 95deg;
  --gradient-shine: var(--hi2);
}

.samui-shiny:is(:hover, :focus-visible),
.samui-shiny:is(:hover, :focus-visible)::before,
.samui-shiny:is(:hover, :focus-visible)::after { animation-play-state: running; }
.samui-shiny:is(:hover, :focus-visible) span::before { opacity: 1; animation-play-state: running; }

@keyframes samui-gradient-angle { to { --gradient-angle: 360deg; } }
@keyframes samui-shimmer { to { rotate: 360deg; } }
@keyframes samui-breathe { 50% { scale: 1.2; } }

@media (min-width: 768px) {
  .samui-reference-banner .close { right: 80px; }
}

@media (max-width: 1023px) {
  .samui-reference-menu .word { font-size: 36px; }
}

@media (max-width: 620px) {
  .samui-reference-banner.banner { justify-content: flex-start; text-align: left; }
  .samui-reference-banner a { display: none; }
  .samui-reference-morph.stage { height: 64px; }
  .samui-reference-morph .morph { height: 64px; font-size: 53px; }
  .search-bar .samui-shiny { width: 100%; }
  .hero__aside .mod-card,
  .hero-empty { width: 100%; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .samui-reference-banner .flow { animation: none; }
  .samui-reference-morph .morph { filter: none; }
  .samui-reference-morph .morph span:last-child { display: none; }
  .samui-reference-menu .char,
  .glass-button-wrap,
  .glass-button,
  .glass-button:after,
  .glass-button-shadow,
  .glass-button-shadow:after,
  .glass-button-text,
  .glass-button-text:after,
  .samui-shiny,
  .samui-shiny::before,
  .samui-shiny::after,
  .samui-shiny span::before { transition: none !important; transform: none !important; animation: none !important; }
}

@media (forced-colors: active) {
  .samui-reference-banner.banner,
  .glass-button { border: 1px solid ButtonText; }
  .samui-reference-banner .flow,
  .glass-button-shadow,
  .glass-button:after,
  .glass-button-text:after { display: none; }
}
