:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #191a1c;
  background: #fafaf8;
  -webkit-font-smoothing: antialiased;
  --paper: #fafaf8;
  --ink: #191a1c;
  --muted: #626365;
  --line: #deded9;
  --accent: #1559a6;
  --ease: cubic-bezier(.22,.75,.22,1);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, summary { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
button { padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:where(a, button, input, summary, [tabindex]):focus-visible { outline: 2px solid #176ed2; outline-offset: 3px; }

.icon-definitions, .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  pointer-events: none;
}
.icon { flex: none; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.shell {
  --shell-width: min(1280px, calc(100% - clamp(48px, 9vw, 160px)));
  width: var(--shell-width);
  margin-inline: auto;
  padding-bottom: calc(105px + env(safe-area-inset-bottom));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 610;
  letter-spacing: -.025em;
}
.brand img { display: block; object-fit: contain; color-scheme: light; }
.search-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  border-radius: 5px;
  color: #464b4d;
  text-decoration: none;
  font-size: 14px;
}
.search-shortcut .icon { width: 17px; height: 17px; }
.search-shortcut:hover { color: var(--ink); }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: clamp(150px, 18vw, 225px);
  min-height: 41px;
  padding: 0 13px;
  background: #eeefec;
  color: #606362;
  border: 1px solid transparent;
  border-radius: 13px;
}
.search-box:focus-within { border-color: #7294b9; box-shadow: 0 0 0 2px #5989b621; }
.search-box .icon { width: 17px; height: 17px; }
.search-box input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}
.search-box input::placeholder { color: #666967; font-size: 14px; opacity: 1; }

.collection { min-height: 100vh; min-height: 100svh; }
.collection:focus { outline: none; }
.collection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: clamp(25px, 3.6vw, 48px) 0 clamp(19px, 2.2vw, 31px);
}
.collection-head h1 {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  min-width: 0;
  margin: 0;
  font-size: clamp(34px, 3.7vw, 52px);
  font-weight: 690;
  line-height: 1.12;
  letter-spacing: -.065em;
}
.collection-tools { display: flex; align-items: center; justify-content: flex-end; gap: clamp(12px, 2vw, 30px); }
.title-count {
  padding-top: .37em;
  color: var(--muted);
  font-size: clamp(15px, 1.35vw, 19px);
  font-weight: 520;
  line-height: 1;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
.filters { display: flex; gap: 3px; align-items: center; }
.segment {
  position: relative;
  min-width: 47px;
  min-height: 44px;
  padding-inline: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 540;
}
.segment::after {
  content: "";
  position: absolute;
  inset: auto 12px 3px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform 180ms var(--ease);
}
.segment.active { color: var(--ink); font-weight: 670; }
.segment.active::after { transform: scaleX(1); }
.segment:hover { color: var(--ink); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 2.5vw, 37px) clamp(14px, 1.8vw, 26px);
  align-items: start;
}
.card { position: relative; min-width: 0; }
.card:has(.more[open]) { z-index: 4; }

.stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 1.76;
  color: #e9ecf9;
  background: #171e2a;
  border-radius: 19px;
}
.stage.complex-preview { background: radial-gradient(ellipse at 52% 48%, #29375a, #12192b 80%); }
.stage i { display: block; font-style: normal; }
.stage.offscreen *, .stage.offscreen *::before, .stage.offscreen *::after { animation-play-state: paused !important; }

.stage-open {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}
.stage-open:focus-visible { outline-offset: -5px; outline-color: white; box-shadow: inset 0 0 0 6px #20283770; }

.media-controls {
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  padding: 1px;
  border: 1px solid #ffffff52;
  border-radius: 999px;
  background: #28303b94;
  color: white;
  box-shadow: inset 0 1px 0 #ffffff29, 0 2px 8px #0002;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .media-controls {
    -webkit-backdrop-filter: blur(7px) saturate(135%);
    backdrop-filter: blur(7px) saturate(135%);
    background: linear-gradient(155deg, #ffffff14, transparent 50%), #17202e83;
  }
}
.media-controls button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 40px;
  border-radius: 999px;
}
.media-controls button:hover { background: #ffffff1c; }
.media-controls button:focus-visible { outline-color: white; outline-offset: -3px; }
.media-controls .icon { width: 17px; height: 17px; }
.favorite-star.active .icon { fill: #ffe2a1; stroke: #ffe2a1; }
.replay:active .icon { transform: rotate(-30deg); }
@media (min-width: 651px) and (hover: hover) and (pointer: fine) {
  .media-controls {
    opacity: 0;
    transform: translateY(3px);
    transition: opacity 150ms, transform 200ms var(--ease);
    pointer-events: none;
  }
  .card:is(:hover, :focus-within) .media-controls, .card.is-favorite .media-controls {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}
@media (pointer: coarse) {
  .media-controls button { width: 44px; height: 44px; }
}

.caption { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 13px 1px 0; }
.caption-text { min-width: 0; }
.caption h3 { margin: 0; font-size: clamp(17px, 1.55vw, 23px); font-weight: 650; line-height: 1.32; letter-spacing: -.037em; }
.title-button { display: inline-block; text-align: start; border-radius: 3px; }
.title-button:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.caption p { margin: 4px 0 0; color: var(--muted); font-size: 13px; font-weight: 420; line-height: 1.45; }
.caption p span { white-space: nowrap; }
.caption p span::before { content: "·"; padding: 0 .45em; color: #828582; }

.card-actions { display: flex; align-items: flex-start; flex: none; margin: -6px -5px 0 0; }
.icon-button, .more > summary {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 39px;
  border-radius: 11px;
  color: #565856;
  cursor: pointer;
}
.icon-button:hover, .more > summary:hover, .more[open] > summary { color: var(--ink); background: #e9eae7; }
.icon-button .icon, .more .icon { width: 17px; height: 17px; }
.icon-button:active, .view:active { scale: .96; }
.card-copy[data-feedback="ok"] { color: #1c6958; }
.card-copy[data-feedback="error"] { color: #ad302e; }
.card-copy[data-feedback]::after {
  content: attr(data-message);
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: calc(100% - 1px);
  width: max-content;
  border-radius: 7px;
  padding: 4px 8px;
  background: #222626;
  color: #fff;
  font-size: 12px;
}
.more { position: relative; }
.more > summary { list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more-panel {
  position: absolute;
  z-index: 6;
  right: 0;
  bottom: calc(100% + 4px);
  width: max-content;
  min-width: 160px;
  max-width: min(245px, 78vw);
  padding: 5px;
  border: 1px solid #dedfda;
  border-radius: 16px;
  background: #fffffd;
  box-shadow: 0 12px 35px #171d2426, 0 2px 5px #121c2610;
}
.more-panel > * {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  padding: 6px 10px;
  border-radius: 11px;
  font-size: 13px;
  text-align: start;
  text-decoration: none;
}
.more-panel > :hover { background: #f0f1ed; }
.more-panel .remove-effect { color: #ad302e; }
.restore-effect {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.restore-effect:hover { background: #e7edf4; }

.empty-state { grid-column: 1/-1; padding: clamp(60px, 9vw, 130px) 15px; text-align: center; color: var(--muted); }
.empty-state .icon { width: 30px; height: 30px; }
.empty-state h3 { margin: 13px 0 6px; color: var(--ink); font-size: 21px; letter-spacing: -.025em; }
.empty-state p { margin: 0; line-height: 1.65; font-size: 14px; }

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 48px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 17px; }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* One floating navigation surface. The refracting rim and diffused centre sample the page behind it. */
.dock {
  --pad: 5px;
  --index: 0;
  --light-x: 34%;
  --light-y: 10%;
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(360px, calc(100% - 28px));
  min-height: 58px;
  padding: var(--pad);
  border-radius: 999px;
  box-shadow: 0 10px 29px -5px #1e263639, 0 2px 6px #13182424, inset 0 0 0 1px #ffffffb8;
}
.dock[data-index="1"] { --index: 1; }
.dock[data-index="2"] { --index: 2; }
.dock-refraction, .dock-surface, .dock-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.dock-refraction {
  overflow: hidden;
  box-shadow: inset 0 1.2px 1.5px #fff, inset 1px 0 2px #fffc, inset -1.5px -2px 3px #384b6538;
  background: linear-gradient(160deg, #ffffffb8, transparent 28%, #c5d3e824 68%, #ffffff8c);
}
.dock-surface {
  inset: 3px;
  background: #efefed;
  box-shadow: inset 0 0 5px #fff9;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .dock-surface {
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    backdrop-filter: blur(12px) saturate(160%);
    background: linear-gradient(175deg, #ffffffe0, #f5f7f966 50%, #f4f5f7a1);
  }
}
.dock::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid #ffffffa6;
  box-shadow: inset 0 -1px 1px #8695ab50, inset 0 1px 1px #fff;
  border-radius: inherit;
  pointer-events: none;
}
.dock-glow {
  border-radius: inherit;
  background: radial-gradient(ellipse 100px 41px at var(--light-x) var(--light-y), #fff 0%, #ffffff8a 35%, transparent 82%);
  opacity: .28;
  transition: opacity 200ms;
}
.dock.is-lit .dock-glow { opacity: .82; }
.dock.is-pressed .dock-glow { opacity: 1; }
.dock-selection {
  position: absolute;
  top: var(--pad);
  bottom: var(--pad);
  left: var(--pad);
  width: calc((100% - 2 * var(--pad)) / 3);
  border-radius: inherit;
  background: #ffffffbc;
  box-shadow: 0 1px 4px #2a354c24, inset 0 .5px 1px #fff;
  transform: translateX(calc(var(--index) * 100%));
  transition: transform 380ms cubic-bezier(.24,.88,.23,1.06), background 180ms;
  pointer-events: none;
}
.dock.is-pressed .dock-selection { background: #ffffffdb; }
.view {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  border-radius: 999px;
  color: #303338;
  font-size: 13px;
  font-weight: 580;
  white-space: nowrap;
  transition: color 150ms, scale 160ms var(--ease);
}
.view .icon { width: 17px; height: 17px; }
.view.active { color: #16181b; font-weight: 700; }
.view.active[data-view="library"] .icon { fill: currentColor; }
.view.active[data-view="favorites"] .icon { fill: currentColor; }
.view:focus-visible { outline-offset: -2px; }
.view-count { color: inherit; font-size: 10px; font-weight: 610; font-variant-numeric: tabular-nums; }

html:has(.dialog[open]) { overflow: hidden; }
.dialog {
  position: fixed;
  inset: 0;
  width: min(660px, calc(100% - 36px));
  max-width: none;
  max-height: none;
  padding: 0;
  margin: auto;
  overflow: hidden;
  border: 1px solid #e2e3dd;
  border-radius: 25px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 26px 96px #171a253d;
}
.dialog::backdrop { background: #171b2266; }
.dialog[open] { animation: sheet-in 220ms var(--ease) both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(9px) scale(.993); } }
.dialog-body { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100vh - 50px); max-height: calc(100dvh - 50px); }
.dialog-head { padding: 21px 27px 16px; }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.dialog-close { flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; background: #eeefeb; }
.dialog-head h2 { margin: 5px 0 7px; font-size: clamp(27px, 3.5vw, 36px); line-height: 1.16; letter-spacing: -.045em; }
.dialog-head p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.prompt {
  min-height: 0;
  padding: 16px 0 18px;
  margin: 0 27px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-block: 1px solid var(--line);
}
.prompt h3 { margin: 0 0 8px; font-size: 14px; }
.prompt pre { margin: 0; color: #414344; font: inherit; font-size: 14px; line-height: 1.68; white-space: pre-wrap; overflow-wrap: anywhere; }
.dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 27px 20px; }
.source-link, .dialog-copy {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 620;
  text-decoration: none;
}
.source-link .icon, .dialog-copy .icon { width: 16px; height: 16px; }
.source-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.dialog-copy { padding: 0 17px; border-radius: 999px; color: white; background: #242628; }
.dialog-copy:hover { background: #3a3c3d; }
.undo-notice {
  position: fixed;
  z-index: 12;
  left: 50%;
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + 71px);
  transform: translate(-50%, 6px);
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100% - 30px);
  padding: 9px 14px;
  border-radius: 15px;
  background: #242629;
  box-shadow: 0 5px 15px #151a2524;
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transition: transform 160ms var(--ease), opacity 160ms, visibility 160ms;
}
.undo-notice.visible { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.undo-notice button { flex: none; min-height: 32px; padding: 0 8px; border-radius: 8px; background: #ffffff24; font-weight: 650; }

@media (max-width: 950px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .shell { --shell-width: calc(100% - 36px); padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  .brand { gap: 7px; font-size: 13px; }
  .brand img { width: 24px; height: 20px; }
  .search-shortcut { font-size: 13px; }
  .search-box { width: min(52%, 196px); min-height: 38px; gap: 6px; padding: 0 10px; }
  .search-box input { min-height: 38px; }
  .collection-head { gap: 12px 14px; padding: 24px 0 16px; }
  .collection-head h1 { align-items: flex-start; gap: 8px; font-size: clamp(30px, 8.2vw, 41px); }
  .collection-tools { width: 100%; gap: 12px; }
  .collection-tools .search-box { margin-inline-start: auto; }
  .title-count { font-size: 13px; padding-top: .31em; }
  .segment { min-width: 34px; padding-inline: 4px; min-height: 41px; font-size: 13px; }
  .segment::after { inset-inline: 5px; bottom: 4px; }
  .grid { grid-template-columns: minmax(0, 1fr); row-gap: 25px; }
  .stage { aspect-ratio: 1.6; border-radius: 17px; }
  .media-controls button { width: 44px; height: 44px; }
  .caption { padding-top: 11px; }
  .caption h3 { font-size: 19px; }
  .caption p { font-size: 12px; }
  .card-actions { margin-top: -4px; }
  .icon-button, .more > summary { width: 44px; height: 44px; }
  .dock { min-height: 55px; width: min(342px, calc(100% - 34px)); bottom: max(12px, env(safe-area-inset-bottom)); }
  .view { min-height: 45px; gap: 4px; }
  .undo-notice { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 66px); }
  .dialog { inset: auto 0 max(7px, env(safe-area-inset-bottom)); width: calc(100% - 14px); border-radius: 24px; }
  .dialog-body { max-height: calc(93vh - env(safe-area-inset-bottom)); max-height: calc(93dvh - env(safe-area-inset-bottom)); }
  .dialog-head { padding: 15px 19px 13px; }
  .prompt { margin-inline: 19px; }
  .dialog-actions { padding: 12px 19px 15px; }
}
@media (max-width: 355px) {
  .shell { --shell-width: calc(100% - 28px); }
  .collection-head { align-items: center; }
  .collection-head h1 { font-size: 30px; }
  .segment { min-width: 31px; }
  .view { gap: 3px; font-size: 12px; }
  .view .icon { width: 15px; }
}
@media (max-height: 450px) {
  .dialog { inset: 0; margin: auto; }
  .dialog-body { max-height: calc(100dvh - 14px); overflow-y: auto; display: block; }
  .dialog-head, .dialog-actions { padding-block: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .dock-selection, .dock-glow, .view, .segment::after, .media-controls, .undo-notice { transition: none; }
  .dialog[open] { animation: none; }
  .view:active, .icon-button:active { scale: 1; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more), (forced-colors: active) {
  .dock-refraction, .dock-glow { display: none; }
  .dock, .dock-surface { background: #e8e9e6; }
  .dock-surface, .media-controls { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .dock { border: 1px solid #787b79; }
  .dock-selection { background: #fff; box-shadow: inset 0 0 0 1px #939693; }
  .media-controls { background: #24272b; }
  .view { color: #161819; }
}
