:root {
  color-scheme: light;
  --green: #17a77d;
  --green-dark: #0f7f60;
  --paper: #f1f1ef;
  --white: #ffffff;
  --surface: #ffffff;
  --soft: #f7f8f9;
  --soft-green: #d8eee6;
  --tag: #eef0f2;
  --tag-model: #dce9ff;
  --ink: #080808;
  --muted: #666b70;
  --line: #0a0a0a;
  --blue: #2e63d6;
  --shadow: 8px 8px 0 #000;
  --small-shadow: 4px 4px 0 #000;
  --radius: 0;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --green: #0da171;
  --green-dark: #0b6e53;
  --paper: #101313;
  --white: #ffffff;
  --surface: #181d1d;
  --soft: #202727;
  --soft-green: #123f35;
  --tag: #273030;
  --tag-model: #1d344f;
  --ink: #f6f7f3;
  --muted: #a9b2ad;
  --line: #f3f4ef;
  --blue: #8bb9ff;
  --shadow: 8px 8px 0 #000;
  --small-shadow: 4px 4px 0 #000;
}

:root[data-bg="blue"] {
  --green: #2d7ff9;
  --green-dark: #1859c9;
  --soft-green: #d9e8ff;
  --tag-model: #d8e7ff;
  --blue: #1859c9;
}

:root[data-bg="pink"] {
  --green: #f05b93;
  --green-dark: #c93c72;
  --soft-green: #ffe0ec;
  --tag-model: #ffe0ec;
  --blue: #b33166;
}

:root[data-bg="yellow"] {
  --green: #f5c542;
  --green-dark: #d29b10;
  --soft-green: #fff0bf;
  --tag-model: #fff0bf;
  --blue: #8a5d00;
}

:root[data-bg="black"] {
  --green: #111111;
  --green-dark: #000000;
  --soft-green: #eeeeee;
  --tag-model: #eeeeee;
  --blue: #111111;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 0 clamp(18px, 4vw, 56px);
  border-bottom: 4px solid var(--line);
  background: var(--green);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 950;
  text-shadow: 2px 2px 0 #000;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border: 3px solid var(--line);
  background: var(--white);
  box-shadow: 3px 3px 0 #000;
  display: block;
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--white);
  font-size: 14px;
  font-weight: 850;
}

.nav-links a:hover {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

.menu-button {
  display: none;
  width: 42px;
  height: 38px;
  border: 3px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 3px 3px 0 #000;
}

.menu-button span {
  display: block;
  width: 18px;
  height: 3px;
  margin: 4px auto;
  background: var(--ink);
}

.utility-button {
  min-height: 34px;
  padding: 0 10px;
  border: 3px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 3px 3px 0 #000;
}

.background-picker {
  display: inline-grid;
  grid-template-columns: auto 112px;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 8px;
  border: 3px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 3px 3px 0 #000;
}

.background-picker span {
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.background-picker select {
  min-height: 26px;
  border: 2px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.hero {
  display: grid;
  justify-items: center;
  min-height: 430px;
  padding: clamp(22px, 3.2vw, 34px) 18px 24px;
  border-bottom: 5px solid var(--line);
  background: var(--green);
}

.hero-title {
  text-align: center;
}

.hero-title h1 {
  max-width: 1120px;
  margin: 0;
  color: var(--white);
  font-size: clamp(44px, 6.2vw, 82px);
  line-height: .95;
  letter-spacing: 0;
  text-shadow: 6px 6px 0 #000;
}

.title-sticker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 280px;
  margin-top: 12px;
  padding: 5px 20px 8px;
  border: 5px solid var(--line);
  background: var(--white);
  box-shadow: 6px 6px 0 #000;
  font-size: clamp(34px, 4.4vw, 50px);
  font-weight: 950;
  line-height: 1;
}

.hero-title p {
  margin: 12px 0 20px;
  color: var(--white);
  font-size: 15px;
  font-weight: 950;
}

.prompt-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  width: min(700px, 100%);
  min-height: 158px;
  border: 5px solid var(--line);
  background: var(--surface);
  box-shadow: 7px 7px 0 #000;
}

.composer-main {
  display: grid;
  grid-template-rows: minmax(106px, 1fr) auto;
}

.prompt-composer textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  padding: 16px;
  border: 0;
  border-right: 4px solid var(--line);
  outline: 0;
  background: var(--soft);
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}

.composer-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-top: 3px solid var(--line);
  border-right: 4px solid var(--line);
  background: var(--surface);
}

.composer-tools select,
.outline-button,
.mini-copy,
.filter-chip,
.try-button,
.share-button {
  min-height: 34px;
  border: 3px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 3px 3px 0 #000;
}

.composer-tools select {
  min-width: 150px;
  padding: 0 14px;
}

.turnstile-block {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.turnstile-slot {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  min-width: 120px;
  border: 3px dashed var(--line);
  background: var(--soft);
}

.turnstile-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.copy-gate {
  width: min(560px, 100%);
  margin-top: 16px;
  padding: 14px 16px;
  border: 4px solid var(--line);
  background: var(--surface);
  box-shadow: var(--small-shadow);
}

.copy-gate[data-state="ready"] {
  background: var(--soft-green);
}

.copy-gate strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 950;
}

.copy-gate p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.secondary {
  background: var(--soft);
}

.generate-button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 0;
  background: #050505;
  color: #ffffff;
  font-size: 18px;
  font-weight: 950;
  cursor: pointer;
}

.spark::before {
  content: "✦";
  color: var(--white);
  font-size: 34px;
  line-height: 1;
}

.generated-output {
  width: min(700px, 100%);
  margin-top: 18px;
  border: 4px solid var(--line);
  background: var(--surface);
  box-shadow: var(--small-shadow);
}

.generated-output > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 3px solid var(--line);
}

.generated-output pre {
  max-height: 220px;
  margin: 0;
  overflow: auto;
  padding: 14px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.stat-pill {
  margin-top: 18px;
  padding: 8px 18px;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 950;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .28);
}

.hot-prompts,
.model-links,
.model-guide,
.library,
.faq {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.model-links {
  padding: 28px 0 8px;
}

.model-link-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.model-link-card,
.model-link,
.model-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 14px;
  border: 3px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  text-align: center;
  box-shadow: 3px 3px 0 #000;
}

.model-link-card:hover,
.model-link:hover,
.model-cta:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 #000;
}

.hot-prompts {
  padding: 30px 0 22px;
}

.section-header,
.library-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  border-bottom: 4px solid var(--line);
}

.section-header h2,
.library-toolbar h2,
.faq h2 {
  margin: 0 0 8px;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1;
  font-weight: 950;
}

.outline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  margin-bottom: 10px;
  padding: 0 14px;
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 26px;
}

.prompt-card {
  display: grid;
  border: 4px solid var(--line);
  background: var(--surface);
  box-shadow: var(--small-shadow);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
}

.prompt-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 #000;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 18%, transparent);
  font-size: 13px;
  font-weight: 900;
}

.author {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.card-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  margin: 14px 14px 0;
  border: 3px solid var(--line);
  background: var(--soft-green);
}

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

.image-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 18px;
  background: linear-gradient(135deg, var(--soft-green), color-mix(in srgb, var(--green) 28%, var(--surface)));
  color: var(--ink);
  font-weight: 950;
  text-align: center;
}

.prompt-preview {
  margin: 14px;
  border: 3px solid var(--line);
  background: var(--soft);
}

.preview-bar {
  padding: 7px 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 950;
}

.prompt-preview p {
  display: -webkit-box;
  min-height: 112px;
  margin: 0;
  overflow: hidden;
  padding: 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 14px 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  background: var(--tag);
  color: var(--ink);
  font-size: 11px;
  font-weight: 950;
}

.tag.model {
  background: var(--tag-model);
  color: var(--blue);
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
  padding: 0 14px 14px;
}

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

.try-button,
.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  background: #151515;
  color: #ffffff;
}

.share-button {
  min-width: 42px;
  background: var(--surface);
  color: var(--ink);
}

.library {
  padding: 28px 0 58px;
}

.library-toolbar {
  align-items: center;
}

.library-toolbar p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.library-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(140px, .8fr) minmax(140px, .8fr) minmax(132px, .7fr);
  gap: 12px;
  width: min(760px, 100%);
}

.control-box {
  display: grid;
  gap: 6px;
}

.control-box span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.control-box input,
.control-box select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 4px solid var(--line);
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  box-shadow: var(--small-shadow);
}

.control-box select {
  cursor: pointer;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  min-height: 34px;
  padding: 0 10px;
}

.filter-chip.active {
  background: var(--green);
  color: #ffffff;
}

.empty-state {
  padding: 28px;
  border: 4px solid var(--line);
  background: var(--surface);
  box-shadow: var(--small-shadow);
  font-weight: 850;
  text-align: center;
}

.faq {
  padding: 42px 0 82px;
  border-top: 4px solid var(--line);
}

.model-hero {
  display: grid;
  justify-items: center;
  padding: clamp(40px, 7vw, 78px) 18px 36px;
  border-bottom: 5px solid var(--line);
  background: var(--green);
  text-align: center;
}

.model-hero h1 {
  max-width: 980px;
  margin: 0;
  color: var(--white);
  font-size: clamp(44px, 8vw, 92px);
  line-height: .92;
  font-weight: 950;
  text-shadow: 6px 6px 0 #000;
}

.model-hero p {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--white);
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 850;
}

.breadcrumb {
  margin: 0 0 16px !important;
  font-size: 13px !important;
  text-transform: uppercase;
}

.breadcrumb a {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.model-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.model-cta {
  min-width: 190px;
}

.model-cta.secondary {
  background: var(--soft);
}

.model-guide {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 24px;
  padding: 34px 0 8px;
}

.model-guide > div {
  padding: 20px;
  border: 4px solid var(--line);
  background: var(--surface);
  box-shadow: var(--small-shadow);
}

.model-guide h2 {
  margin: 0 0 14px;
  font-size: 24px;
  line-height: 1;
  font-weight: 950;
}

.model-guide ul {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  font-weight: 750;
}

.model-link-list {
  display: grid;
  gap: 10px;
}

.model-prompts {
  padding-top: 28px;
}

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

details {
  border: 4px solid var(--line);
  background: var(--surface);
  box-shadow: var(--small-shadow);
}

summary {
  cursor: pointer;
  padding: 16px;
  font-size: 16px;
  font-weight: 950;
}

details p {
  margin: 0;
  padding: 0 16px 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .55);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(320px, 540px);
  width: min(980px, 100%);
  max-height: 88vh;
  overflow: auto;
  border: 5px solid var(--line);
  background: var(--surface);
  box-shadow: 10px 10px 0 #000;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 3px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 3px 3px 0 #000;
  font-size: 26px;
  font-weight: 950;
  cursor: pointer;
}

.modal-image {
  min-height: 360px;
  border-right: 4px solid var(--line);
  background: var(--soft-green);
}

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

.modal-body {
  padding: 26px;
}

.author-line {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.modal-body h2 {
  margin: 0 42px 16px 0;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 950;
}

.modal-body pre {
  max-height: 320px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 3px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px clamp(18px, 4vw, 56px);
  border-top: 4px solid var(--line);
  background: var(--green);
  color: var(--white);
  font-weight: 850;
}

.footer p {
  margin: 0;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  padding: 12px 16px;
  border: 3px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 950;
  box-shadow: var(--small-shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 74px;
  z-index: 110;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 4px solid var(--line);
  background: var(--green);
  color: #ffffff;
  box-shadow: var(--small-shadow);
  font-size: 26px;
  font-weight: 950;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .18s ease, transform .18s ease;
}

.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--green-dark);
}

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

  .modal-card {
    grid-template-columns: 1fr;
  }

  .modal-image {
    border-right: 0;
    border-bottom: 4px solid var(--line);
  }
}

@media (max-width: 760px) {
  .topbar {
    gap: 12px;
  }

  .brand span:last-child {
    max-width: 168px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-links {
    position: fixed;
    top: 62px;
    right: 14px;
    left: 14px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border: 4px solid var(--line);
    background: var(--green);
    box-shadow: var(--small-shadow);
  }

  body.menu-open .nav-links {
    display: flex;
  }

  .menu-button {
    display: block;
  }

  .utility-button {
    min-height: 32px;
    padding: 0 8px;
    font-size: 11px;
  }

  .background-picker {
    grid-template-columns: 1fr;
    gap: 2px;
    min-height: 42px;
    padding: 3px 6px;
  }

  .background-picker span {
    font-size: 9px;
  }

  .background-picker select {
    width: 96px;
    font-size: 11px;
  }

  .prompt-composer {
    grid-template-columns: 1fr;
  }

  .prompt-composer textarea,
  .composer-tools {
    border-right: 0;
  }

  .generate-button {
    min-height: 72px;
    border-top: 4px solid var(--line);
  }

  .section-header,
  .model-guide,
  .library-toolbar,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .model-link-grid,
  .model-guide {
    grid-template-columns: 1fr;
  }

  .filter-row {
    grid-template-columns: 1fr;
  }

  .library-controls {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .hero-title h1 {
    font-size: 39px;
  }

  .title-sticker {
    min-width: 220px;
    font-size: 30px;
  }

  .prompt-grid,
  .model-link-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }

  .card-actions {
    grid-template-columns: 1fr 44px;
  }

  .library-controls {
    grid-template-columns: 1fr;
  }

  .back-to-top {
    right: 14px;
    bottom: 68px;
    width: 44px;
    height: 44px;
  }
}
