:root {
  --bg: #f3f3f0;
  --surface: #fff;
  --surface-soft: #e9e9e4;
  --text: #171715;
  --muted: #6c6c66;
  --line: #d5d5cf;
  --line-strong: #aaa9a1;
  --red: #df3b2e;
  --blue: #2459d3;
  --green: #2f7f62;
  --yellow: #f0cf38;
  --focus: #2459d3;
  --radius-sm: 4px;
  --radius-md: 8px;
  --shadow: 0 20px 60px rgb(20 20 17 / 18%);
  --header-height: 72px;
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

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

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 52%);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  min-height: var(--header-height);
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgb(243 243 240 / 94%);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: block;
  width: 34px;
  height: 34px;
  margin-right: 11px;
  border: 1px solid var(--text);
  background: var(--surface);
  overflow: hidden;
}

.brand-mark i {
  position: absolute;
  display: block;
}

.brand-mark i:nth-child(1) {
  width: 16px;
  height: 16px;
  left: 3px;
  top: 4px;
  border-radius: 50%;
  background: var(--red);
}

.brand-mark i:nth-child(2) {
  width: 17px;
  height: 17px;
  right: 2px;
  bottom: 3px;
  background: var(--blue);
  transform: rotate(18deg);
}

.brand-mark i:nth-child(3) {
  width: 26px;
  height: 2px;
  left: 4px;
  top: 20px;
  background: var(--text);
  transform: rotate(-25deg);
}

.brand b,
.brand small {
  display: block;
}

.brand b {
  font-family: Georgia, "Songti SC", serif;
  font-size: 18px;
  font-weight: 600;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.nav-item,
.output-tabs button,
.segmented button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.nav-item:hover,
.output-tabs button:hover,
.segmented button:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.nav-item.is-active,
.output-tabs button.is-active,
.segmented button.is-active {
  color: var(--surface);
  background: var(--text);
}

.header-actions {
  display: flex;
  justify-self: end;
  gap: 8px;
}

.icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.header-actions .icon-button.is-active {
  border-color: var(--text);
  background: var(--text);
  color: var(--surface);
}

.icon-button svg,
.primary-button svg,
.secondary-button svg {
  width: 18px;
  height: 18px;
}

.action-count {
  position: absolute;
  right: -5px;
  top: -6px;
  display: grid;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  place-items: center;
  border: 2px solid var(--bg);
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.page-band {
  padding-right: max(32px, calc((100vw - 1500px) / 2));
  padding-left: max(32px, calc((100vw - 1500px) / 2));
}

.atlas-heading,
.timeline-header,
.prompt-header {
  padding-top: 46px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.page-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow,
.drawer-kicker {
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 36px;
  font-weight: 600;
  line-height: 1.22;
}

h2 {
  font-size: 18px;
  line-height: 1.35;
}

h3 {
  font-size: 15px;
  line-height: 1.4;
}

.result-stat {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.result-stat strong {
  color: var(--text);
  font-size: 22px;
}

.search-box {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  width: min(820px, 100%);
  min-height: 54px;
  margin-top: 28px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.search-box:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(36 89 211 / 14%);
}

.search-box svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 12px;
  border: 0;
  outline: 0;
  background: transparent;
}

.search-box kbd {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
}

.quick-filters,
.active-filters,
.gene-list,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-filters {
  margin-top: 16px;
}

.chip,
.filter-chip,
.active-filter,
.gene-chip,
.relation-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

button.chip:hover,
.filter-chip:hover,
.relation-chip:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.chip.is-active,
.filter-chip.is-active {
  border-color: var(--text);
  background: var(--text);
  color: var(--surface);
}

.atlas-layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  align-items: start;
  gap: 36px;
  padding-top: 30px;
  padding-bottom: 72px;
}

.filter-panel {
  position: sticky;
  top: calc(var(--header-height) + 24px);
}

.filter-heading,
.field-label-row,
.output-heading,
.drawer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.filter-heading h2 {
  margin: 0;
}

.text-button {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 650;
}

.text-button:disabled {
  color: var(--line-strong);
  cursor: default;
}

.filter-group {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.filter-group h3 {
  margin-bottom: 10px;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-option {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  min-height: 32px;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.filter-option:hover {
  color: var(--text);
}

.filter-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--text);
}

.filter-option output {
  color: var(--line-strong);
}

.catalog-toolbar {
  display: flex;
  min-height: 42px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.active-filter {
  gap: 6px;
  min-height: 30px;
  background: var(--surface-soft);
  color: var(--text);
}

.active-filter svg {
  width: 13px;
  height: 13px;
}

.mobile-filter-button {
  display: none;
}

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

.style-card {
  position: relative;
  min-width: 0;
}

.style-card-main {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.style-card-main:hover .style-visual {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgb(20 20 17 / 12%);
}

.style-card-main:focus-visible .style-visual {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.style-visual,
.detail-visual,
.selected-style-visual,
.timeline-node-visual {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
  background-color: var(--surface-soft);
}

.style-visual {
  aspect-ratio: 4 / 3;
  width: 100%;
  border: 1px solid rgb(23 23 21 / 15%);
  border-radius: var(--radius-sm);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.style-visual::before,
.style-visual::after,
.detail-visual::before,
.detail-visual::after,
.selected-style-visual::before,
.selected-style-visual::after,
.timeline-node-visual::before,
.timeline-node-visual::after {
  position: absolute;
  content: "";
}

.art-shape {
  position: absolute;
  z-index: 2;
  display: block;
}

.card-tools {
  position: absolute;
  z-index: 5;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 5px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.style-card:hover .card-tools,
.style-card:focus-within .card-tools,
.card-tools.has-active {
  opacity: 1;
}

.card-tools .icon-button {
  width: 36px;
  height: 36px;
  border-color: rgb(23 23 21 / 18%);
  box-shadow: 0 2px 8px rgb(20 20 17 / 12%);
}

.card-tools .icon-button.is-active {
  border-color: var(--text);
  background: var(--text);
  color: var(--surface);
}

.style-meta {
  display: block;
  padding-top: 12px;
}

.style-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.style-card-title {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 18px;
  font-weight: 700;
}

.style-name-row span,
.style-period {
  color: var(--muted);
  font-size: 11px;
}

.style-en {
  display: block;
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.style-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.style-tags span {
  padding: 3px 6px;
  border-radius: 3px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
}

.empty-state {
  padding: 100px 20px;
  text-align: center;
}

.empty-state svg {
  width: 36px;
  height: 36px;
  color: var(--line-strong);
}

.empty-state h2 {
  margin: 16px 0 24px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  gap: 8px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
}

.primary-button {
  border: 1px solid var(--text);
  background: var(--text);
  color: var(--surface);
}

.primary-button:hover {
  background: #33332f;
}

.primary-button:disabled {
  border-color: var(--line);
  background: var(--line);
  color: var(--muted);
  cursor: default;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

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

/* Original style specimens. They demonstrate visual grammar and are not historical artworks. */
.art-ink {
  background:
    radial-gradient(ellipse at 38% 62%, rgb(30 30 28 / 88%) 0 3%, transparent 4%),
    radial-gradient(ellipse at 48% 58%, rgb(30 30 28 / 62%) 0 6%, transparent 7%),
    radial-gradient(ellipse at 60% 53%, rgb(30 30 28 / 28%) 0 10%, transparent 11%),
    linear-gradient(104deg, transparent 40%, rgb(35 35 32 / 70%) 41% 43%, transparent 44%),
    #ddd9cd;
}

.art-ink::before {
  width: 8%;
  height: 45%;
  left: 72%;
  top: 18%;
  border-radius: 50%;
  background: #222220;
  transform: rotate(-28deg);
  filter: blur(1px);
}

.art-ink::after {
  width: 11%;
  height: 11%;
  right: 9%;
  bottom: 11%;
  background: #a14b37;
}

.art-islamic {
  background-color: #155c6d;
  background-image:
    conic-gradient(from 45deg at 25% 25%, transparent 0 12.5%, #d6a84c 0 25%, transparent 0 50%, #d6a84c 0 62.5%, transparent 0 100%),
    conic-gradient(from 45deg at 75% 75%, transparent 0 12.5%, #9f3f35 0 25%, transparent 0 50%, #9f3f35 0 62.5%, transparent 0 100%);
  background-size: 52px 52px;
}

.art-islamic::before {
  inset: 11%;
  border: 6px double rgb(255 255 255 / 72%);
  transform: rotate(45deg);
}

.art-renaissance {
  background: radial-gradient(circle at 50% 34%, #d9bd83 0 7%, transparent 7.5%), linear-gradient(135deg, #294861 0 46%, #9a4f37 46% 72%, #c5a568 72%);
}

.art-renaissance::before {
  width: 32%;
  height: 46%;
  left: 34%;
  bottom: 14%;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #292821;
  box-shadow: 0 0 0 7px rgb(255 255 255 / 13%);
}

.art-renaissance::after {
  width: 70%;
  height: 1px;
  left: 15%;
  top: 50%;
  background: rgb(255 255 255 / 45%);
}

.art-baroque {
  background: radial-gradient(circle at 38% 35%, #e4bd64 0 8%, #8d382c 22%, #25191a 48%, #111 78%);
}

.art-baroque::before {
  width: 70%;
  height: 130%;
  left: 34%;
  top: -22%;
  border: 17px solid rgb(196 155 75 / 62%);
  border-radius: 50%;
  transform: rotate(28deg);
}

.art-baroque::after {
  width: 50%;
  height: 12%;
  left: 9%;
  bottom: 19%;
  background: #842822;
  transform: rotate(-18deg);
  box-shadow: 18px -23px 0 rgb(255 255 255 / 12%);
}

.art-ukiyo {
  background: radial-gradient(circle at 72% 22%, #d6533c 0 10%, transparent 10.5%), linear-gradient(#e8d8b8 0 66%, #a9c3c5 66%);
}

.art-ukiyo::before {
  width: 83%;
  height: 65%;
  left: -16%;
  bottom: -26%;
  border: 12px solid #1b4b6c;
  border-radius: 50%;
  box-shadow: 15px -15px 0 -8px #e8d8b8, 30px -29px 0 -14px #1b4b6c, 43px -40px 0 -20px #e8d8b8, 57px -51px 0 -26px #1b4b6c;
  transform: rotate(-11deg);
}

.art-ukiyo::after {
  width: 50%;
  height: 42%;
  right: -18%;
  bottom: 5%;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #446b73;
}

.art-impressionism {
  background:
    repeating-linear-gradient(165deg, transparent 0 8px, rgb(255 255 255 / 20%) 9px 12px),
    linear-gradient(155deg, #80a8c9 0 28%, #d4d1a0 28% 38%, #709671 38% 61%, #c79c65 61% 100%);
}

.art-impressionism::before {
  width: 120%;
  height: 34%;
  left: -10%;
  bottom: 9%;
  background: repeating-linear-gradient(173deg, #6d7b9e 0 8px, #a2b27e 8px 15px, #d4b86c 15px 22px, #8199a4 22px 30px);
  filter: blur(2px);
  opacity: .78;
}

.art-impressionism::after {
  width: 8%;
  height: 22%;
  left: 58%;
  top: 43%;
  border-radius: 50% 50% 10% 10%;
  background: #343a4a;
  filter: blur(1px);
}

.art-nouveau {
  background: #e1c98c;
}

.art-nouveau::before {
  width: 70%;
  height: 112%;
  left: 14%;
  top: -22%;
  border: 8px double #5f7550;
  border-radius: 48% 52% 44% 56%;
  transform: rotate(11deg);
  box-shadow: inset 0 0 0 12px rgb(185 108 73 / 62%);
}

.art-nouveau::after {
  width: 18%;
  height: 76%;
  right: 17%;
  bottom: -22%;
  border: 7px solid #684833;
  border-left-color: transparent;
  border-radius: 50%;
  transform: rotate(-34deg);
}

.art-constructivism {
  background: linear-gradient(126deg, #e7dfca 0 43%, #df2e24 43% 63%, #171715 63% 76%, #e7dfca 76%);
}

.art-constructivism::before {
  width: 43%;
  height: 43%;
  right: 10%;
  top: 9%;
  border: 12px solid #171715;
  border-radius: 50%;
}

.art-constructivism::after {
  width: 58%;
  height: 8%;
  left: 3%;
  bottom: 21%;
  background: #171715;
  transform: rotate(-24deg);
  box-shadow: 0 15px 0 #df2e24;
}

.art-bauhaus {
  background: #ecebe5;
}

.art-bauhaus::before {
  width: 42%;
  height: 58%;
  left: 9%;
  top: 21%;
  background: #2459a9;
  box-shadow: 111px -31px 0 -10px #efbd2f;
}

.art-bauhaus::after {
  width: 34%;
  aspect-ratio: 1;
  right: 12%;
  bottom: 11%;
  border-radius: 50%;
  background: #d93a2f;
  box-shadow: -76px -57px 0 -24px #171715;
}

.art-surrealism {
  background: linear-gradient(#799fbf 0 56%, #cfb17b 56% 100%);
}

.art-surrealism::before {
  width: 34%;
  height: 50%;
  left: 33%;
  top: 12%;
  border-radius: 50% 50% 43% 57%;
  background: #e3c95f;
  transform: rotate(22deg) skew(-9deg);
  box-shadow: 32px 35px 18px rgb(27 35 44 / 22%);
}

.art-surrealism::after {
  width: 14%;
  height: 20%;
  right: 18%;
  bottom: 15%;
  background: #9e514a;
  transform: rotate(45deg);
}

.art-swiss {
  background-color: #f2f2ef;
  background-image: linear-gradient(90deg, rgb(23 23 21 / 8%) 1px, transparent 1px), linear-gradient(rgb(23 23 21 / 8%) 1px, transparent 1px);
  background-size: 25% 25%;
}

.art-swiss::before {
  width: 37%;
  aspect-ratio: 1;
  left: 10%;
  bottom: 12%;
  border-radius: 50%;
  background: #e04435;
}

.art-swiss::after {
  width: 38%;
  height: 52%;
  right: 9%;
  top: 14%;
  border-top: 13px solid #171715;
  border-bottom: 5px solid #171715;
  background: repeating-linear-gradient(#171715 0 4px, transparent 4px 14px);
}

.art-pop {
  background-color: #f2d43d;
  background-image: radial-gradient(#d42c25 1.8px, transparent 2px);
  background-size: 11px 11px;
}

.art-pop::before {
  width: 58%;
  height: 58%;
  left: 21%;
  top: 20%;
  border: 9px solid #171715;
  border-radius: 50%;
  background: #f5f2e8;
  box-shadow: 12px 11px 0 #1f65c1;
}

.art-pop::after {
  width: 54%;
  height: 19%;
  left: 23%;
  top: 41%;
  background: #f13b2d;
  clip-path: polygon(0 35%, 22% 0, 40% 28%, 61% 0, 100% 35%, 86% 100%, 59% 74%, 32% 100%, 12% 73%);
}

.art-memphis {
  background-color: #f1e9df;
  background-image: radial-gradient(#171715 1.5px, transparent 1.5px);
  background-position: 0 0;
  background-size: 16px 16px;
}

.art-memphis::before {
  width: 41%;
  height: 33%;
  left: 10%;
  top: 12%;
  background: #ec4c81;
  transform: rotate(-9deg);
  box-shadow: 105px 59px 0 #28a99a;
}

.art-memphis::after {
  width: 48%;
  height: 18%;
  right: 6%;
  bottom: 14%;
  border: 7px solid #171715;
  border-top: 0;
  border-radius: 0 0 50% 50%;
  transform: rotate(12deg);
  box-shadow: -109px -18px 0 -4px #f2cc34;
}

.art-brutalism {
  border-color: #171715;
  background-color: #f0ef3d;
  background-image: linear-gradient(90deg, #171715 2px, transparent 2px), linear-gradient(#171715 2px, transparent 2px);
  background-size: 25% 33.333%;
}

.art-brutalism::before {
  width: 56%;
  height: 30%;
  left: 7%;
  top: 13%;
  border: 6px solid #171715;
  background: #f7f7f4;
  box-shadow: 9px 9px 0 #171715;
}

.art-brutalism::after {
  width: 31%;
  height: 39%;
  right: 7%;
  bottom: 9%;
  border: 6px solid #171715;
  background: #df3b2e;
}

.art-y2k {
  background: linear-gradient(135deg, #eaf3f2 0, #8fd3db 32%, #b9c7d6 52%, #c8ee52 100%);
}

.art-y2k::before {
  width: 54%;
  height: 55%;
  left: 23%;
  top: 20%;
  border: 5px solid rgb(255 255 255 / 72%);
  border-radius: 47% 53% 62% 38%;
  background: linear-gradient(145deg, #f7f7f4 5%, #71889c 44%, #ffffff 58%, #8aa0b1 78%);
  box-shadow: inset -14px -11px 20px rgb(44 60 77 / 35%), 14px 16px 30px rgb(41 79 94 / 25%);
  transform: rotate(-16deg);
}

.art-y2k::after {
  width: 86%;
  height: 50%;
  left: 7%;
  top: 25%;
  border: 4px solid rgb(255 255 255 / 70%);
  border-radius: 50%;
  transform: rotate(18deg);
}

.timeline-header {
  padding-bottom: 38px;
}

.timeline-legend {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 11px;
}

.timeline-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
}

.legend-line {
  width: 20px;
  height: 1px;
  background: var(--line-strong);
}

.timeline-wrap {
  overflow-x: auto;
  padding-top: 42px;
  padding-bottom: 42px;
}

.timeline-axis,
.timeline-lanes {
  min-width: 2200px;
}

.timeline-axis {
  position: relative;
  height: 34px;
  margin-left: 168px;
  border-bottom: 1px solid var(--line-strong);
}

.axis-label {
  position: absolute;
  bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  transform: translateX(-50%);
}

.timeline-lane {
  display: grid;
  grid-template-columns: 152px minmax(2032px, 1fr);
  gap: 16px;
  min-height: 214px;
  border-bottom: 1px solid var(--line);
}

.lane-label {
  padding-top: 26px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 14px;
  font-weight: 600;
}

.lane-track {
  position: relative;
}

.lane-track::before {
  position: absolute;
  top: 101px;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--line-strong);
  content: "";
}

.timeline-node {
  position: absolute;
  z-index: 2;
  top: var(--node-top);
  width: 116px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  transform: translateX(-50%);
}

.timeline-marker {
  position: absolute;
  z-index: 3;
  top: 97px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 1px var(--red);
  content: "";
  transform: translateX(-50%);
}

.timeline-node-visual {
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.timeline-node strong,
.timeline-node small {
  display: block;
  text-align: center;
}

.timeline-node strong {
  font-size: 11px;
}

.timeline-node small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.timeline-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 22px;
  padding-bottom: 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.timeline-note > span {
  margin-right: 8px;
}

.timeline-note svg {
  width: 15px;
  height: 15px;
}

.relation-chip {
  min-height: 30px;
  color: var(--text);
}

.prompt-layout {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr);
  gap: 56px;
  padding-top: 38px;
  padding-bottom: 72px;
}

.prompt-config {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.field-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-group > label,
.field-group legend,
.field-label-row label {
  display: block;
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 700;
}

.field-label-row label {
  margin-bottom: 0;
}

.field-label-row {
  min-height: 30px;
  margin-bottom: 8px;
}

.field-label-row span {
  color: var(--muted);
  font-size: 11px;
}

.field-group input,
.field-group select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.segmented,
.output-tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.selected-style {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.selected-style-visual {
  width: 92px;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.selected-style strong,
.selected-style small {
  display: block;
}

.selected-style small {
  margin-top: 4px;
  color: var(--muted);
}

.gene-chip {
  gap: 7px;
  min-height: 34px;
  padding-right: 7px;
  background: var(--surface);
  color: var(--text);
}

.gene-chip button {
  display: grid;
  width: 22px;
  height: 22px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
}

.gene-chip button svg {
  width: 12px;
  height: 12px;
}

.palette-picker {
  display: flex;
  gap: 10px;
}

.palette-swatch {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 3px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line-strong);
}

.palette-swatch.is-active {
  box-shadow: 0 0 0 2px var(--text);
}

.prompt-output {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  align-self: start;
  padding-left: 32px;
  border-left: 1px solid var(--line);
}

.output-heading {
  margin-bottom: 14px;
}

.prompt-output textarea {
  width: 100%;
  height: 330px;
  padding: 22px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #1d1d1a;
  color: #f5f5ef;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  line-height: 1.75;
}

.prompt-anatomy {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.anatomy-token {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
}

.anatomy-token i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.output-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.saved-indicator {
  padding: 6px 9px;
  border-radius: 3px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
}

.drawer-layer,
.mobile-filter-sheet {
  position: fixed;
  z-index: 80;
  inset: 0;
}

.drawer-backdrop,
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(20 20 18 / 46%);
  backdrop-filter: blur(3px);
}

.detail-drawer,
.sheet-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  overflow-y: auto;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.detail-drawer {
  width: min(720px, 92vw);
}

.drawer-topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  min-height: 64px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: rgb(243 243 240 / 95%);
  backdrop-filter: blur(14px);
}

.drawer-topbar h2,
.drawer-topbar .drawer-kicker {
  margin: 0;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 26px;
  padding: 28px 28px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.detail-title h2 {
  margin: 8px 0 2px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 30px;
}

.detail-title .detail-en {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.detail-summary {
  margin: 20px 0 12px;
  font-size: 16px;
  line-height: 1.75;
}

.detail-recognition {
  margin: 0;
  padding-left: 12px;
  border-left: 3px solid var(--red);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.detail-visual {
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.detail-body {
  padding: 30px 28px 52px;
}

.detail-section {
  padding: 0 0 30px;
}

.detail-section + .detail-section {
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.detail-section h3 {
  margin-bottom: 16px;
  font-size: 12px;
  text-transform: uppercase;
}

.gene-table,
.compare-table {
  width: 100%;
  border-collapse: collapse;
}

.gene-table th,
.gene-table td,
.compare-table th,
.compare-table td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.6;
}

.gene-table th {
  width: 86px;
  color: var(--muted);
  font-weight: 500;
}

.lineage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.lineage-grid span,
.lineage-grid strong {
  display: block;
}

.lineage-grid span {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.lineage-grid strong {
  font-size: 13px;
  line-height: 1.6;
}

.detail-prompt {
  padding: 16px;
  border-left: 3px solid var(--blue);
  background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.7;
}

.compare-dock {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  left: 50%;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  width: min(720px, calc(100vw - 32px));
  min-height: 68px;
  gap: 10px;
  padding: 10px 12px 10px 18px;
  border: 1px solid var(--text);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.compare-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.compare-item {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 3px;
  background: var(--surface-soft);
  font-size: 11px;
}

.compare-item i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.compare-placeholder {
  color: var(--muted);
  font-size: 12px;
}

.compare-dialog {
  width: min(1000px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--text);
  border-radius: var(--radius-md);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.compare-dialog::backdrop {
  background: rgb(20 20 18 / 50%);
  backdrop-filter: blur(4px);
}

.compare-dialog .drawer-topbar {
  position: sticky;
}

#compareContent {
  padding: 28px;
}

.compare-head {
  display: grid;
  grid-template-columns: 130px 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.compare-style-head {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.compare-style-head .style-visual {
  width: 86px;
}

.compare-style-head h3 {
  margin: 0 0 3px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 18px;
}

.compare-style-head small {
  color: var(--muted);
}

.compare-table th:first-child {
  width: 130px;
  color: var(--muted);
  font-weight: 600;
}

.compare-table td {
  width: calc((100% - 130px) / 2);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  min-height: 70px;
  align-items: center;
  padding: 0 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.toast {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: 26px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--surface);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

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

[hidden] {
  display: none !important;
}

body.has-layer {
  overflow: hidden;
}

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

  .prompt-layout {
    gap: 32px;
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 64px;
  }

  .site-header {
    grid-template-columns: auto 1fr auto;
    padding: 0 20px;
  }

  .brand small {
    display: none;
  }

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

  .primary-nav {
    justify-self: center;
  }

  .nav-item {
    padding: 0 9px;
  }

  .page-band {
    padding-right: 20px;
    padding-left: 20px;
  }

  .atlas-layout {
    display: block;
  }

  .filter-panel {
    display: none;
  }

  .mobile-filter-button {
    display: inline-flex;
    flex: none;
  }

  .sheet-panel {
    width: min(420px, 92vw);
    padding: 0 20px 24px;
  }

  .sheet-panel .drawer-topbar {
    margin: 0 -20px 8px;
  }

  .sheet-apply {
    position: sticky;
    bottom: 0;
    width: 100%;
    margin-top: 24px;
  }

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

  .prompt-output {
    position: static;
    padding: 30px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 680px) {
  .site-header {
    grid-template-columns: 1fr auto;
    min-height: 104px;
    align-content: center;
    gap: 9px 12px;
  }

  .primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
  }

  .nav-item {
    flex: 1;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .atlas-heading,
  .timeline-header,
  .prompt-header {
    padding-top: 32px;
    padding-bottom: 24px;
  }

  .page-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  h1 {
    font-size: 29px;
  }

  .search-box {
    margin-top: 22px;
  }

  .search-box kbd {
    display: none;
  }

  .style-grid {
    gap: 20px 10px;
  }

  .style-name-row {
    display: block;
  }

  .style-card-title {
    font-size: 16px;
  }

  .style-period {
    display: block;
    margin-top: 2px;
  }

  .style-tags span:nth-child(n + 3) {
    display: none;
  }

  .card-tools {
    top: 5px;
    right: 5px;
    opacity: 1;
  }

  .card-tools .icon-button {
    width: 34px;
    height: 34px;
  }

  .detail-drawer {
    width: 100%;
  }

  .detail-hero {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .detail-visual {
    grid-row: 1;
    aspect-ratio: 16 / 10;
  }

  .detail-body {
    padding: 26px 20px 44px;
  }

  .lineage-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .selected-style {
    grid-template-columns: 72px minmax(0, 1fr) auto;
  }

  .selected-style-visual {
    width: 72px;
  }

  .prompt-output textarea {
    height: 290px;
  }

  .output-heading {
    align-items: flex-start;
  }

  .output-tabs button {
    padding: 0 10px;
  }

  .compare-dock {
    right: auto;
    bottom: 10px;
    grid-template-columns: 1fr auto;
  }

  .compare-dock > .icon-button {
    display: none;
  }

  .compare-summary .compare-item:nth-child(2) {
    display: none;
  }

  .compare-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  #compareContent {
    overflow-x: auto;
    padding: 20px;
  }

  .compare-head,
  .compare-table {
    min-width: 720px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 18px 20px;
  }
}

@media (max-width: 420px) {
  .style-grid {
    grid-template-columns: 1fr;
  }

  .style-name-row {
    display: flex;
  }

  .style-period {
    display: inline;
    margin: 0;
  }

  .style-tags span:nth-child(n) {
    display: inline-block;
  }

  .quick-filters {
    flex-wrap: nowrap;
    padding-bottom: 4px;
    overflow-x: auto;
  }

  .chip {
    flex: none;
  }

  .selected-style {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .selected-style .icon-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .output-actions {
    flex-direction: column;
  }
}

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