:root {
  --paper: #ffffff;
  --ink: #171713;
  --muted: #777269;
  --line: #e2e2de;
  --signal: #b64f33;
  --rail: 172px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Songti SC", "Noto Serif CJK SC", "STSong", serif;
}
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }

.rail {
  position: fixed; inset: 0 auto 0 0; z-index: 20;
  width: var(--rail); padding: 34px 26px 27px;
  border-right: 1px solid var(--line); background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px); display: flex; flex-direction: column;
}
.brand { display: flex; align-items: flex-start; gap: 9px; }
.brand-mark { font-size: 31px; font-weight: 700; line-height: .95; letter-spacing: -.08em; }
.brand-en { font: 600 8px/1.18 Arial, sans-serif; letter-spacing: .12em; }
.rail-nav { margin-top: 104px; display: grid; gap: 22px; }
.rail-nav a { color: var(--muted); font-size: 12px; writing-mode: vertical-rl; height: 97px; letter-spacing: .16em; }
.rail-nav a span { color: var(--signal); font: 700 8px/1 Arial, sans-serif; margin-bottom: 8px; }
.rail-nav a.active { color: var(--ink); }
.rail-note { margin: auto 0 0; font: 600 8px/1.5 Arial, sans-serif; letter-spacing: .17em; color: var(--muted); }

main { margin-left: var(--rail); min-height: 100vh; }
.hero { position: relative; min-height: 590px; padding: 36px clamp(34px, 6vw, 108px) 66px; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-kicker { display: flex; justify-content: space-between; font: 600 9px/1 Arial, sans-serif; letter-spacing: .2em; }
.hero-grid { margin-top: 117px; display: grid; grid-template-columns: minmax(530px, 1.5fr) minmax(260px, .7fr); align-items: end; gap: 70px; }
.hero h1 { margin: 0; font-size: clamp(58px, 7.2vw, 118px); font-weight: 500; line-height: .98; letter-spacing: -.065em; }
.hero-copy { padding-bottom: 10px; max-width: 370px; }
.hero-copy p { font-size: 20px; line-height: 1.65; margin: 0; }
.hero-copy .hero-small { margin-top: 35px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.random-pick { margin-top: 31px; padding: 0 0 7px; border: 0; border-bottom: 1px solid var(--ink); background: transparent; cursor: pointer; font-size: 12px; }
.random-pick span { display: inline-block; margin-left: 22px; transition: transform .2s; }
.random-pick:hover span { transform: translate(3px, -3px); }
.hero-stamp { position: absolute; right: 47%; bottom: 39px; width: 61px; height: 61px; border: 1px solid var(--signal); border-radius: 50%; color: var(--signal); display: grid; place-content: center; text-align: center; font-size: 10px; line-height: 1.35; transform: rotate(-9deg); }

.toolbar { position: sticky; top: 0; z-index: 10; padding: 18px clamp(28px, 4vw, 62px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.filters { display: flex; align-items: center; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.filter { white-space: nowrap; border: 0; background: transparent; color: var(--muted); padding: 8px 11px; cursor: pointer; font-size: 12px; }
.filter.active { color: var(--paper); background: var(--ink); border-radius: 20px; }
.filter sup { margin-left: 4px; color: #d7d0c4; }
.filter.original-filter { color: var(--signal); }
.filter.original-filter::before { content: "●"; margin-right: 6px; font-size: 6px; vertical-align: 1px; }
.filter.original-filter.active { color: var(--paper); background: var(--signal); }
.filter.original-filter.active sup { color: rgba(255,255,255,.72); }
.search { min-width: 215px; border-bottom: 1px solid var(--ink); display: flex; align-items: center; gap: 12px; padding: 5px 0 7px; font-size: 10px; letter-spacing: .14em; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 11px; letter-spacing: 0; color: var(--ink); }
.result-line { padding: 19px clamp(28px, 4vw, 62px) 0; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font: 600 9px/1 Arial, sans-serif; letter-spacing: .14em; }
.availability-toggle { border: 1px solid var(--line); border-radius: 20px; padding: 7px 11px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; letter-spacing: .05em; }
.availability-toggle.active { color: var(--signal); border-color: rgba(182,79,51,.45); }

.gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: 75px 28px; padding: 88px clamp(28px, 4vw, 62px) 135px; align-items: start; }
.style-card { grid-column: span 4; }
.style-card.wide { grid-column: span 5; }
.style-card.offset-small { grid-column: span 3; margin-top: 105px; }
.style-card:nth-child(4) { grid-column: 2 / span 4; margin-top: 10px; }
.style-card:nth-child(5) { grid-column: 7 / span 4; margin-top: -35px; }
.style-card:nth-child(6) { grid-column: 11 / span 2; margin-top: 165px; }
.style-card:nth-child(9n + 7) { margin-left: 13%; }
.image-button { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #f2f2f0; cursor: pointer; overflow: hidden; }
.image-button img { display: block; width: 100%; aspect-ratio: 4/5; object-fit: cover; filter: saturate(.9) contrast(.98); transition: transform .65s cubic-bezier(.2,.7,.2,1), filter .4s; }
.wide .image-button img { aspect-ratio: 5/4; }
.image-button::after { content: ""; position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.35); pointer-events: none; }
.image-button:hover img { transform: scale(1.018); filter: saturate(1) contrast(1); }
.card-number { position: absolute; left: 10px; top: 10px; padding: 5px 7px; background: var(--paper); font: 700 8px/1 Arial, sans-serif; letter-spacing: .1em; }
.pick { position: absolute; right: 0; bottom: 0; padding: 10px 12px; background: var(--ink); color: var(--paper); font-size: 10px; transform: translateY(100%); transition: transform .25s; }
.image-button:hover .pick { transform: translateY(0); }
.card-meta { display: flex; justify-content: space-between; align-items: flex-start; padding-top: 15px; }
.eyebrow { margin: 0 0 7px; color: var(--signal); font: 700 8px/1 Arial, sans-serif; letter-spacing: .17em; }
.card-meta h2 { margin: 0; font-size: clamp(22px, 2vw, 34px); line-height: 1.03; font-weight: 500; letter-spacing: -.035em; }
.card-author { margin: 10px 0 0; color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.heart { border: 0; background: transparent; font: 300 27px/1 Georgia, serif; cursor: pointer; color: var(--ink); }
.heart.saved { color: var(--signal); }
.style-card.unavailable .image-button img { filter: grayscale(.72) contrast(.91); }
.style-card.unavailable .eyebrow { color: var(--muted); }
.style-card.original .card-number { color: var(--paper); background: var(--signal); }
.style-card.original .eyebrow { color: var(--signal); }
.load-more-wrap { margin: -55px 0 115px; text-align: center; }
.load-more { min-width: 220px; padding: 15px 18px; border: 1px solid var(--ink); background: transparent; cursor: pointer; font-size: 12px; }
.load-more span { display: inline-block; margin-left: 35px; transition: transform .2s; }
.load-more:hover { background: var(--ink); color: var(--paper); }
.load-more:hover span { transform: translateY(3px); }

.empty-state { min-height: 560px; padding: 130px clamp(34px, 8vw, 150px); }
.empty-state h2 { margin: 24px 0 12px; font-size: 60px; font-weight: 500; letter-spacing: -.05em; }
.empty-state > p:last-child { color: var(--muted); }

.how { padding: 110px clamp(34px, 8vw, 150px); border-top: 1px solid var(--line); display: grid; grid-template-columns: .45fr 1.4fr .65fr; gap: 60px; align-items: start; }
.section-index { font: 700 9px/1 Arial, sans-serif; color: var(--signal); letter-spacing: .18em; }
.how h2 { font-size: clamp(38px, 5vw, 75px); line-height: 1.08; letter-spacing: -.055em; font-weight: 500; margin: 0; }
.how > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.9; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 64px; }
.steps p { margin: 0; border-top: 1px solid var(--ink); padding-top: 12px; display: grid; gap: 20px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.steps b { color: var(--signal); font: 700 9px/1 Arial, sans-serif; }
.how .how-note { margin-top: 7px; }
.how-note code { background: rgba(23,23,19,.07); padding: 2px 5px; font: 11px/1.5 ui-monospace, monospace; }

.source { padding: 110px clamp(34px, 8vw, 150px); border-top: 1px solid var(--line); display: grid; grid-template-columns: 1.2fr .8fr; gap: 12vw; }
.source h2 { margin: 26px 0 0; font-size: clamp(45px, 5.5vw, 82px); line-height: 1.04; font-weight: 500; letter-spacing: -.06em; }
.source-copy { color: var(--muted); font-size: 13px; line-height: 1.9; }
.source-copy a { color: var(--ink); border-bottom: 1px solid var(--ink); }
.source-copy dl { margin: 55px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.source-copy dl div { border-top: 1px solid var(--line); padding-top: 12px; }
.source-copy dt { color: var(--ink); font: 500 38px/1 Georgia, serif; }
.source-copy dd { margin: 8px 0 0; font-size: 9px; letter-spacing: .08em; }
footer { border-top: 1px solid var(--line); padding: 24px clamp(34px, 4vw, 62px); display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; letter-spacing: .1em; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(16,15,12,.42); opacity: 0; transition: opacity .36s; backdrop-filter: blur(3px); }
.drawer-backdrop.open { opacity: 1; }
.drawer { position: fixed; z-index: 51; inset: 0 0 0 auto; width: min(760px, 92vw); overflow-y: auto; background: #ffffff; box-shadow: -20px 0 70px rgba(15,14,11,.14); transform: translateX(102%); transition: transform .42s cubic-bezier(.22,.75,.25,1); }
.drawer.open { transform: translateX(0); }
.drawer-close { position: sticky; z-index: 3; top: 17px; float: right; margin: 17px 21px 0 0; width: 40px; height: 40px; border: 1px solid var(--ink); border-radius: 50%; background: rgba(255,255,255,.94); cursor: pointer; font: 300 28px/1 Arial, sans-serif; }
.drawer-header { padding: 72px 55px 43px; border-bottom: 1px solid var(--line); }
.drawer-index { color: var(--signal); font: 700 9px/1 Arial, sans-serif; letter-spacing: .18em; }
.drawer-header h2 { margin: 23px 0 25px; max-width: 610px; font-size: clamp(48px, 6vw, 80px); line-height: .95; font-weight: 500; letter-spacing: -.06em; }
.drawer-header > p:last-child { max-width: 490px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.drawer-images { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.drawer-images figure { margin: 0; position: relative; background: var(--paper); }
.drawer-images figure:first-child { grid-column: span 2; }
.drawer-images img { display: block; width: 100%; height: 100%; max-height: 680px; object-fit: cover; }
.drawer-images figure:not(:first-child) img { aspect-ratio: 4/5; }
.drawer-images figcaption { position: absolute; left: 9px; bottom: 8px; padding: 4px 6px; background: rgba(255,255,255,.92); font: 700 7px/1 Arial, sans-serif; letter-spacing: .13em; }
.drawer-facts { padding: 45px 55px; border-bottom: 1px solid var(--line); }
.drawer-facts dl { margin: 0; }
.drawer-facts dl div { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 10px 0; border-bottom: 1px dotted var(--line); }
.drawer-facts dt { color: var(--muted); font-size: 10px; letter-spacing: .1em; }
.drawer-facts dd { margin: 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.drawer-facts dd.ok { color: #47664a; }
.drawer-facts dd.warn { color: var(--signal); }
.source-link { display: inline-block; margin-top: 27px; padding-bottom: 3px; border-bottom: 1px solid var(--ink); font-size: 11px; }
.source-link.muted { border-color: var(--line); color: var(--muted); }
.drawer-actions { padding: 43px 55px 70px; }
.drawer-actions > p { margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.prompt-block { margin-bottom: 42px; }
.prompt-heading { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: end; margin-bottom: 18px; }
.prompt-heading span { color: var(--signal); font: 700 8px/1 Arial, sans-serif; letter-spacing: .18em; }
.prompt-heading h3 { margin: 7px 0 0; font-size: 29px; font-weight: 500; letter-spacing: -.035em; }
.prompt-heading p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; text-align: right; }
.prompt-text { margin: 0; padding: 23px 24px 25px; border: 1px solid var(--line); background: #fafafa; font-size: 13px; line-height: 1.9; white-space: pre-wrap; }
.copy-prompt { width: 100%; padding: 17px 20px; border: 0; background: var(--signal); color: white; display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-size: 12px; }
.copy-prompt b { font: 600 9px/1 Arial, sans-serif; letter-spacing: .12em; }
.copy-prompt:hover { background: var(--ink); }
.codex-actions { padding-top: 33px; border-top: 1px solid var(--line); }
.codex-actions > p { margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.copy-call { width: 100%; min-height: 78px; border: 1px solid var(--ink); background: transparent; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; text-align: left; cursor: pointer; }
.copy-call + .copy-call { margin-top: 9px; }
.copy-call.primary { background: var(--ink); color: var(--paper); }
.copy-call code { max-width: 60%; overflow-wrap: anywhere; font: 10px/1.4 ui-monospace, monospace; text-align: right; }
.copy-call:hover { background: var(--signal); border-color: var(--signal); color: white; }
.drawer-actions .unavailable-copy { padding: 20px; border: 1px solid var(--line); line-height: 1.8; }
.drawer-open { overflow: hidden; }
.toast { position: fixed; z-index: 70; left: calc(var(--rail) + 50%); bottom: 28px; transform: translate(-50%, 25px); padding: 13px 18px; background: var(--ink); color: var(--paper); font-size: 11px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  :root { --rail: 0px; }
  .rail { position: relative; width: 100%; height: 68px; padding: 18px 20px; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; align-items: center; }
  .rail-nav, .rail-note { display: none; }
  main { margin-left: 0; }
  .hero { min-height: 550px; padding: 25px 22px 45px; }
  .hero-grid { margin-top: 102px; grid-template-columns: 1fr; gap: 43px; }
  .hero h1 { font-size: clamp(51px, 14vw, 78px); }
  .hero-copy { margin-left: 18%; }
  .hero-stamp { right: 24px; bottom: 28px; }
  .toolbar { padding: 13px 17px; align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 50px 16px; padding: 57px 17px 90px; }
  .style-card, .style-card.wide, .style-card.offset-small, .style-card:nth-child(4), .style-card:nth-child(5), .style-card:nth-child(6) { grid-column: auto; margin-top: 0; }
  .style-card:nth-child(9n + 7) { margin-left: 0; }
  .style-card:nth-child(even) { margin-top: 72px; }
  .card-meta h2 { font-size: 21px; }
  .how { padding: 75px 23px; grid-template-columns: 1fr; gap: 28px; }
  .steps { margin-top: 45px; }
  .source { padding: 75px 23px; grid-template-columns: 1fr; gap: 55px; }
  .drawer-header, .drawer-facts, .drawer-actions { padding-left: 27px; padding-right: 27px; }
  footer { padding: 20px; gap: 20px; }
}

@media (max-width: 520px) {
  .hero-kicker span:last-child { display: none; }
  .gallery { grid-template-columns: 1fr; }
  .style-card:nth-child(even) { margin-top: 0; }
  .image-button img, .wide .image-button img { aspect-ratio: 4/5; }
  .steps { grid-template-columns: 1fr; }
  .source-copy dl { grid-template-columns: 1fr 1fr; }
  .drawer { width: 100%; }
  .drawer-header h2 { font-size: 50px; }
  .drawer-facts dl div { grid-template-columns: 95px 1fr; }
  .prompt-heading { grid-template-columns: 1fr; }
  .prompt-heading p { text-align: left; }
  footer { flex-direction: column; }
}
