:root {
  color-scheme: dark;
  --page: #101112;
  --surface: #191a1b;
  --line: #2e2f31;
  --ink: #f3f0e9;
  --muted: #b3b3b1;
  --accent: #eee4ce;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--page);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, video:focus-visible, pre:focus-visible {
  outline: 2px solid #f5d38c;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.shell { width: min(1192px, calc(100% - 96px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid #242526; }
.brand {
  min-height: 71px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 620;
  letter-spacing: .042em;
}
.brand-mark { display: block; flex: none; }
.library { padding-block: 54px 72px; }
h1 { margin: 0 0 34px; font-size: clamp(36px, 4.9vw, 63px); font-weight: 655; line-height: 1.13; letter-spacing: -.058em; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 19px; }
.filters button {
  min-height: 42px;
  padding: 7px 19px;
  border: 1px solid #353638;
  border-radius: 999px;
  background: #18191a;
  color: #c2c2c0;
  font-size: 14px;
  font-weight: 580;
  white-space: nowrap;
}
.filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #201a11; }
.filters button:hover:not([aria-pressed="true"]) { background: #212223; color: var(--ink); }
.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 20px;
}
.catalog[data-featured] { grid-template-columns: minmax(0,1fr); }
.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}
.preview {
  position: relative;
  align-self: start;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1e272f;
}
video { display: block; width: 100%; height: 100%; object-fit: cover; }
.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 65px;
  height: 65px;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 1px solid #ffffff77;
  border-radius: 50%;
  background: #14171bc9;
  color: #fff9ed;
  backdrop-filter: blur(10px);
  transition: background .16s, border-color .16s;
}
.play-button:hover, .play-button:focus-visible { background: #191715; border-color: #fff1d8; }
.play-button svg { width: 29px; height: 29px; margin-left: 1px; }
.play-button[data-loading] { cursor: wait; }
.play-button[data-loading] svg { visibility: hidden; }
.play-button[data-loading]::after {
  position: absolute;
  width: 25px;
  height: 25px;
  border: 2px solid #ffffff44;
  border-top-color: var(--accent);
  border-radius: 50%;
  content: "";
  animation: turn .75s linear infinite;
}
@keyframes turn { to { rotate: 1turn; } }
.copy-button {
  position: absolute;
  z-index: 2;
  inset: 14px 14px auto auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #ffffff3d;
  border-radius: 12px;
  background: #191918ec;
  color: #faf6ed;
  backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  translate: 0 -4px;
  pointer-events: none;
  transition: opacity .18s, translate .18s, background .13s;
}
.copy-icon { width: 19px; height: 19px; flex: none; }
.card:hover .copy-button, .card:focus-within .copy-button { opacity: 1; translate: none; pointer-events: auto; }
.copy-button:hover { background: #282725; }
.copy-button[data-copied] { border-color: #e9cc8a; color: #f4d596; }
.duration {
  position: absolute;
  inset: auto 13px 13px auto;
  padding: 4px 7px;
  border-radius: 6px;
  background: #111416d9;
  color: #fdfbf4;
  font: 560 12px/1.25 -apple-system, BlinkMacSystemFont, sans-serif;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.video-error {
  position: absolute;
  inset: auto 16px 17px 16px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: #111416e8;
  color: var(--ink);
  text-align: center;
  font-size: 13px;
}
.card-body {
  min-width: 0;
  flex: 1;
  padding: 23px 24px 25px;
  display: flex;
  flex-direction: column;
  align-items: start;
}
.card h2 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 640; letter-spacing: -.045em; }
.description { margin: 10px 0 20px; color: var(--muted); font-size: 15px; line-height: 1.68; }
.view-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  margin-top: auto;
  padding: 8px 13px;
  border: 1px solid #3c3a36;
  border-radius: 10px;
  background: #22211f;
  color: var(--accent);
  font-size: 14px;
  font-weight: 580;
}
.view-button svg { width: 18px; height: 18px; }
.view-button:hover { background: #2b2924; border-color: #5e5647; }
.empty { margin: 16px 0; color: var(--muted); }

@media (min-width: 875px) {
  .catalog[data-featured] .card {
    display: grid;
    grid-template-columns: minmax(0, 2.32fr) minmax(0, 1fr);
    align-items: stretch;
  }
  .catalog[data-featured] .card-body {
    justify-content: center;
    padding: clamp(24px, 3.3vw, 50px);
    border-left: 1px solid var(--line);
  }
  .catalog[data-featured] h2 { font-size: clamp(30px, 3.0vw, 43px); }
  .catalog[data-featured] .description { margin: 14px 0 25px; max-width: 16em; }
  .catalog[data-featured] .view-button { margin-top: 0; }
}
@media (max-width: 700px) {
  .shell { width: calc(100% - 36px); }
  .brand { min-height: 61px; font-size: 15px; gap: 9px; }
  .brand-mark { width: 30px; height: 30px; }
  .library { padding-block: 34px 45px; }
  h1 { margin-bottom: 23px; font-size: 38px; }
  .filters { margin-bottom: 15px; }
  .card { border-radius: 16px; }
  .card-body { padding: 18px 19px 19px; }
  .card h2 { font-size: 25px; }
  .description { margin: 8px 0 14px; font-size: 14px; }
  .play-button { width: 53px; height: 53px; }
  .play-button svg { width: 24px; height: 24px; }
  .copy-button { inset: 10px 10px auto auto; padding-inline: 9px; gap: 5px; }
  .duration { inset: auto 10px 10px auto; }
}
@media (any-hover: none), (pointer: coarse) {
  .copy-button { opacity: 1; translate: none; pointer-events: auto; }
}
dialog {
  width: min(640px, calc(100% - 32px));
  max-height: calc(100dvh - 36px);
  margin: auto;
  padding: 0;
  border-radius: 17px;
  border: 1px solid #3a3b3d;
  background: #1b1d1e;
  color: var(--ink);
}
dialog::backdrop { background: #050607c7; }
.dialog-inner { display: grid; gap: 15px; padding: clamp(16px, 3vw, 27px); }
.dialog-head, .dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head h2 { margin: 0; font-size: clamp(20px, 4vw, 25px); letter-spacing: -.027em; }
.close-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #3b3b3a;
  border-radius: 10px;
  padding: 0;
  background: #242526;
}
.close-button:hover { background: #323436; }
.close-button svg { width: 21px; height: 21px; }
pre {
  max-height: min(57dvh, 470px);
  margin: 0;
  padding: 15px 16px;
  background: #121415;
  border: 1px solid #2e3032;
  border-radius: 10px;
  color: #e2ded5;
  font: 14px/1.78 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow-y: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.dialog-foot a { color: var(--muted); font-size: 14px; text-underline-offset: 3px; }
.primary-button {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #261e13;
  font-size: 14px;
  font-weight: 620;
}
.primary-button:hover { background: #fff0d5; }
.copy-error { margin: 0; color: #f2cfac; font-size: 14px; }
.visually-hidden, .clipboard-buffer {
  position: fixed;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
  .play-button[data-loading]::after { animation: none; }
}
