:root {
  --ink: #151513;
  --muted: #62645c;
  --paper: #f4f0e7;
  --panel: #fbf8ef;
  --soft: #ebe4d8;
  --line: rgba(21, 21, 19, 0.16);
  --moss: #58644f;
  --clay: #9b6f51;
  --white: #fffdf6;
  font-family: "Inter", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.65;
}

body.is-busy {
  cursor: progress;
}

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

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

button {
  color: inherit;
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

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

img {
  display: block;
  width: 100%;
}

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

.custom-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 54px);
  background: rgba(244, 240, 231, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: grid;
  gap: 1px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.brand span:last-child {
  font-weight: 500;
}

.custom-header nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 30px);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.custom-page {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 62px) clamp(18px, 4vw, 54px) 70px;
}

.custom-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: clamp(24px, 6vw, 90px);
  align-items: end;
  margin-bottom: 34px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.section-no {
  color: var(--clay);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.custom-hero h1 {
  max-width: 760px;
  margin-top: 10px;
  font-size: clamp(40px, 8vw, 88px);
  line-height: 0.96;
  letter-spacing: 0;
}

.custom-hero p {
  max-width: 720px;
  margin-top: 18px;
  color: var(--muted);
  font-size: clamp(15px, 1.5vw, 18px);
}

.brief-card {
  min-height: 180px;
  padding: 22px;
  background: var(--ink);
  color: var(--white);
}

.brief-card span {
  display: block;
  color: rgba(255, 253, 246, 0.62);
  font-size: 12px;
  font-weight: 900;
}

.brief-card strong {
  display: block;
  margin-top: 46px;
  font-size: 30px;
  line-height: 1;
}

.brief-card small {
  display: block;
  margin-top: 12px;
  color: rgba(255, 253, 246, 0.72);
}

.custom-form {
  display: grid;
  gap: 22px;
}

.form-section,
.submit-panel {
  padding: clamp(20px, 4vw, 34px);
  background: var(--panel);
  border: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.section-head h2 {
  margin-top: 4px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
}

.section-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--clay);
  font-size: 13px;
  font-weight: 900;
}

.field em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  min-height: 48px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fffaf0;
  border: 1px solid rgba(21, 21, 19, 0.18);
  border-radius: 0;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(88, 100, 79, 0.4);
  outline-offset: 2px;
}

.grid-3,
.grid-2 {
  display: grid;
  gap: 14px;
}

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

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

.wide,
.optional-block {
  margin-top: 14px;
}

.optional-block {
  border: 1px solid rgba(21, 21, 19, 0.14);
  background: #f4efe4;
}

.optional-block summary {
  padding: 14px 16px;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.optional-block .grid-3 {
  padding: 0 16px 16px;
}

.direction-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
  padding: 18px;
  margin-bottom: 18px;
  background: #f1eadf;
  border: 1px solid var(--line);
}

.direction-note strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.direction-note p {
  color: var(--muted);
}

.view-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.view-card {
  display: grid;
  gap: 12px;
  min-height: 250px;
  padding: 18px;
  background: #fffaf0;
  border: 1px solid rgba(21, 21, 19, 0.14);
}

.view-card.is-complete {
  border-color: rgba(88, 100, 79, 0.52);
  box-shadow: inset 3px 0 0 var(--moss);
}

.view-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.view-title h3 {
  font-size: 20px;
  line-height: 1.2;
}

.view-title small,
.photo-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.view-hint {
  color: var(--muted);
  min-height: 50px;
}

.view-diagram {
  position: relative;
  height: 96px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(21, 21, 19, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(21, 21, 19, 0.08) 1px, transparent 1px),
    #f0eadf;
  background-size: 24px 24px;
  border: 1px solid rgba(21, 21, 19, 0.12);
}

.view-diagram::before,
.view-diagram::after {
  position: absolute;
  content: "";
}

.view-diagram::before {
  width: 42px;
  height: 42px;
  left: calc(var(--x, 50) * 1%);
  top: calc(var(--y, 50) * 1%);
  background: var(--clay);
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.view-diagram::after {
  left: calc(var(--x, 50) * 1%);
  top: calc(var(--y, 50) * 1%);
  width: 74px;
  height: 2px;
  background: var(--ink);
  transform: translate(0, -50%) rotate(var(--angle, 0deg));
  transform-origin: left center;
}

.view-diagram[data-view="top"] {
  --x: 50;
  --y: 50;
  --angle: 90deg;
}

.view-diagram[data-view="front"] {
  --x: 50;
  --y: 88;
  --angle: -90deg;
}

.view-diagram[data-view="back"] {
  --x: 50;
  --y: 12;
  --angle: 90deg;
}

.view-diagram[data-view="left"] {
  --x: 10;
  --y: 50;
  --angle: 0deg;
}

.view-diagram[data-view="right"] {
  --x: 90;
  --y: 50;
  --angle: 180deg;
}

.view-diagram[data-view="oblique"] {
  --x: 18;
  --y: 18;
  --angle: 32deg;
}

.view-diagram[data-view="low"] {
  --x: 22;
  --y: 78;
  --angle: -40deg;
}

.upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.upload-button,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  color: var(--ink);
  background: transparent;
  border: 1px solid rgba(21, 21, 19, 0.22);
  font-weight: 900;
}

.upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.low-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.thumb {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--soft);
  border: 1px solid rgba(21, 21, 19, 0.12);
}

.thumb img {
  height: 82px;
  object-fit: cover;
}

.thumb button {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--white);
  background: rgba(21, 21, 19, 0.72);
  border: 0;
}

.thumb span {
  display: block;
  padding: 6px 7px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 14px;
  margin-bottom: 18px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.product-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow: hidden;
  background: #fffaf0;
  border: 1px solid rgba(21, 21, 19, 0.14);
}

.product-card.is-selected {
  border-color: rgba(88, 100, 79, 0.6);
  box-shadow: inset 0 0 0 3px rgba(88, 100, 79, 0.18);
}

.product-card button {
  padding: 0;
  text-align: left;
  background: transparent;
  border: 0;
}

.product-image {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--soft);
  overflow: hidden;
}

.product-image img {
  height: 100%;
  object-fit: cover;
}

.select-mark {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--white);
  background: rgba(21, 21, 19, 0.78);
  font-size: 18px;
  font-weight: 900;
}

.is-selected .select-mark {
  background: var(--moss);
}

.product-copy {
  padding: 12px;
}

.product-copy small {
  display: block;
  color: var(--clay);
  font-size: 11px;
  font-weight: 900;
}

.product-copy strong {
  display: block;
  margin-top: 3px;
  font-size: 15px;
  line-height: 1.32;
}

.product-copy span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.reference-list {
  display: grid;
  gap: 12px;
}

.reference-item {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  background: #fffaf0;
  border: 1px solid rgba(21, 21, 19, 0.14);
}

.reference-item img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--soft);
}

.reference-copy {
  display: grid;
  gap: 12px;
}

.reference-copy h3 {
  font-size: 20px;
}

.level-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.level-row label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 10px;
  background: #f1eadf;
  border: 1px solid rgba(21, 21, 19, 0.14);
  font-size: 13px;
  font-weight: 800;
}

.submit-panel {
  position: sticky;
  bottom: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(251, 248, 239, 0.94);
  backdrop-filter: blur(16px);
}

.submit-panel p {
  color: var(--muted);
}

.submit-button {
  min-height: 52px;
  min-width: 190px;
  padding: 13px 22px;
  color: var(--white);
  background: var(--ink);
  border: 1px solid var(--ink);
  font-weight: 900;
}

.submit-button:hover {
  background: #30302a;
}

.submit-panel.is-success {
  position: static;
  background: #e8ece0;
  border-color: rgba(88, 100, 79, 0.36);
}

.submit-panel.is-success .submit-button {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  color: var(--white);
  background: var(--ink);
  transform: translateX(-50%);
}

@media (max-width: 1080px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .custom-hero {
    grid-template-columns: 1fr;
  }

  .brief-card {
    min-height: 130px;
  }

  .brief-card strong {
    margin-top: 22px;
  }
}

@media (max-width: 760px) {
  .custom-header {
    align-items: start;
  }

  .custom-header nav {
    display: grid;
    gap: 5px;
    text-align: right;
  }

  .custom-page {
    padding: 24px 16px 48px;
  }

  .custom-hero h1 {
    font-size: 42px;
  }

  .section-head,
  .submit-panel {
    display: grid;
  }

  .grid-3,
  .grid-2,
  .direction-note,
  .view-grid,
  .catalog-tools,
  .reference-item {
    grid-template-columns: 1fr;
  }

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

  .view-card {
    min-height: auto;
  }

  .submit-panel {
    position: static;
  }

  .submit-button {
    width: 100%;
  }
}

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

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