:root {
  --bg: #e7e7e7;
  --panel: #ffffff;
  --panel-strong: #f2f2f2;
  --text: #050505;
  --muted: #686868;
  --line: #cfcfcf;
  --accent: #050505;
  --accent-strong: #050505;
  --cyan: #050505;
  --ink: #050505;
  --danger: #d31327;
  --shadow: none;
  --radius: 2px;
  --page-gutter: 250px;
  font-family: "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

[data-theme="dark"] {
  --bg: #070707;
  --panel: #111111;
  --panel-strong: #1b1b1b;
  --text: #f7f7f7;
  --muted: #a3a3a3;
  --line: #353535;
  --accent: #f7f7f7;
  --accent-strong: #ffffff;
  --cyan: #f7f7f7;
  --ink: #050505;
  --danger: #ff5366;
}

body {
  background: var(--bg);
  font-family: inherit;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  letter-spacing: 0;
}

.site-header {
  margin: 0;
  padding: 22px 300px 44px;
  border-radius: 0;
  background: var(--panel);
}

.site-header .topbar,
.site-header .intro-panel,
.site-header .detail-hero {
  width: 100%;
  max-width: none;
}

.topbar {
  margin-bottom: clamp(42px, 7vw, 94px);
}

.brand {
  gap: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.brand-mark {
  display: none;
}

.brand-logo {
  display: block;
  width: 240px;
  height: auto;
}

[data-theme="dark"] .brand-logo {
  filter: invert(1);
}

.nav-actions {
  justify-content: flex-end;
}

.icon-button,
.text-button,
.primary-button,
.copy-button,
.danger-button {
  min-height: 44px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 850;
}

.icon-button {
  width: 44px;
  border-color: var(--text);
  background: var(--text);
  color: var(--panel);
}

.text-button,
.copy-button {
  border-color: var(--text);
  background: transparent;
  color: var(--text);
  padding-inline: 20px;
}

.primary-button {
  border-color: var(--text);
  background: var(--text);
  color: var(--panel);
  padding-inline: 22px;
}

.icon-button:hover,
.text-button:hover,
.copy-button:hover,
.primary-button:hover {
  transform: translateY(-2px);
  border-color: var(--text);
  box-shadow: none;
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.gallery-home .home-header {
  padding-top: 22px;
  padding-bottom: 46px;
  background: var(--panel);
  color: var(--text);
}

.gallery-home .topbar {
  margin-bottom: clamp(44px, 7vw, 92px);
}

.gallery-home .brand,
.gallery-home .eyebrow {
  color: var(--text);
}

.gallery-home .icon-button {
  border-color: var(--text);
  background: var(--text);
  color: var(--panel);
}

.gallery-home .home-intro {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.45fr);
  gap: clamp(36px, 6vw, 90px);
  align-items: end;
  padding: 0;
}

.gallery-home .intro-copy {
  max-width: none;
}

.gallery-home h1 {
  display: grid;
  gap: 18px;
  max-width: none;
  margin: 0 0 30px;
  color: var(--text);
  line-height: 0.9;
  font-weight: 950;
}

.gallery-home h1 .title-brand {
  display: block;
  color: var(--text);
  font-family: "Arial Black", "Helvetica Neue", "PingFang SC", sans-serif;
  font-size: clamp(4.5rem, 10vw, 9rem);
  line-height: 0.78;
}

.gallery-home h1 .title-sub {
  display: block;
  color: var(--text);
  font-size: clamp(2rem, 4vw, 4.15rem);
  line-height: 0.95;
  font-weight: 900;
}

.gallery-home .lead {
  max-width: 610px;
  color: var(--muted);
  font-size: 1rem;
}

.gallery-home .search-shell {
  align-self: end;
  gap: 12px;
  padding-bottom: 4px;
}

.gallery-home .search-shell label {
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.gallery-home .search-box {
  min-height: 64px;
  border: 2px solid var(--text);
  border-radius: 0;
  background: var(--panel);
  color: var(--text);
}

.gallery-home .search-box > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--text);
  color: var(--panel);
}

.gallery-home .search-box input {
  color: var(--text);
  font-size: 0.96rem;
}

.gallery-home .page-shell,
.gallery-detail .page-shell {
  width: auto;
  max-width: none;
  margin: 0 var(--page-gutter) 70px;
  padding: 30px clamp(20px, 4vw, 58px) 60px;
  border-radius: 0 0 8px 8px;
  background: var(--panel);
}

.gallery-summary {
  min-height: 56px;
  margin: 0 0 8px;
  padding: 0 0 18px;
  border-bottom: 2px solid var(--text);
}

.gallery-summary p {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.style-grid {
  gap: 0;
}

.style-card {
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--text);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: background 180ms ease;
}

.style-card:hover {
  transform: none;
  border-color: var(--text);
  background: var(--panel-strong);
  box-shadow: none;
}

.style-card:focus-within {
  border-color: var(--text);
  box-shadow: inset 0 0 0 2px var(--text);
}

.style-card a {
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.65fr);
  min-height: 370px;
  min-width: 0;
  padding: 26px 0;
}

.preview-mosaic {
  gap: 8px;
  background: transparent;
}

.preview-mosaic img {
  min-height: 0;
  filter: grayscale(0.08);
}

.style-card:hover .preview-mosaic img {
  filter: grayscale(0) contrast(1.02);
  transform: scale(1.018);
}

.card-body {
  grid-template-rows: auto auto auto 1fr auto;
  gap: 16px;
  padding: 2px 8px 2px clamp(28px, 4vw, 54px);
  border-left: 0;
}

.card-body > * {
  min-width: 0;
}

.card-heading {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.style-index {
  color: var(--text);
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 900;
}

.view-cue {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border-radius: 999px;
  background: var(--text);
  color: var(--panel);
  padding: 0 16px;
  font-size: 0.75rem;
  font-weight: 900;
}

.view-cue span {
  color: inherit;
}

.card-body h2 {
  margin: 0;
  color: var(--text);
  font-family: "Arial Black", "Helvetica Neue", "PingFang SC", sans-serif;
  font-size: clamp(2.2rem, 3.5vw, 4rem);
  line-height: 0.96;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.card-body p {
  color: var(--muted);
}

.style-description {
  font-size: 0.94rem;
  line-height: 1.65;
}

.meta-row {
  gap: 12px;
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 0.74rem;
  text-transform: uppercase;
}

.pill {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.prompt-block {
  padding-top: 16px;
  border-top: 2px solid var(--text);
}

.prompt-block > span {
  color: var(--text);
  font-size: 0.7rem;
}

.prompt-chip {
  color: var(--text) !important;
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.empty-state {
  border: 1px solid var(--text);
  border-radius: 0;
  background: var(--panel);
}

.gallery-detail .site-header {
  padding-bottom: 48px;
  background: var(--panel);
  color: var(--text);
}

.gallery-detail .brand {
  color: var(--text);
}

.gallery-detail .icon-button {
  border-color: var(--text);
  background: var(--text);
  color: var(--panel);
}

.gallery-detail .detail-hero {
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.55fr);
  gap: clamp(40px, 7vw, 100px);
  align-items: end;
  padding: 0;
}

.gallery-detail .detail-copy h1 {
  color: var(--text);
  font-family: "Arial Black", "Helvetica Neue", "PingFang SC", sans-serif;
  font-size: clamp(4rem, 9vw, 8rem);
  line-height: 0.82;
  font-weight: 950;
}

.gallery-detail .detail-copy .lead {
  max-width: 700px;
  color: var(--muted);
}

.gallery-detail .detail-copy .pill {
  color: var(--muted);
}

.gallery-detail .prompt-panel {
  max-width: none;
  padding: 22px;
  background: var(--text);
  color: var(--panel);
}

.gallery-detail .prompt-text {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--panel);
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gallery-detail .prompt-panel .copy-button {
  border: 1px solid var(--panel);
  background: var(--panel);
  color: var(--text);
}

.gallery-toolbar {
  margin: 0 0 24px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--text);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 850;
}

.masonry-grid {
  gap: 10px;
}

.art-card {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--panel-strong);
}

.art-card img {
  background: var(--panel-strong);
  transition: filter 180ms ease, transform 240ms ease;
}

.art-card:hover img {
  filter: contrast(1.02);
  transform: scale(1.01);
}

.art-card footer {
  border-top: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 0.74rem;
  line-height: 1.45;
}

.lightbox {
  border-radius: 0;
}

.lightbox-close {
  border-radius: 50%;
}

.admin-body {
  background: var(--bg);
}

.admin-app {
  grid-template-columns: 248px minmax(0, 1fr);
}

.admin-sidebar {
  gap: 34px;
  border-right: 0;
  background: #050505;
  color: #ffffff;
  padding: 28px 22px;
}

.admin-sidebar .brand {
  color: #ffffff;
  font-size: 1rem;
}

.admin-tabs {
  gap: 2px;
}

.admin-tab {
  min-height: 48px;
  border: 0;
  border-bottom: 1px solid #333333;
  border-radius: 0;
  color: #a8a8a8;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 0 4px;
}

.admin-tab.is-active,
.admin-tab:hover {
  border-color: #ffffff;
  background: transparent;
  color: #ffffff;
}

.admin-sidebar .text-button {
  border-color: #ffffff;
  color: #ffffff;
}

.admin-main {
  padding: clamp(24px, 4vw, 58px);
}

.admin-panel {
  gap: 24px;
}

.panel-heading {
  padding-bottom: 22px;
  border-bottom: 2px solid var(--text);
}

.panel-heading h1 {
  font-family: "Arial Black", "Helvetica Neue", "PingFang SC", sans-serif;
  font-size: clamp(2.5rem, 4vw, 4.6rem);
  line-height: 0.95;
  font-weight: 950;
}

.editor-form,
.image-manager-head {
  border: 0;
  border-radius: 0;
  background: var(--panel);
  padding: clamp(20px, 3vw, 34px);
}

label {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 850;
}

input,
textarea,
select {
  border: 1px solid var(--text);
  border-radius: 0;
  background: var(--panel);
  color: var(--text);
}

input:focus,
textarea:focus,
select:focus,
.search-box:focus-within {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--text);
}

.style-row,
.gallery-row {
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 20px;
  border: 0;
  border-bottom: 1px solid var(--text);
  border-radius: 0;
  background: var(--panel);
  padding: 16px;
}

.row-preview,
.gallery-thumb {
  border-radius: 0;
}

.row-copy h3 {
  font-size: 1.15rem;
  font-weight: 900;
}

.danger-button {
  border-color: var(--danger);
  background: transparent;
}

.toast {
  border-radius: 999px;
  background: #050505;
  color: #ffffff;
  padding-inline: 20px;
}

@media (max-width: 1060px) {
  .gallery-home .home-intro,
  .gallery-detail .detail-hero {
    grid-template-columns: 1fr;
  }

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

  .card-body {
    padding: 28px 0 12px;
    border-top: 0;
  }

  .admin-app {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    padding: 20px;
  }

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

  .sidebar-actions {
    margin-top: 0;
  }
}

@media (max-width: 680px) {
  :root {
    --page-gutter: 10px;
  }

  .site-header {
    margin: 0;
    padding: 18px 16px 30px;
  }

  .brand-logo {
    width: 180px;
  }

  .gallery-home .home-header {
    padding-top: 18px;
    padding-bottom: 32px;
  }

  .topbar,
  .gallery-home .topbar {
    align-items: center;
    flex-direction: row;
    margin-bottom: 54px;
  }

  .nav-actions {
    width: auto;
  }

  .gallery-home h1 {
    gap: 12px;
  }

  .gallery-home h1 .title-brand {
    font-size: clamp(3.55rem, 20vw, 5.2rem);
  }

  .gallery-home h1 .title-sub {
    font-size: clamp(1.75rem, 10vw, 2.7rem);
  }

  .gallery-home .home-intro {
    gap: 34px;
  }

  .gallery-home .page-shell,
  .gallery-detail .page-shell {
    margin: 0 var(--page-gutter) var(--page-gutter);
    padding: 24px 16px 42px;
  }

  .style-card a {
    min-height: 0;
    padding: 22px 0;
  }

  .preview-mosaic {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: auto;
  }

  .preview-mosaic img {
    min-height: 0;
  }

  .card-body h2 {
    font-size: 2.45rem;
  }

  .gallery-detail .detail-copy h1 {
    font-size: clamp(3.2rem, 18vw, 5.1rem);
  }

  .gallery-detail .prompt-panel {
    padding: 18px;
  }

  .masonry-grid {
    grid-template-columns: 1fr;
  }

  .admin-main {
    padding: 20px 12px 40px;
  }

  .panel-heading,
  .toolbar-line,
  .gallery-toolbar,
  .lightbox-caption {
    align-items: stretch;
    flex-direction: column;
  }

  .style-row,
  .gallery-row,
  .form-grid,
  .image-manager-head {
    grid-template-columns: 1fr;
  }

  .row-preview,
  .gallery-thumb {
    height: 190px;
  }
}
