:root {
  color-scheme: dark;
  --bg: #070707;
  --panel: #111111;
  --panel-2: #171717;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f2f2f2;
  --muted: #a4a4a4;
  --soft: #d4d4d4;
  --accent: #89e33a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 16% 4%, rgba(127, 42, 255, 0.16), transparent 30rem),
    radial-gradient(circle at 88% 0%, rgba(36, 211, 208, 0.13), transparent 28rem),
    linear-gradient(180deg, #080808 0%, #0d0d0d 52%, #070707 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 18px clamp(10px, 2.5vw, 28px) 44px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 12px;
  background: linear-gradient(180deg, rgba(7, 7, 7, 0.96), rgba(7, 7, 7, 0.78));
  backdrop-filter: blur(16px);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.brand-logo {
  display: flex;
  align-items: center;
  margin: 0;
  color: #f4f4f4;
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.brand-logo-main,
.brand-logo-box {
  display: inline-flex;
  align-items: center;
  min-height: 1.22em;
}

.brand-logo-main {
  padding-right: 0.09em;
}

.brand-logo-box {
  border-radius: 0.11em;
  padding: 0 0.16em 0.04em;
  background: #ff9900;
  color: #050505;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-link {
  display: inline-flex;
  min-height: 36px;
  padding: 0 13px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 153, 0, 0.58);
  border-radius: 999px;
  color: #ffd28f;
  background: rgba(255, 153, 0, 0.1);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.home-link:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 153, 0, 0.92);
  background: rgba(255, 153, 0, 0.17);
}

.home-link svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.language-toggle {
  display: inline-grid;
  min-width: 48px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(137, 227, 58, 0.55);
  border-radius: 999px;
  background: rgba(137, 227, 58, 0.1);
  color: #dfffbd;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.language-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(137, 227, 58, 0.9);
  background: rgba(137, 227, 58, 0.16);
}

.category-tabs {
  display: flex;
  gap: 8px;
  padding: 6px 0 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.tab-button {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--soft);
  cursor: pointer;
  white-space: nowrap;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.tab-button[aria-pressed="true"] {
  border-color: rgba(137, 227, 58, 0.65);
  background: rgba(137, 227, 58, 0.14);
  color: #f4ffe9;
}

.search-wrap {
  margin-bottom: 14px;
}

.search-input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.055);
  color: #f2f2f2;
  outline: 0;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-input:focus {
  border-color: rgba(137, 227, 58, 0.62);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 0 0 3px rgba(137, 227, 58, 0.1);
}

.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(226px, 1fr));
  gap: 16px;
}

.tag-card {
  min-width: 0;
  border: 0;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: var(--panel);
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.025);
  transition:
    transform 200ms ease,
    background 200ms ease,
    box-shadow 200ms ease;
}

.tag-card:hover {
  transform: translateY(-4px);
  background: var(--panel-2);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.35);
}

.tag-card:focus-visible,
.home-link:focus-visible,
.language-toggle:focus-visible,
.tab-button:focus-visible,
.close-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.poster {
  position: relative;
  display: grid;
  min-height: 132px;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.08), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.72)),
    #111111;
}

.poster::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(105deg, transparent 0 34%, rgba(255, 255, 255, 0.08) 44%, transparent 54%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 28px);
  opacity: 0.45;
}

.poster::after {
  display: none;
}

.poster-mark {
  position: absolute;
  top: 18px;
  width: 58px;
  height: 42px;
  border-top: 2px solid rgba(255, 255, 255, 0.36);
  opacity: 0.86;
  filter: none;
}

.poster-title {
  width: 100%;
  padding: 0 14px;
  color: #dedede;
  font-family: "Arial Narrow", "DIN Condensed", Impact, sans-serif;
  font-size: clamp(24px, 9vw, 38px);
  font-weight: 500;
  letter-spacing: 5px;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  text-shadow: none;
  word-break: break-word;
}

.card-copy {
  padding: 9px 2px 12px;
}

.card-category {
  display: block;
  padding: 0 8px 3px;
  color: var(--muted);
  font-size: 12px;
}

.card-description {
  display: -webkit-box;
  height: 44px;
  margin: 0;
  padding: 0 8px;
  overflow: hidden;
  color: #e8e8e8;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: clamp(14px, 4vw, 34px);
}

.modal-layer.is-open {
  display: grid;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
  opacity: 0;
  backdrop-filter: blur(14px);
}

.detail-card {
  position: relative;
  width: min(760px, 100%);
  max-height: min(760px, 88vh);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  background: #111111;
  box-shadow: var(--shadow);
  transform-origin: top left;
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  color: #ffffff;
  cursor: pointer;
}

.detail-hero {
  position: relative;
  display: grid;
  min-height: 260px;
  align-content: end;
  gap: 14px;
  padding: 30px clamp(20px, 5vw, 42px);
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.09), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(0, 0, 0, 0.68)),
    #121212;
}

.detail-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, transparent 0 34%, rgba(255, 255, 255, 0.08) 44%, transparent 54%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 30px);
  opacity: 0.46;
}

.detail-category {
  position: relative;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(0, 0, 0, 0.32);
  color: #eeeeee;
  font-size: 13px;
}

.detail-hero h2 {
  position: relative;
  margin: 0;
  color: #eeeeee;
  font-family: "Arial Narrow", "DIN Condensed", Impact, sans-serif;
  font-size: clamp(42px, 10vw, 86px);
  font-weight: 500;
  letter-spacing: 7px;
  line-height: 0.95;
  text-transform: uppercase;
  text-shadow: none;
  word-break: break-word;
}

.detail-content {
  max-height: 38vh;
  overflow: auto;
  padding: clamp(20px, 5vw, 38px) clamp(20px, 5vw, 42px) clamp(24px, 5vw, 42px);
}

.detail-content p {
  margin: 0;
  color: #f1f1f1;
  font-size: clamp(18px, 2.2vw, 23px);
  font-weight: 650;
  line-height: 1.65;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  text-align: center;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .app-shell {
    padding-inline: 8px;
  }

  .topbar {
    padding-top: 12px;
  }

  .top-actions {
    gap: 6px;
  }

  .home-link {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .home-link span {
    display: none;
  }

  .tag-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 8px;
  }

  .poster {
    min-height: auto;
  }

  .poster-title {
    padding-inline: 8px;
    font-size: clamp(18px, 8vw, 28px);
    letter-spacing: 3px;
  }

  .poster-mark {
    top: 12px;
    width: 42px;
    height: 30px;
  }

  .card-copy {
    padding-top: 7px;
  }

  .card-category {
    font-size: 11px;
  }

  .card-description {
    height: 38px;
    padding-inline: 7px;
    font-size: 13px;
    line-height: 19px;
  }

  .detail-card {
    max-height: 86vh;
    border-radius: 10px;
  }

  .detail-hero {
    min-height: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}
