:root {
  color-scheme: light;
  --paper: #f3efeb;
  --surface: #fdfcfb;
  --ink: #29232a;
  --muted: #685f66;
  --line: #d8d0ce;
  --berry: #6c2947;
  --berry-soft: #f2e7ed;
  --stage: #dededc;
  --display: "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, p, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--berry); outline-offset: 4px; }

.shell {
  max-width: 1472px;
  min-height: calc(100vh - 64px);
  margin: 32px auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 6px 0 #2d1c240d;
}

@media (min-width: 769px) {
  body { padding: 0 32px; }
}

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 64px);
  min-height: 70px;
  padding: 0 clamp(22px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
}

.brand, .all-styles, .share-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  white-space: nowrap;
}

.brand { font-size: 18px; font-weight: 650; letter-spacing: .035em; }
.brand-mark { position: relative; flex: 0 0 24px; height: 18px; }
.brand-mark::before, .brand-mark::after {
  position: absolute;
  top: 0;
  width: 15px;
  height: 18px;
  border: 1.7px solid var(--berry);
  border-radius: 50%;
  content: "";
}
.brand-mark::after { left: 8px; border-color: var(--ink); }
.all-styles { font-size: 14px; color: var(--muted); }
.all-styles:hover, .share-button:hover { color: var(--berry); }
.back-icon {
  width: 8px;
  height: 8px;
  border: solid currentColor;
  border-width: 0 0 1.5px 1.5px;
  transform: rotate(45deg);
}
.share-button {
  margin-left: auto;
  padding: 0 2px 0 8px;
  border: 0;
  background: transparent;
  font-size: 14px;
}
.share-icon {
  position: relative;
  width: 16px;
  height: 9px;
  margin-top: 8px;
  border: solid currentColor;
  border-width: 0 1.4px 1.4px;
}
.share-icon::before, .share-icon::after { position: absolute; content: ""; }
.share-icon::before { width: 1.4px; height: 12px; top: -8px; left: 6px; background: currentColor; }
.share-icon::after { width: 7px; height: 7px; top: -8px; left: 3px; border: solid currentColor; border-width: 1.4px 0 0 1.4px; transform: rotate(45deg); }
.share-feedback { position: absolute; top: calc(100% + 10px); right: 18px; max-width: calc(100vw - 36px); }
.share-status:empty { display: none; }
.share-status, .share-manual {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 6px 18px #2d1c2417;
  font-size: 14px;
}
.share-manual { position: relative; width: min(340px, calc(100vw - 36px)); }
.share-manual input { width: 100%; margin-top: 10px; border: 1px solid var(--line); border-radius: 4px; padding: 9px; color: var(--ink); background: var(--paper); }
.close-share { position: absolute; top: 4px; right: 6px; width: 36px; height: 36px; border: 0; background: transparent; font-size: 22px; }

h1, h2 { font-family: var(--display); font-weight: 700; line-height: 1.27; }
.catalog { max-width: 1220px; margin: 0 auto; padding: clamp(30px, 4vw, 54px) clamp(22px, 4vw, 54px) 55px; }
.catalog-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; margin-bottom: 22px; }
.catalog-heading h1 { font-size: clamp(32px, 4vw, 48px); }
.catalog-heading p, .catalog-details p, .product-heading p { color: var(--muted); }
.catalog-heading p { white-space: nowrap; font-size: 14px; }
.catalog-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 3vw, 40px); }
.catalog-card { display: block; }
.catalog-image { border-radius: 8px; overflow: hidden; background: var(--stage); aspect-ratio: 1.16; }
.catalog-list li:nth-child(even) .catalog-image { background: #f0eeeb; }
.catalog-image img { width: 100%; height: 100%; object-fit: contain; }
.catalog-list li:first-child .catalog-image img { object-fit: cover; }
.catalog-details { display: flex; justify-content: space-between; gap: 10px; align-items: end; padding-top: 15px; }
.catalog-details h2 { font-size: clamp(21px, 2.2vw, 30px); }
.catalog-details p { margin-top: 9px; font-size: 14px; }
.catalog-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  min-height: 42px;
  border-radius: 99px;
  background: var(--berry);
  color: #fff;
  font-size: 14px;
  white-space: nowrap;
}
.catalog-card:hover .catalog-action, .catalog-action:hover { background: #542039; }

.detail-layout { display: grid; grid-template-columns: clamp(184px, 19%, 284px) minmax(0, 1fr); }
.rail { padding: 28px clamp(12px, 1.8vw, 25px) 36px; border-right: 1px solid var(--line); }
.rail h2 { margin: 0 8px 16px; font-size: 25px; }
.rail li + li { margin-top: 11px; }
.rail-item { display: block; padding: 9px; border-radius: 7px; }
.rail-item[aria-current="page"], .rail-item:hover { background: var(--berry-soft); }
.rail-picture { display: block; width: 78px; height: 100px; margin-bottom: 9px; background: var(--stage); overflow: hidden; border-radius: 5px; }
.rail-picture img { width: 100%; height: 100%; object-fit: contain; }
.rail-name, .rail-category { display: block; }
.rail-name { font-size: 15px; font-weight: 600; line-height: 1.4; }
.rail-category { margin-top: 4px; color: var(--muted); font-size: 13px; }

.product { min-width: 0; padding: clamp(24px, 3vw, 42px) clamp(20px, 3.1vw, 48px) 32px; }
.product-heading { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
.product-heading h1 { font-size: clamp(28px, 3vw, 46px); }
.product-heading p { margin-top: 9px; font-size: 15px; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; width: min(100%, 272px); padding: 3px; border-radius: 99px; background: #f1eeec; }
.mode-switch button, .angles button { min-height: 44px; border-radius: 99px; font-size: 14px; white-space: nowrap; }
.mode-switch button { padding: 6px 12px; border: 0; color: var(--muted); background: transparent; }
.mode-switch button[aria-pressed="true"], .angles button[aria-pressed="true"] { border-color: var(--berry); color: #fff; background: var(--berry); }
.mode-switch button[aria-pressed="false"]:hover, .angles button[aria-pressed="false"]:hover { color: var(--berry); background: var(--berry-soft); }

.stage {
  position: relative;
  height: 520px;
  height: clamp(370px, calc(100svh - 370px), 650px);
  overflow: hidden;
  isolation: isolate;
  border-radius: 8px;
  background: var(--stage);
}
.stage:focus-within { outline: 2px solid var(--berry); outline-offset: 3px; }
.stage model-viewer, .stage-poster { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-poster { object-fit: contain; pointer-events: none; }
.photo-stage { background: #f0eeeb; }
.model-status {
  position: absolute;
  top: 12px;
  left: 12px;
  max-width: calc(100% - 24px);
  padding: 6px 11px;
  border-radius: 99px;
  background: #fdfcfbf2;
  color: var(--berry);
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
}
.angles { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.angles button { min-width: 64px; padding: 5px 14px; border: 1px solid var(--line); background: transparent; }
.view-hint, .comparison-caption { margin-top: 13px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.view-hint { text-align: center; }
.stage[data-model-state="fallback"] ~ .view-hint { display: none; }
.mobile-hint, .comparison-mobile { display: none; }

.comparison-desktop { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 2vw, 26px); }
.comparison-desktop figcaption { margin-bottom: 10px; font-weight: 600; }
.comparison-desktop img { width: 100%; height: auto; border-radius: 7px; background: var(--stage); }
.comparison-caption { margin-top: 16px; }
.missing { padding: 48px 28px; text-align: center; }
.missing .catalog-action { margin-top: 20px; }

@media (max-width: 768px) {
  .shell { min-height: 100vh; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  .site-header { min-height: 58px; padding: max(0px, env(safe-area-inset-top)) 18px 0; }
  .detail-header .brand, .share-suffix, .rail, .desktop-hint, .comparison-desktop { display: none; }
  .all-styles { color: var(--ink); }
  .catalog, .product { padding: 24px 18px 32px; }
  .catalog-heading { margin-bottom: 16px; }
  .catalog-list { gap: 20px; grid-template-columns: minmax(0, 1fr); }
  .catalog-image { aspect-ratio: 1.12; }
  .catalog-image img { object-fit: cover; }
  .catalog-details { padding-top: 12px; }
  .catalog-list li + li { padding-top: 18px; border-top: 1px solid var(--line); }
  .catalog-list li + li .catalog-card { display: grid; grid-template-columns: minmax(72px, 25%) minmax(0, 1fr); align-items: center; gap: 14px; }
  .catalog-list li + li .catalog-image { aspect-ratio: .82; }
  .catalog-list li + li .catalog-image img { object-fit: contain; }
  .catalog-list li + li .catalog-details { display: block; padding-top: 0; }
  .catalog-list li + li .catalog-details h2 { font-size: 20px; }
  .catalog-list li + li .catalog-action { min-height: 32px; margin-top: 4px; padding: 0; background: transparent; color: var(--berry); }

  .detail-layout { display: block; }
  .product-heading { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-bottom: 17px; }
  .product-heading h1 { font-size: clamp(25px, 7.1vw, 37px); }
  .product-heading p { margin-top: 7px; font-size: 14px; }
  .mode-switch { width: 100%; }
  .mode-switch button { min-height: 40px; }
  .stage { height: auto; aspect-ratio: 1 / 1.05; border-radius: 5px; }
  .stage-poster { object-fit: cover; }
  .photo-stage .stage-poster { object-fit: contain; }
  .mobile-hint { display: inline; }
  .comparison-mobile {
    --split: 50%;
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 1 / 1.05;
    border-radius: 5px;
    background: var(--stage);
  }
  .comparison-mobile:focus-within { outline: 2px solid var(--berry); outline-offset: 3px; }
  .comparison-mobile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .comparison-original { clip-path: inset(0 calc(100% - var(--split)) 0 0); }
  .comparison-label { position: absolute; top: 12px; padding: 5px 9px; border-radius: 99px; background: #fdfcfbf2; font-size: 12px; pointer-events: none; }
  .label-original { left: 10px; }
  .label-model { right: 10px; }
  .comparison-line { position: absolute; inset: 0 auto 0 var(--split); width: 2px; transform: translateX(-50%); background: #fff; pointer-events: none; }
  .comparison-line span { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--berry); border-radius: 50%; background: #fff; color: var(--berry); font-size: 18px; white-space: nowrap; transform: translate(-50%, -50%); }
  .comparison-range {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    inset: 0 auto 0 -22px;
    width: calc(100% + 44px);
    height: 100%;
    padding: 0;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
    touch-action: pan-y;
  }
  .comparison-range::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 44px; height: 44px; }
  .comparison-range::-moz-range-thumb { width: 44px; height: 44px; border: 0; }
  .comparison-caption { text-align: center; }
}

@media (max-width: 360px) {
  .catalog, .product { padding-right: 14px; padding-left: 14px; }
  .catalog-details .catalog-action { padding-right: 11px; padding-left: 11px; }
}
