/* Shared surfaces carry the color, highlights, rounded edges and focus
   treatment into every page represented in the preview. */
:root {
  color-scheme: light;
  --page: #f6f1fb;
  --page-glow: #e2d4fb54;
  --heading-size: clamp(27px, 3.6vw, 43px);
  --paper: #fffdff;
  --soft: #f1e8fb;
  --line: #dfd0f0;
  --text: #2a2041;
  --muted: #675c7b;
  --accent: #693fb0;
  --focus: #7246be;
  --shell-shadow: 0 14px 38px #6a45871b, inset 0 1px #fff;
  --width: 1376px;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-synthesis: none;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --page: #181427;
  --page-glow: #65418a32;
  --paper: #271e38;
  --soft: #30243f;
  --line: #544067;
  --text: #f9edf8;
  --muted: #d5bedf;
  --accent: #e5bcff;
  --focus: #dca9ff;
  --shell-shadow: 0 12px 42px #10081980, inset 0 1px #f7e4ff15;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body.jelly-site, html[data-theme="dark"] body.jelly-site {
  margin: 0;
  background: radial-gradient(ellipse at 15% 5%, var(--page-glow), transparent 40%), var(--page);
  color: var(--text);
}
:where(.site-chrome, .site-footer) a { color: inherit; text-decoration: none; }
.site-chrome :is(button, input) { font: inherit; color: inherit; }
.site-chrome button { cursor: pointer; }
.site-chrome img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  z-index: 20;
  top: 14px;
  left: 14px;
  padding: 10px 16px;
  border-radius: 12px;
  transform: translateY(-160%);
  background: var(--paper);
}
.skip-link:focus { transform: none; }
body.jelly-site #top:focus { outline: none; }
.site-chrome {
  position: relative;
  z-index: 3;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 91%, transparent);
  box-shadow: 0 3px 25px #5b3c7d0c;
}
.chrome-inner {
  width: min(var(--width), calc(100% - 48px));
  min-height: 75px;
  display: flex;
  gap: clamp(12px, 2vw, 25px);
  align-items: center;
  margin-inline: auto;
}
.brand-plaque {
  flex: 0 0 auto;
  display: grid;
  width: 178px;
  height: 48px;
  border: 1px solid #7051a8;
  border-radius: 19px;
  place-items: center;
  background:
    radial-gradient(ellipse at 22% -42%, #c3a8ff98, transparent 66%),
    linear-gradient(155deg, #594086, #2d214e 63%, #4f3578);
  box-shadow: inset 0 1px #ecd5ff91, inset 0 -3px 2px #1e153b55, 0 4px 11px #44276537;
}
.brand-plaque img { width: 154px; height: auto; transform: translateY(-1px); }
.main-nav {
  display: flex;
  flex: 1 1 auto;
  gap: 4px;
  min-width: 0;
  align-items: center;
  white-space: nowrap;
}
.main-nav a {
  display: inline-flex;
  min-height: 40px;
  padding: 0 clamp(6px, .74vw, 13px);
  align-items: center;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--muted);
  font-size: clamp(12px, 1.01vw, 15px);
  font-weight: 700;
}
.main-nav a:hover { color: var(--accent); background: var(--soft); }
.main-nav a[aria-current] {
  border-color: #d0b8f0;
  background: linear-gradient(#fbf5ff, #e7d5ff);
  box-shadow: inset 0 1px #fff, inset 0 -2px #b58ed428;
  color: #492c75;
}
html[data-theme="dark"] .main-nav a[aria-current] {
  border-color: #694c8f; color: #f5e4ff;
  background: linear-gradient(#553a77, #3d2e56); box-shadow: inset 0 1px #e6bbff42;
}
.chrome-actions { display: flex; gap: 9px; align-items: center; min-width: 0; }
.site-search {
  display: flex;
  width: clamp(144px, 15vw, 226px);
  min-height: 40px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  box-shadow: inset 0 2px 5px #6b469c16;
}
.site-search input {
  width: 100%;
  min-width: 0;
  padding: 8px 0 8px 12px;
  border: 0;
  outline-offset: 0;
  border-radius: 12px;
  background: transparent;
  font-size: 13px;
}
.site-search input::placeholder { color: var(--muted); opacity: 1; }
.site-search button {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: none;
}
.site-search button i {
  position: relative;
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent);
  border-radius: 50%;
}
.site-search button i::after {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 6px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(45deg);
  transform-origin: left center;
  content: "";
}

/* The raised edge survives hover. Pressing compresses the whole button,
   so the label and arrow follow the same motion. */
.gel-button {
  --gel-bright: #aa81ec;
  --gel-body: #7647ba;
  --gel-bottom: #5b3399;
  --gel-edge: #6c42ad;
  --gel-ink: #fff;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  min-height: 49px;
  padding: 9px 16px;
  gap: 12px;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--gel-edge);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 50% -64%, #fff8 0%, transparent 68%),
    linear-gradient(180deg, var(--gel-bright), var(--gel-body) 62%, var(--gel-bottom));
  box-shadow: inset 0 1px 1px #fffd, inset 0 -3px #2c164b24, 0 5px 10px #58377939;
  color: var(--gel-ink);
  white-space: nowrap;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  transition: transform 240ms cubic-bezier(.2,.94,.45,1.45), box-shadow 160ms ease, filter 160ms ease;
}
.gel-button::before {
  position: absolute;
  z-index: -1;
  inset: 2px 5px auto;
  height: 44%;
  border-radius: 13px 13px 9px 9px;
  background: linear-gradient(#fff3, transparent);
  pointer-events: none;
  content: "";
}
.gel-button:hover { transform: translateY(-2px); filter: brightness(1.045); }
.gel-button:active { transform: translateY(2px) scale(.956,.94); box-shadow: inset 0 1px #fffa, 0 2px 4px #56377928; }
.gel-small { min-height: 39px; padding: 5px 14px; border-radius: 13px; font-size: 13px; }
.gel-mint {
  --gel-bright: #ecfff4; --gel-body: #a4dec8; --gel-bottom: #7fc0ad;
  --gel-edge: #78b49f; --gel-ink: #174f44;
}
.gel-peach {
  --gel-bright: #fff1ec; --gel-body: #f0bfbe; --gel-bottom: #e2a1ac;
  --gel-edge: #d795a5; --gel-ink: #73394c;
}
.gel-lilac {
  --gel-bright: #fffcff; --gel-body: #dac3f7; --gel-bottom: #c5a4ee;
  --gel-edge: #b998df; --gel-ink: #4b2f73;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 13px;
  width: min(var(--width), calc(100% - 48px));
  margin: 45px auto 0;
  padding: 20px 0 27px;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.site-footer a { color: var(--accent); white-space: nowrap; }

/* The account menu reuses the server's details element and authenticated
   actions. Only the home page colors adapt to the new chrome. */
.site-chrome .account-menu-trigger {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--soft);
  color: var(--accent);
}
.site-chrome .account-menu-avatar { background: var(--accent); color: var(--paper); }
.site-chrome .account-menu-panel {
  border-color: var(--line);
  background: var(--paper);
  color: var(--text);
}
.site-chrome .account-menu-full-name,
.site-chrome .account-menu-item { color: var(--text); }
.site-chrome .account-menu-item:hover { background: var(--soft); }
.site-chrome .account-menu-details { border-color: var(--line); }
.site-chrome .account-menu-details dt { color: var(--muted); }
.site-chrome .account-menu-details dd { color: var(--text); }
.site-footer .footer-links { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.site-footer .footer-links form { margin: 0; }

/* The inner pages use a compact local control. Only the homepage includes
   the larger bird and its drag treatment. */
.site-theme-switch {
  display: grid;
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(155deg, var(--paper), var(--soft));
  box-shadow: inset 0 1px #ffffff45, 0 3px 7px #5e437923;
}
.site-theme-switch:hover { background: var(--soft); }
.site-theme-icon { position: relative; width: 18px; height: 18px; color: var(--accent); }
.site-theme-icon::before {
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  box-shadow: inset -6px -4px currentColor;
  content: "";
}
.site-theme-switch[aria-pressed="true"] .site-theme-icon::before {
  inset: 4px;
  border: 2px solid currentColor;
  box-shadow: none;
}
.site-theme-switch[aria-pressed="true"] .site-theme-icon::after {
  position: absolute;
  inset: 8px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 -7px, 0 7px, -7px 0, 7px 0, -5px -5px, 5px -5px, -5px 5px, 5px 5px;
  content: "";
}

@media (max-width: 1120px) {
  .chrome-inner { flex-wrap: wrap; gap: 8px 13px; padding: 10px 0 6px; }
  .chrome-actions { margin-left: auto; }
  .main-nav { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: thin; }
  .main-nav a { min-height: 36px; }
}
@media (max-width: 760px) {
  .chrome-inner, .site-footer { width: calc(100% - 28px); }
  .brand-plaque { width: 129px; height: 39px; border-radius: 13px; }
  .brand-plaque img { width: 114px; }
  .chrome-inner { gap: 9px; }
  .chrome-actions { gap: 6px; flex: 1 1 auto; justify-content: flex-end; }
  .site-search { width: clamp(82px, 31vw, 200px); min-height: 36px; }
  .site-search input { padding: 6px 0 6px 7px; font-size: 11px; }
  .site-search button { width: 28px; height: 30px; }
  .chrome-actions .gel-small { min-height: 36px; padding-inline: 11px; }
  .main-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    overflow: visible;
  }
  .main-nav a { min-height: 34px; justify-content: center; padding-inline: 4px; font-size: clamp(11px, 3.1vw, 13px); }
  .site-theme-switch { width: 40px; height: 40px; }
  .jelly-site:not(.jelly-home) .site-search { flex: 0 1 auto; min-width: 0; }
  .site-footer { flex-wrap: wrap; }
}
@media (max-width: 347px) {
  .chrome-inner { gap: 5px; }
  .brand-plaque { width: 110px; }
  .brand-plaque img { width: 101px; }
  .site-search { width: clamp(80px, 30vw, 96px); }
  .jelly-site:not(.jelly-home) .brand-plaque { width: 103px; }
  .jelly-site:not(.jelly-home) .brand-plaque img { width: 94px; }
  .jelly-site:not(.jelly-home) .chrome-actions { gap: 5px; }
  .jelly-site:not(.jelly-home) .site-search { width: 78px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-chrome .gel-button { transition: none; }
  .site-chrome .gel-button:is(:hover, :active) { transform: none; }
}
