@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;700;800&display=swap");

:root {
  color-scheme: light;
  --bg: #f3f4f6;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --panel: #f8f8f7;
  --text: #25272d;
  --muted: #858992;
  --dim: #b8bbc2;
  --line: rgba(33, 36, 44, 0.1);
  --line-strong: rgba(33, 36, 44, 0.18);
  --accent: #5d6470;
  --accent-soft: rgba(93, 100, 112, 0.1);
  --shadow-soft: 0 12px 36px rgba(33, 36, 44, 0.1);
  --radius: 14px;
  --font: "Inter", "Noto Sans SC", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.45;
  letter-spacing: 0;
}

body.no-scroll {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
}

[hidden],
.is-hidden {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(190px, auto) minmax(260px, 760px) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 18px 8px;
  background: linear-gradient(180deg, rgba(243, 244, 246, 0.98), rgba(243, 244, 246, 0.72));
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-solid);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.brand-text {
  display: grid;
  gap: 0;
}

.brand-text strong {
  font-size: 13px;
  font-weight: 800;
}

.brand-text small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.command-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 48px;
  padding: 0 8px 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.command-search:focus-within {
  border-color: var(--line-strong);
  background: var(--surface-solid);
}

.command-search svg,
.language-toggle svg,
.close-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.command-search svg {
  color: var(--accent);
}

.command-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.command-search input::placeholder {
  color: #c3c5ca;
}

.command-search button,
.language-toggle,
.nav-links a,
.ghost-button,
.load-more,
.detail-links a,
.detail-links button,
.prompt-mode-toggle button,
.primary-button,
.secondary-button,
.active-filters button {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.command-search button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
}

.nav-links {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.language-toggle,
.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 12px;
  white-space: nowrap;
}

.language-toggle:hover,
.nav-links a:hover,
.command-search button:hover,
.ghost-button:hover,
.load-more:hover,
.detail-links a:hover,
.detail-links button:hover,
.primary-button:hover,
.secondary-button:hover,
.active-filters button:hover {
  border-color: var(--line-strong);
  background: var(--surface-solid);
}

.language-toggle {
  gap: 2px;
  padding: 3px;
}

.language-toggle span {
  display: grid;
  place-items: center;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--muted);
  line-height: 1;
}

.language-toggle span.is-active {
  background: #111318;
  color: #ffffff;
}

.explore-shell {
  width: 100%;
  margin: 0;
  padding: 0 4px 64px;
}

.explore-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 0 14px 4px;
}

.feed-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.feed-kicker strong {
  font-size: 13px;
  font-weight: 800;
}

.feed-kicker span,
.gallery-head p:last-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.stat-grid {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-grid div {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
}

.stat-grid strong {
  font-size: 12px;
  font-weight: 800;
}

.stat-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.control-panel {
  position: sticky;
  top: 66px;
  z-index: 40;
  display: grid;
  gap: 6px;
  padding: 0 10px 8px;
  background: linear-gradient(180deg, rgba(243, 244, 246, 0.94), rgba(243, 244, 246, 0.72));
  backdrop-filter: blur(16px);
}

.media-mode-tabs {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.media-mode-tabs button {
  min-height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.media-mode-tabs button:hover {
  color: var(--text);
}

.media-mode-tabs button.is-active {
  background: #111318;
  color: #ffffff;
}

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

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

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  white-space: nowrap;
}

.category-pill span {
  font-size: 12px;
  font-weight: 750;
}

.category-pill strong {
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
}

.category-pill:hover,
.category-pill.is-active {
  border-color: var(--line-strong);
  background: var(--surface-solid);
  color: var(--text);
}

.filter-panel {
  width: 100%;
  overflow-x: auto;
  padding: 2px 0 5px;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.filter-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  gap: 6px;
  width: max-content;
  min-width: 100%;
  padding-right: 4px;
}

.filter-row label {
  display: grid;
  flex: 0 0 auto;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-row select {
  min-width: 142px;
  height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: var(--surface-solid);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.filter-row select:focus {
  border-color: var(--line-strong);
}

#modelFilter {
  width: 180px;
}

#durationFilter {
  width: 168px;
}

#creatorFilter {
  width: 220px;
}

#timeFilter {
  width: 164px;
}

#sortSelect {
  width: 150px;
}

.ghost-button {
  min-height: 34px;
  padding: 0 12px;
}

.ghost-button.is-active {
  border-color: var(--line-strong);
  background: #111318;
  color: #ffffff;
}

.active-filters {
  min-height: 0;
}

.active-filters:empty {
  display: none;
}

.active-filters button {
  min-height: 26px;
  margin: 0 5px 4px 0;
  padding: 0 9px;
  background: var(--surface-solid);
  color: var(--muted);
}

.active-filters button span {
  color: var(--text);
}

.gallery-section {
  padding: 0;
}

.gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  padding: 0 10px 4px;
}

.eyebrow {
  display: none;
}

.gallery-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
}

.gallery-head p:last-child {
  margin: 0;
}

.gallery {
  column-count: 6;
  column-gap: 4px;
  min-height: 520px;
}

.prompt-card {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 0 0 4px;
  overflow: hidden;
  break-inside: avoid;
  border: 0;
  border-radius: 4px;
  background: #e8eaee;
  transform: translateZ(0);
}

.card-media {
  position: relative;
  display: block;
  width: 100%;
  min-height: clamp(150px, 15vw, 230px);
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #e8eaee;
  color: inherit;
}

.card-media img {
  display: block;
  width: 100%;
  height: auto;
  min-height: clamp(150px, 15vw, 230px);
  object-fit: cover;
  transition: transform 180ms ease, filter 180ms ease;
}

.prompt-card:hover .card-media img,
.prompt-card:focus-within .card-media img {
  transform: scale(1.012);
  filter: saturate(1.03);
}

.image-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 56%, rgba(0, 0, 0, 0.48));
  opacity: 0;
  transition: opacity 160ms ease;
}

.video-play-badge {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  background: rgba(18, 20, 24, 0.68);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  transition: transform 160ms ease, background 160ms ease;
}

.model-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  max-width: calc(100% - 56px);
  padding: 4px 7px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 4px;
  background: rgba(18, 20, 24, 0.72);
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.video-play-badge span {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid #ffffff;
}

.prompt-card:hover .video-play-badge,
.prompt-card:focus-within .video-play-badge {
  background: rgba(18, 20, 24, 0.86);
  transform: scale(1.06);
}

.prompt-card:hover .image-sheen,
.prompt-card:focus-within .image-sheen {
  opacity: 1;
}

.card-overlay {
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  z-index: 2;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.prompt-card:hover .card-overlay,
.prompt-card:focus-within .card-overlay {
  opacity: 1;
  transform: translateY(0);
}

.card-overlay div {
  min-width: 0;
  padding: 6px 7px;
  border-radius: 8px;
  background: rgba(20, 21, 24, 0.72);
  color: #fff;
  backdrop-filter: blur(14px);
}

.card-overlay span,
.detail-meta {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.card-overlay strong {
  display: block;
  max-width: 210px;
  margin-top: 3px;
  overflow: hidden;
  color: #ffffff;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-overlay button {
  min-width: 48px;
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  background: rgba(20, 21, 24, 0.76);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  pointer-events: auto;
  backdrop-filter: blur(14px);
}

.load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(320px, calc(100% - 24px));
  min-height: 42px;
  margin: 16px auto 0;
  padding: 0 16px;
}

.topic-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin: 28px 14px 12px;
  padding: 20px 0 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.topic-footer strong {
  color: var(--text);
}

.topic-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
}

.topic-footer a:hover,
.topic-footer a:focus-visible {
  color: var(--text);
  text-decoration: underline;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 32px;
  border-radius: 14px;
  background: var(--surface-solid);
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  font-size: 21px;
}

.empty-state p {
  margin: 8px 0 16px;
  color: var(--muted);
}

.empty-state button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-solid);
  color: var(--text);
  font-weight: 800;
}

.detail-dialog {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #f7f7f5;
  color: var(--text);
}

.detail-dialog::backdrop {
  background: rgba(247, 247, 245, 0.88);
  backdrop-filter: blur(8px);
}

.dialog-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px) 88px;
  width: 100vw;
  height: 100dvh;
  max-height: none;
}

.close-button {
  position: absolute;
  top: 86px;
  right: 526px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #3a3d44;
  box-shadow: 0 8px 24px rgba(33, 36, 44, 0.08);
}

.dialog-image-wrap {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 100dvh;
  padding: 76px 44px 34px;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 35%, rgba(232, 225, 220, 0.62), transparent 32%),
    radial-gradient(circle at 78% 52%, rgba(229, 234, 241, 0.88), transparent 42%),
    #f7f7f5;
}

.dialog-image-wrap img,
.dialog-image-wrap video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100dvh - 112px);
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 14px 48px rgba(33, 36, 44, 0.12);
}

.dialog-image-wrap video {
  width: min(100%, 1120px);
  background: #0d0f12;
}

.dialog-image-wrap.is-video {
  background: #111318;
}

.dialog-image-wrap.has-placeholder {
  background: #f0f1f2;
}

.dialog-content {
  min-width: 0;
  height: 100dvh;
  overflow: auto;
  padding: 86px 36px 34px;
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
}

.detail-meta {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 11px;
}

.dialog-content h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}

.detail-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 13px 0 16px;
}

.detail-facts span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f1f2f4;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
}

.detail-links a,
.detail-links button {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  background: #f7f7f7;
}

.detail-links .is-disabled {
  display: none;
}

.prompt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 8px;
}

.prompt-toolbar > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.prompt-mode-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f4f5f6;
}

.prompt-mode-toggle button {
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.prompt-mode-toggle button.is-active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 5px rgba(33, 36, 44, 0.08);
}

#detailPrompt {
  min-height: 300px;
  max-height: 46vh;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 0;
  border: 0;
  background: transparent;
  color: #343741;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.62;
}

.dialog-actions {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
}

.copy-status {
  position: absolute;
  left: 0;
  bottom: calc(100% + 7px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #b8dec9;
  border-radius: 8px;
  background: #effaf4;
  color: #17663a;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.copy-status::before {
  content: "\2713";
  font-size: 14px;
  line-height: 1;
}

.copy-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.primary-button,
.secondary-button {
  min-height: 40px;
  padding: 0 14px;
}

.primary-button {
  border-color: #111318;
  background: #111318;
  color: #ffffff;
}

.detail-rail {
  height: 100dvh;
  overflow-y: auto;
  padding: 8px 10px 12px;
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.rail-thumb {
  position: relative;
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 0 8px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 9px;
  background: #eceef1;
}

.rail-thumb.is-video::after {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 7px solid #ffffff;
  content: "";
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
}

.rail-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rail-thumb:hover,
.rail-thumb.is-active {
  border-color: #111318;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 80;
  min-width: 180px;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, 10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.info-page main {
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
  padding: 42px 0 78px;
}

.info-hero {
  padding: 22px 0 14px;
}

.studio-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.info-hero h1 {
  margin: 0;
  color: var(--text);
  font-size: 46px;
  line-height: 0.98;
}

.info-panel {
  margin: 10px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
}

.info-panel h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 18px;
}

.info-panel p,
.info-panel li {
  color: #4b4f59;
  font-size: 14px;
  line-height: 1.7;
}

.info-panel p {
  margin: 0;
}

.info-panel ul {
  margin: 0;
  padding-left: 18px;
}

.info-panel a {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 1800px) {
  .gallery {
    column-count: 5;
  }
}

@media (max-width: 1400px) {
  .gallery {
    column-count: 4;
  }
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .nav-links {
    grid-column: 1 / -1;
    justify-content: end;
  }

  .control-panel {
    top: 112px;
  }

  .stat-grid {
    display: none;
  }

  .gallery {
    column-count: 3;
  }

  .dialog-shell {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px) 78px;
  }

  .close-button {
    right: 466px;
  }

  .rail-thumb {
    width: 56px;
    height: 56px;
  }
}

@media (max-width: 900px) {
  .topbar {
    position: sticky;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }

  .brand {
    display: none;
  }

  .nav-links {
    grid-column: auto;
    justify-content: space-between;
  }

  .control-panel {
    position: static;
    padding: 0 8px 6px;
  }

  .explore-head {
    padding: 0 8px 4px;
  }

  .gallery {
    column-count: 2;
    column-gap: 4px;
  }

  .dialog-shell {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .detail-rail {
    display: none;
  }

  .close-button {
    position: fixed;
    top: 14px;
    right: 14px;
  }

  .dialog-image-wrap {
    height: auto;
    min-height: 52dvh;
    padding: 58px 14px 12px;
  }

  .dialog-image-wrap img,
  .dialog-image-wrap video {
    max-height: 58dvh;
  }

  .dialog-content {
    height: auto;
    min-height: 42dvh;
    padding: 18px 18px 28px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  #detailPrompt {
    max-height: none;
    font-size: 14px;
  }
}

@media (max-width: 620px) {
  .topbar {
    padding: 6px;
  }

  .info-page main {
    width: calc(100% - 20px);
    padding-top: 24px;
  }

  .info-hero h1 {
    font-size: 34px;
  }

  .command-search {
    min-height: 44px;
    border-radius: 12px;
  }

  .media-mode-tabs {
    width: 100%;
  }

  .media-mode-tabs button {
    flex: 1;
  }

  .gallery {
    column-count: 2;
    column-gap: 3px;
  }

  .prompt-card {
    margin-bottom: 3px;
    border-radius: 4px;
  }

  .card-overlay {
    right: 4px;
    bottom: 4px;
    left: 4px;
  }

  .card-overlay div {
    max-width: calc(100% - 56px);
    padding: 5px 6px;
  }

  .card-overlay strong {
    max-width: 100%;
    font-size: 10px;
  }

  .card-overlay button {
    min-width: 44px;
    min-height: 28px;
  }

  .dialog-actions {
    grid-template-columns: 1fr;
  }

  .topic-footer {
    display: block;
    margin-inline: 8px;
  }

  .topic-footer nav {
    justify-content: flex-start;
    margin-top: 10px;
  }
}

@media (max-width: 340px) {
  .gallery {
    column-count: 1;
  }
}
