:root {
  color-scheme: light;
  --bg: #fff9f5;
  --panel: #fffefd;
  --panel-soft: #f8eee8;
  --panel-strong: #b64b37;
  --text: #342c29;
  --muted: #786a64;
  --line: #ead9d1;
  --accent: #b64b37;
  --accent-hover: #963c2c;
  --accent-contrast: #fffaf7;
  --accent-soft: #f8e1d9;
  --accent-muted: #964638;
  --pill-bg: #f5eae4;
  --pill-text: #70483f;
  --shadow: 0 20px 64px rgb(129 79 60 / 0.13);
  --radius: 14px;
  font-family:
    "PingFang SC",
    "Microsoft YaHei UI",
    "Microsoft YaHei",
    -apple-system,
    BlinkMacSystemFont,
    "Noto Sans CJK SC",
    ui-sans-serif,
    system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 16% 0%, rgb(237 138 108 / 0.12), transparent 28%),
    linear-gradient(180deg, #fffdfb 0%, var(--bg) 54%, #fff5ef 100%);
  color: var(--text);
}

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

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  width: min(1680px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 36px;
}

.topbar {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand,
.ghost-link {
  display: inline-flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.top-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--accent-contrast);
  font-weight: 850;
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.ghost-link,
.open-link {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 760;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.ghost-link {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
}

.ghost-link-strong {
  border-color: rgb(182 75 55 / 0.62);
  background: var(--accent);
  color: var(--accent-contrast);
}

.ghost-link:hover {
  border-color: var(--accent);
  color: var(--text);
}

.ghost-link-strong:hover {
  color: var(--accent-contrast);
}

.ghost-link:active,
.open-link:active,
.segmented button:active {
  transform: translateY(1px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 28px;
  align-items: end;
  padding: 30px 0 18px;
}

.kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-weight: 780;
}

h1 {
  display: flex;
  margin: 0;
  font-family:
    "DengXian",
    "Microsoft YaHei UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  font-size: clamp(46px, 6.4vw, 88px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.title-accent {
  color: var(--accent);
}

.hero-highlights {
  display: grid;
  max-width: 680px;
  gap: 8px;
  margin-top: 18px;
}

.hero-highlights p {
  display: grid;
  grid-template-columns: 7em minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.5;
}

.hero-highlights strong {
  color: var(--text);
  font-size: 0.92em;
  font-weight: 780;
}

.official-callout {
  display: grid;
  max-width: 680px;
  gap: 12px;
  margin-top: 24px;
  padding: 16px;
  border: 1px solid rgb(182 75 55 / 0.3);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgb(182 75 55 / 0.08), rgb(182 75 55 / 0.02)),
    var(--panel);
  box-shadow: var(--shadow);
}

.official-callout p {
  max-width: 620px;
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}

.official-actions,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.official-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
  font-weight: 760;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.official-link-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}

.official-link:hover {
  border-color: var(--accent);
}

.official-link:active {
  transform: translateY(1px);
}

.controls,
.featured-panel,
.rank-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.hero-panel {
  position: relative;
  display: grid;
  min-height: 244px;
  align-content: space-between;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgb(255 248 244 / 0.12);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 88% 12%, rgb(182 75 55 / 0.38), transparent 36%),
    linear-gradient(145deg, #443631 0%, #2e2725 100%);
  color: #fff8f4;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.08),
    0 24px 64px rgb(77 44 35 / 0.22);
}

.hero-panel-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.hero-panel .panel-label {
  color: #fff8f4;
  font-size: 15px;
  font-weight: 780;
}

.hero-panel-source {
  color: rgb(255 248 244 / 0.58);
  font-size: 12px;
  font-weight: 650;
}

.hero-metric {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin: 26px 0 24px;
}

.panel-label {
  display: block;
  color: var(--muted);
}

.hero-panel strong {
  display: block;
  margin: 0;
  font-family:
    "DengXian",
    "Microsoft YaHei UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  font-size: clamp(76px, 7vw, 104px);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: -0.07em;
  line-height: 0.8;
}

.hero-metric-copy {
  display: grid;
  gap: 4px;
  padding-bottom: 2px;
}

.hero-metric-copy > span {
  color: #fff8f4;
  font-size: 21px;
  font-weight: 760;
  line-height: 1.05;
  white-space: nowrap;
}

.hero-metric-copy small {
  color: rgb(255 248 244 / 0.58);
  font-size: 12px;
  font-weight: 620;
  white-space: nowrap;
}

.hero-panel-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 14px;
  border-top: 1px solid rgb(255 248 244 / 0.14);
  color: rgb(255 248 244 / 0.72);
  font-size: 12px;
  font-weight: 650;
}

.hero-panel-lanes span {
  text-align: center;
}

.hero-panel-lanes span + span {
  border-left: 1px solid rgb(255 248 244 / 0.14);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  padding: 12px;
  margin: 12px 0;
}

.segmented {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
  gap: 4px;
  overflow: visible;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.segmented button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 720;
  white-space: nowrap;
}

.segmented button.is-active {
  background: var(--panel-strong);
  color: var(--accent-contrast);
}

.search {
  display: grid;
  min-height: 42px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  flex: 1 1 260px;
}

.search span {
  color: var(--muted);
  font-size: 14px;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.lane-tabs {
  flex-basis: 520px;
}

#sort-tabs {
  flex-basis: 560px;
}

.compact-toggle {
  flex-basis: auto;
}

.featured-panel,
.rank-panel {
  overflow: hidden;
}

.featured-panel {
  padding: 16px;
  margin-bottom: 14px;
}

.section-head,
.rank-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.section-head {
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.04;
}

.section-head p,
.rank-head p,
.rank-head small {
  color: var(--muted);
}

.section-head p {
  max-width: 42ch;
  margin: 0;
  line-height: 1.55;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 14px;
}

.rank-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.rank-head p,
.rank-head strong {
  margin: 0;
}

.rank-head strong {
  font-size: 24px;
}

.creator-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 14px;
  padding: 14px;
}

.creator-card {
  display: grid;
  min-width: 0;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
  height: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 14px 44px rgb(129 79 60 / 0.1);
}

.creator-card-featured:first-child {
  grid-row: auto;
}

.card-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rank-number {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--accent-contrast);
  font-weight: 820;
}

.badge-list,
.lane-list,
.tag-list {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-list {
  justify-content: flex-end;
}

.lane-list {
  align-content: flex-start;
  min-height: 58px;
  max-height: 58px;
  overflow: hidden;
}

.badge-list span,
.lane-list span,
.tag-list span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.badge-list span {
  background: var(--pill-bg);
  color: var(--pill-text);
}

.lane-list span {
  background: var(--pill-bg);
  color: var(--pill-text);
}

.tag-list span {
  background: var(--accent-soft);
  color: var(--pill-text);
}

.media-grid {
  display: grid;
  height: 250px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 6px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--panel-soft);
}

.media-grid-large {
  height: 390px;
}

.media-block {
  display: grid;
  gap: 10px;
}

.media-cell {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.media-thumb,
.media-grid img {
  width: 100%;
  height: 100%;
}

.media-thumb {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: var(--panel-soft);
  cursor: zoom-in;
}

.media-thumb::after {
  content: "双击看大图";
  position: absolute;
  right: 8px;
  top: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgb(52 44 41 / 0.82);
  color: var(--accent-contrast);
  font-size: 12px;
  font-weight: 720;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.media-reverse {
  width: 100%;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-contrast);
  cursor: pointer;
  font-size: 14px;
  font-weight: 820;
  box-shadow: 0 10px 28px rgb(151 63 45 / 0.16);
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.media-reverse:hover,
.media-reverse:focus-visible {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.media-reverse:focus-visible {
  outline: 3px solid rgb(182 75 55 / 0.22);
  outline-offset: 2px;
}

.media-grid img {
  display: block;
  min-width: 0;
  object-fit: cover;
  transition:
    transform 180ms ease,
    filter 180ms ease;
}

.media-thumb:hover img,
.media-thumb:focus-visible img {
  filter: saturate(1.08) contrast(1.04);
  transform: scale(1.045);
}

.media-thumb:hover::after,
.media-thumb:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.media-thumb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.media-empty {
  place-items: center;
}

.media-empty span {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 28px;
  font-weight: 850;
}

.creator-card-body {
  display: grid;
  grid-template-rows: 52px 58px 63px auto auto;
  align-content: stretch;
  gap: 12px;
  min-width: 0;
  height: 100%;
}

.creator-title-row {
  display: flex;
  min-width: 0;
  min-height: 52px;
  align-items: center;
  gap: 12px;
}

.avatar {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--pill-text);
  font-weight: 820;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.creator-meta {
  display: block;
  min-width: 0;
}

.creator-name {
  display: block;
  overflow: hidden;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.25;
}

.creator-bio {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creator-reason {
  display: -webkit-box;
  min-height: 63px;
  max-height: 63px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.score-pair {
  display: grid;
  min-height: 54px;
  align-content: center;
  border-radius: 8px;
  background: var(--panel-soft);
  text-align: center;
}

.score-pair strong {
  font-size: 20px;
  line-height: 1;
}

.score-pair small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.card-actions {
  display: flex;
  align-self: end;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.open-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--accent-contrast);
}

.open-link-secondary {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
}

.open-link-secondary:hover,
.open-link-secondary:focus-visible {
  border-color: var(--accent);
  color: var(--text);
}

.open-link-small {
  min-height: 32px;
  padding: 0 11px;
  font-size: 13px;
}

.compact-list {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.compact-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.compact-main {
  min-width: 0;
}

.compact-main strong,
.compact-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-main strong {
  display: -webkit-box;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.25;
  white-space: normal;
}

.compact-main small {
  color: var(--muted);
  font-size: 13px;
}

.compact-score {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--pill-text);
  font-weight: 850;
}

.empty-state {
  padding: 32px 20px;
  color: var(--muted);
  text-align: center;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 14px 22px;
  border-top: 1px solid var(--line);
}

.pagination button {
  min-width: 40px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
  font-weight: 720;
}

.pagination button:hover,
.pagination button:focus-visible {
  border-color: var(--accent);
}

.pagination button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}

.pagination button:disabled {
  cursor: default;
  opacity: 0.42;
}

.page-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.page-status {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 4px 0;
  color: var(--muted);
  font-size: 14px;
}

.footer a {
  color: var(--text);
  font-weight: 720;
}

.footer-links {
  justify-content: flex-end;
}

.rh-compact .shell {
  width: min(1120px, calc(100% - 24px));
  padding-top: 12px;
}

.rh-compact .hero {
  padding-top: 24px;
}

.rh-compact h1 {
  font-size: clamp(52px, 14vw, 116px);
}

.rh-compact .media-grid {
  height: 220px;
}

.rh-compact .media-grid-large {
  height: 320px;
}

.featured-panel,
.rank-panel {
  box-shadow: var(--shadow);
}

.studio-open {
  overflow: hidden;
}

.prompt-studio {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
}

.studio-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(52 44 41 / 0.46);
  backdrop-filter: blur(10px);
}

.studio-panel {
  position: relative;
  display: grid;
  width: min(980px, calc(100vw - 48px));
  max-height: min(90dvh, 920px);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--panel);
  box-shadow: 0 30px 100px rgb(92 55 43 / 0.26);
}

.studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 254 253 / 0.96);
}

.studio-header h2,
.studio-section-head h3 {
  margin: 3px 0 0;
}

.studio-header h2 {
  font-size: 26px;
}

.studio-close,
#studio-login-button,
#studio-refresh-history,
.studio-prompt-field button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
  font-weight: 740;
}

.studio-close:hover,
.studio-close:focus-visible,
#studio-login-button:hover,
#studio-login-button:focus-visible,
#studio-refresh-history:hover,
#studio-refresh-history:focus-visible,
.studio-prompt-field button:hover,
.studio-prompt-field button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.studio-scroll {
  overflow-y: auto;
  padding: 22px 24px 32px;
}

.studio-selector {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffaf7;
}

.studio-scope-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.studio-scope-option {
  position: relative;
  display: grid;
  min-width: 0;
  cursor: pointer;
}

.studio-scope-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.studio-scope-option > span {
  display: grid;
  min-height: 76px;
  align-content: center;
  gap: 5px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.studio-scope-option input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.studio-scope-option input:focus-visible + span {
  outline: 3px solid rgb(182 75 55 / 0.2);
  outline-offset: 2px;
}

.studio-scope-option:active > span {
  transform: translateY(1px);
}

.studio-scope-option strong,
.studio-scope-option small {
  display: block;
}

.studio-scope-option small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.studio-source-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.8fr);
  gap: 14px;
}

.studio-source {
  display: grid;
  gap: 8px;
  margin: 0;
}

.studio-source-preview {
  display: grid;
  min-height: 300px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.studio-source-preview > img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: contain;
}

.studio-group-preview {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 300px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.studio-group-preview img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
}

.studio-image-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
}

.studio-image-option {
  position: relative;
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--panel-soft);
  cursor: pointer;
}

.studio-image-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.studio-image-option span {
  position: absolute;
  right: 7px;
  bottom: 7px;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgb(52 44 41 / 0.82);
  color: var(--accent-contrast);
  font-size: 12px;
  font-weight: 760;
}

.studio-image-option.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgb(182 75 55 / 0.12);
}

.studio-image-option:focus-visible {
  outline: 3px solid rgb(182 75 55 / 0.2);
  outline-offset: 2px;
}

.studio-source figcaption,
.studio-charge-note,
.studio-section-head > span,
.studio-history-item small {
  color: var(--muted);
  font-size: 13px;
}

.studio-boundary {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid rgb(182 75 55 / 0.24);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--pill-text);
  font-size: 13px;
  line-height: 1.55;
}

.studio-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.studio-account strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

#studio-login-button {
  flex: 0 0 auto;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}

#studio-login-button:hover,
#studio-login-button:focus-visible {
  background: var(--accent-hover);
  color: var(--accent-contrast);
}

.studio-cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.studio-cost-row strong {
  color: var(--text);
}

.studio-primary {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-contrast);
  cursor: pointer;
  font-weight: 850;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.studio-primary:hover,
.studio-primary:focus-visible {
  background: var(--accent-hover);
}

.studio-primary:active {
  transform: translateY(1px);
}

.studio-primary:disabled,
.studio-model-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.studio-charge-note {
  margin: 9px 0 0;
  line-height: 1.5;
  text-align: center;
}

.studio-progress {
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.studio-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 13px;
}

.studio-progress-head span,
.studio-progress small {
  color: var(--muted);
  font-size: 12px;
}

.studio-progress-track {
  position: relative;
  overflow: hidden;
  height: 7px;
  margin: 10px 0 8px;
  border-radius: 999px;
  background: rgb(182 75 55 / 0.12);
}

.studio-progress-track > span {
  position: relative;
  display: block;
  overflow: hidden;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms ease;
}

.studio-progress-track[data-indeterminate="true"] > span::after {
  position: absolute;
  inset: 0;
  width: 45%;
  border-radius: inherit;
  background: rgb(255 248 244 / 0.52);
  content: "";
  animation: studio-progress-scan 1.25s ease-in-out infinite;
}

.studio-progress[data-stage="completed"] {
  border-color: rgb(64 142 103 / 0.42);
  background: #edf8f2;
}

.studio-progress[data-stage="completed"] .studio-progress-track > span {
  background: #408e67;
}

.studio-progress[data-stage="failed"] {
  border-color: rgb(191 82 82 / 0.42);
  background: #fceded;
}

.studio-progress[data-stage="failed"] .studio-progress-track > span {
  background: #bf5252;
}

@keyframes studio-progress-scan {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(240%);
  }
}

.studio-message {
  margin: 14px 0 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.studio-message[data-kind="success"] {
  border-color: rgb(64 142 103 / 0.42);
  background: #edf8f2;
  color: #285a42;
}

.studio-message[data-kind="warning"] {
  border-color: rgb(182 75 55 / 0.38);
  background: var(--accent-soft);
}

.studio-message[data-kind="error"] {
  border-color: rgb(191 82 82 / 0.42);
  background: #fceded;
  color: #7f2f2f;
}

@media (prefers-reduced-motion: reduce) {
  .studio-progress-track > span {
    transition: none;
  }

  .studio-progress-track[data-indeterminate="true"] > span::after {
    animation: none;
  }
}

.studio-result,
.studio-history {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.studio-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.studio-section-head h3 {
  font-size: 18px;
}

.studio-prompt-field {
  position: relative;
  display: grid;
  gap: 8px;
  margin-top: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
}

.studio-prompt-field textarea {
  width: 100%;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: var(--panel);
  color: var(--text);
  font: 14px/1.58 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.studio-prompt-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(182 75 55 / 0.12);
}

.studio-prompt-field button {
  width: fit-content;
  min-height: 32px;
  justify-self: end;
  font-size: 12px;
}

.studio-generation-head {
  margin-top: 24px;
}

.studio-generation-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.studio-generation-options label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.studio-generation-options select,
.studio-generation-options input {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: var(--panel-soft);
  color: var(--text);
}

.studio-generation-options select:focus,
.studio-generation-options input:focus {
  border-color: var(--accent);
}

.studio-generation-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.studio-model-button {
  display: grid;
  min-height: 82px;
  align-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.studio-model-button:hover,
.studio-model-button:focus-visible {
  border-color: var(--accent);
}

.studio-model-button strong {
  font-size: 14px;
}

.studio-model-button small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.studio-model-button-accent {
  border-color: rgb(182 75 55 / 0.4);
  background: var(--accent-soft);
}

.studio-output {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
}

.studio-output img {
  display: block;
  width: 100%;
  max-height: 560px;
  border-radius: var(--radius);
  background: var(--panel-soft);
  object-fit: contain;
}

.studio-output figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.studio-output a,
.studio-ip-links a,
.studio-history-item a {
  color: var(--accent);
  font-weight: 760;
}

.studio-ip-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  font-size: 13px;
}

.studio-ip-links .panel-label {
  flex-basis: 100%;
}

.studio-history-list {
  display: grid;
  gap: 8px;
}

.studio-history-empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.studio-history-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.studio-history-item img,
.studio-history-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--pill-text);
  font-size: 11px;
  font-weight: 800;
  object-fit: cover;
}

.studio-history-item span:nth-child(2) {
  min-width: 0;
}

.studio-history-item strong,
.studio-history-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-history-item .studio-history-prompt {
  margin: 2px 0;
  color: var(--text);
}

.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(52 44 41 / 0.76);
  backdrop-filter: blur(10px);
}

.lightbox-frame {
  position: relative;
  display: grid;
  width: min(1120px, 100%);
  max-height: min(86dvh, 900px);
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 30px 100px rgb(92 55 43 / 0.3);
}

.lightbox-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lightbox-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lightbox-tools button,
.lightbox-close {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
  font-weight: 720;
}

.lightbox-tools button {
  min-width: 38px;
}

.lightbox-zoom-value {
  min-width: 54px;
  color: var(--text);
  font-size: 13px;
  font-weight: 820;
  text-align: center;
}

.lightbox-tools button:focus-visible,
.lightbox-tools button:hover,
.lightbox-close:focus-visible,
.lightbox-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lightbox-viewport {
  display: grid;
  place-items: center;
  overflow: hidden;
  max-height: calc(86dvh - 124px);
  border-radius: 6px;
  background: #2f2926;
  cursor: zoom-in;
  touch-action: none;
}

.lightbox-viewport.is-zoomed {
  cursor: grab;
}

.lightbox-viewport.is-panning {
  cursor: grabbing;
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: calc(86dvh - 124px);
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  will-change: transform;
}

.lightbox-caption {
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .search {
    flex-basis: 100%;
  }

  .featured-grid,
  .creator-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .creator-card-featured:first-child {
    grid-row: auto;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1280px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-links {
    width: 100%;
    justify-content: flex-start;
  }

  .hero,
  .featured-grid,
  .creator-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 18px;
    padding-top: 30px;
  }

  .hero-panel {
    min-height: 216px;
    padding: 20px;
  }

  .hero-panel strong {
    font-size: clamp(72px, 20vw, 94px);
  }

  .hero-metric {
    margin: 24px 0 20px;
  }

  .hero-metric-copy > span {
    font-size: 19px;
  }

  .search {
    flex-basis: 100%;
  }

  .section-head,
  .rank-head,
  .footer,
  .card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .media-grid,
  .rh-compact .media-grid {
    height: 300px;
  }

  .media-grid-large,
  .rh-compact .media-grid-large {
    height: 340px;
  }

  .compact-row {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
  }

  .compact-row .open-link {
    grid-column: 3 / 5;
    width: fit-content;
  }

  .prompt-studio {
    padding: 10px;
  }

  .studio-panel {
    width: 100%;
    max-height: calc(100dvh - 20px);
  }

  .studio-source-layout {
    grid-template-columns: 1fr;
  }

  .studio-source-preview,
  .studio-group-preview {
    min-height: 260px;
  }
}

@media (max-width: 500px) {
  .topbar {
    min-height: 54px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .ghost-link {
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
  }

  .official-callout {
    padding: 14px;
  }

  .hero-highlights p {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .official-link {
    width: 100%;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    padding: 0 10px;
  }

  .lightbox {
    padding: 10px;
  }

  .lightbox-frame {
    max-height: 92dvh;
  }

  .lightbox-topbar {
    align-items: stretch;
  }

  .lightbox-tools {
    min-width: 0;
  }

  .lightbox-tools button,
  .lightbox-close {
    min-height: 32px;
    padding: 0 10px;
  }

  .lightbox-viewport {
    max-height: calc(92dvh - 122px);
  }

  .lightbox-image {
    max-height: calc(92dvh - 122px);
  }

  .studio-header,
  .studio-scroll {
    padding-right: 14px;
    padding-left: 14px;
  }

  .studio-selector {
    padding: 12px;
  }

  .studio-scope-options {
    grid-template-columns: 1fr;
  }

  .studio-header {
    position: relative;
    padding-right: 86px;
  }

  .studio-progress-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .studio-header > div {
    min-width: 0;
  }

  .studio-close {
    position: absolute;
    top: 50%;
    right: 14px;
    z-index: 1;
    transform: translateY(-50%);
  }

  .studio-generation-options,
  .studio-generation-actions {
    grid-template-columns: 1fr;
  }

  .studio-source-preview,
  .studio-group-preview {
    min-height: 220px;
  }

  .featured-panel,
  .rank-head,
  .creator-grid,
  .compact-list {
    padding: 12px;
  }

  .media-grid,
  .media-grid-large,
  .rh-compact .media-grid,
  .rh-compact .media-grid-large {
    height: 270px;
  }

  .score-strip {
    grid-template-columns: repeat(3, minmax(70px, 1fr));
    overflow-x: auto;
  }
}
