:root {
  --paper: #f1eadc;
  --ink: #1c1b18;
  --red: #d43d27;
  --blue: #224c73;
  --line: rgba(28, 27, 24, .22);
  --muted: #706b61;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-width: 300px;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: repeating-linear-gradient(0deg, transparent 0 4px, rgba(28,27,24,.035) 5px);
  z-index: -1;
}

.masthead {
  height: 68px;
  padding: 0 clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
  letter-spacing: .08em;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 29px; height: 29px; color: var(--paper); background: var(--ink); border-radius: 50% 50% 46% 54%; font-family: Georgia, serif; font-style: italic; }
.edition { color: var(--muted); font-size: 11px; font-weight: 700; }

main { max-width: 1320px; margin: auto; padding: 0 clamp(20px, 5vw, 72px); }
.hero { min-height: 560px; display: grid; grid-template-columns: 1.3fr .7fr; gap: clamp(40px, 9vw, 140px); align-items: center; padding: 70px 0; }
.eyebrow, .section-no { margin: 0 0 16px; color: var(--red); text-transform: uppercase; font-weight: 800; font-size: 11px; letter-spacing: .18em; }
h1 { margin: 0; font: 700 clamp(62px, 9vw, 132px)/.82 Georgia, "Times New Roman", serif; letter-spacing: -.065em; }
h1 em { color: var(--red); font-weight: 400; }
.intro { max-width: 580px; margin: 38px 0 0; color: #4f4b44; font-size: clamp(16px, 1.6vw, 20px); line-height: 1.8; }

.measure-panel { position: relative; padding: 30px; color: #f7f0e4; background: var(--blue); box-shadow: 12px 12px 0 var(--ink); transform: rotate(1deg); }
.measure-panel::after { content: "MM / CM"; position: absolute; top: 17px; right: 24px; opacity: .45; font: 700 10px/1 Arial; letter-spacing: .14em; }
.measure-panel > label { display: block; margin-bottom: 22px; font-size: 14px; font-weight: 700; }
.measure-input { display: grid; grid-template-columns: 1fr auto; border-bottom: 2px solid #f7f0e4; }
.measure-input input { min-width: 0; width: 100%; padding: 8px 4px 12px; color: #fff; background: transparent; border: 0; outline: none; font: 400 clamp(44px, 5vw, 76px)/1 Georgia, serif; }
.measure-input input::placeholder { color: rgba(255,255,255,.3); }
.unit-switch { display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.unit { padding: 4px 7px; color: rgba(255,255,255,.55); background: none; border: 0; cursor: pointer; font-weight: 700; }
.unit.active { color: var(--ink); background: #f1d05b; }
.hint { min-height: 40px; margin: 18px 0 24px; color: rgba(255,255,255,.75); font-size: 12px; line-height: 1.65; }
.hint.error { color: #ffd060; font-weight: 700; }
.primary { width: 100%; padding: 15px 18px; display: flex; justify-content: space-between; color: var(--ink); background: #f1d05b; border: 1px solid var(--ink); cursor: pointer; font-weight: 800; font-size: 15px; }
.primary:hover { background: #fff0ae; }

.formats { padding: 70px 0; display: grid; grid-template-columns: .7fr 1.3fr; gap: 30px; border-top: 1px solid var(--ink); }
h2 { margin: 0; font: 700 clamp(30px, 3.5vw, 52px)/1.05 Georgia, serif; letter-spacing: -.025em; }
.format-list { display: flex; flex-wrap: wrap; gap: 10px; align-content: start; }
.format-option { position: relative; }
.format-option input { position: absolute; opacity: 0; }
.format-option label { display: block; padding: 12px 16px; border: 1px solid var(--ink); cursor: pointer; font-size: 13px; font-weight: 700; transition: .15s; }
.format-option input:checked + label { color: var(--paper); background: var(--ink); box-shadow: 4px 4px 0 var(--red); transform: translate(-2px,-2px); }
.format-option input:focus-visible + label { outline: 3px solid var(--blue); outline-offset: 3px; }

.results { padding: 70px 0 84px; border-top: 1px solid var(--ink); }
.results-head { display: flex; justify-content: space-between; gap: 30px; align-items: end; margin-bottom: 38px; }
.results-head > p { max-width: 420px; margin: 0; color: var(--muted); line-height: 1.6; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.empty-state { grid-column: 1/-1; padding: 60px 20px; text-align: center; border: 1px dashed var(--muted); }
.empty-state p { margin: 12px 0 6px; font: 700 24px Georgia, serif; }
.empty-state small { color: var(--muted); }
.footprint { display: inline-grid; place-items: center; width: 50px; height: 70px; color: var(--paper); background: var(--blue); border-radius: 55% 45% 50% 50%; font-size: 26px; transform: rotate(-12deg); }
.result-card { min-height: 240px; padding: 24px; display: flex; flex-direction: column; background: rgba(255,255,255,.32); border: 1px solid var(--ink); overflow: hidden; }
.result-card:nth-child(3n+2) { background: #dfd1b8; }
.result-card:nth-child(3n) { background: #e9c8bd; }
.card-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.system-code { color: var(--red); font: 800 11px Arial; letter-spacing: .18em; }
.system-name { margin-top: 5px; font-weight: 700; }
.size-range { margin: auto 0 22px; font: 700 clamp(39px, 5vw, 68px)/1 Georgia, serif; letter-spacing: -.045em; overflow-wrap: anywhere; }
.size-label { color: var(--muted); font-size: 11px; }
.range-note { margin: 0; padding-top: 13px; border-top: 1px solid var(--line); color: #4c4942; font-size: 12px; line-height: 1.55; }

.fit-note { margin: 0 calc(clamp(20px, 5vw, 72px) * -1); padding: 70px clamp(20px, 5vw, 72px); display: grid; grid-template-columns: .55fr 1.45fr; gap: 30px; color: #f8f0e3; background: var(--ink); }
.fit-note .section-no { color: #f1d05b; }
.fit-note > div { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: start; }
.fit-note p { margin: 0; color: #cbc3b6; line-height: 1.8; }
.fit-note strong { color: #f1d05b; }
footer { padding: 22px clamp(20px, 5vw, 72px); display: flex; justify-content: space-between; color: var(--muted); border-top: 1px solid var(--ink); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 52px 0 70px; gap: 50px; }
  h1 { font-size: clamp(58px, 17vw, 100px); }
  .measure-panel { transform: none; box-shadow: 7px 7px 0 var(--ink); }
  .formats { grid-template-columns: 1fr; }
  .results-head { display: block; }
  .results-head > p { margin-top: 18px; }
  .cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .fit-note { grid-template-columns: 1fr; }
  .fit-note > div { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 500px) {
  .edition { display: none; }
  .masthead { height: 58px; }
  .hero { padding-top: 40px; }
  .intro { margin-top: 28px; }
  .measure-panel { padding: 24px 20px; }
  .formats, .results { padding: 52px 0; }
  .cards { grid-template-columns: 1fr; }
  .result-card { min-height: 205px; }
  .size-range { font-size: 56px; }
  footer { display: block; line-height: 2; }
}
