/* ============================================================
   机械构造图鉴 / Mechanical Atlas
   Visual system: technical paper, ink, brass, steel
   ============================================================ */

:root {
  --paper: #f3f0e8;
  --paper-bright: #fbf9f3;
  --paper-deep: #e8e2d6;
  --ink: #14262e;
  --ink-soft: #263c45;
  --muted: #748083;
  --muted-dark: #9ba7a6;
  --line: #d7d0c2;
  --line-strong: #bdb5a5;
  --brass: #a9773c;
  --brass-light: #c79b62;
  --brass-pale: #e4d2b5;
  --red: #a34a32;
  --steel: #617b88;
  --catalog: #12232a;
  --catalog-2: #182f37;
  --catalog-line: rgba(211, 222, 219, 0.13);
  --catalog-text: #e9e5da;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", "Consolas", "Liberation Mono", monospace;

  --catalog-w: 296px;
  --dossier-w: 366px;
  --mast-h: 74px;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
}

body {
  overflow: hidden;
  font-family: var(--sans);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.34'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

::selection {
  background: var(--brass);
  color: var(--paper-bright);
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 1px solid var(--brass);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(116, 128, 131, 0.34);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(169, 119, 60, 0.55);
}

.app {
  display: grid;
  grid-template-columns: var(--catalog-w) minmax(0, 1fr) var(--dossier-w);
  grid-template-rows: var(--mast-h) minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.eyebrow i {
  font-style: normal;
  color: var(--brass);
}

/* ------------------------------------------------------------ masthead */

.masthead {
  position: relative;
  z-index: 20;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 25px;
  border-bottom: 1px solid var(--line-strong);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.32), transparent 40%),
    var(--paper);
}

.masthead::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--brass) 0 118px, transparent 118px 100%);
  opacity: 0.7;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.monogram {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.02em;
}

.monogram span {
  color: var(--brass);
  padding: 0 1px;
}

.monogram::before,
.monogram::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border: 1px solid var(--brass);
}

.monogram::before {
  left: -3px;
  top: -3px;
  border-right: 0;
  border-bottom: 0;
}

.monogram::after {
  right: -3px;
  bottom: -3px;
  border-left: 0;
  border-top: 0;
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.13em;
  white-space: nowrap;
}

.brand-copy p {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 7.5px;
  line-height: 1.2;
  letter-spacing: 0.19em;
  color: var(--muted);
  white-space: nowrap;
}

.brand-copy p i {
  padding: 0 4px;
  color: var(--brass);
  font-style: normal;
}

.masthead-meta {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-left: auto;
  height: 34px;
}

.meta-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 88px;
  padding: 0 20px;
  border-left: 1px solid var(--line);
}

.meta-cell span {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.meta-cell b {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.verified {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: 12px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.verified i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #748c65;
  box-shadow: 0 0 0 3px rgba(116, 140, 101, 0.13);
}

.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  padding: 9px 7px;
  flex-direction: column;
  justify-content: space-between;
  margin-left: auto;
}

.menu-toggle span {
  display: block;
  height: 1px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.3s;
}

/* ------------------------------------------------------------ catalog */

.catalog {
  position: relative;
  z-index: 12;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 19px 15px 16px;
  background:
    radial-gradient(120% 50% at 10% 0%, rgba(87, 118, 124, 0.18), transparent 55%),
    linear-gradient(160deg, #152930 0%, #12232a 52%, #101f26 100%);
  color: var(--catalog-text);
  border-right: 1px solid rgba(10, 21, 25, 0.7);
}

.catalog::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(var(--catalog-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--catalog-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, transparent 0, #000 26%, #000 84%, transparent 100%);
}

.catalog > * {
  position: relative;
  z-index: 1;
}

.catalog-head {
  padding: 2px 5px 0;
}

.catalog-head > .eyebrow {
  color: #94a3a2;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 15px;
}

.filter {
  padding: 4px 7px 3px;
  border: 1px solid rgba(198, 214, 211, 0.17);
  color: #a8b5b4;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.filter:hover {
  color: #eee9dd;
  border-color: rgba(199, 155, 98, 0.45);
}

.filter.is-active {
  background: var(--brass);
  border-color: var(--brass);
  color: #14262e;
}

.filter em {
  margin-left: 4px;
  font-style: normal;
  opacity: 0.58;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 33px;
  margin-top: 10px;
  padding: 0 9px;
  border: 1px solid rgba(198, 214, 211, 0.15);
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 0.2s, background 0.2s;
}

.search:focus-within {
  border-color: rgba(199, 155, 98, 0.6);
  background: rgba(255, 255, 255, 0.04);
}

.search svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  fill: none;
  stroke: #849392;
  stroke-width: 1.3;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #e8e4d8;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.search input::placeholder {
  color: #667774;
}

.model-list {
  flex: 1 1 auto;
  min-height: 0;
  margin: 13px -9px 0;
  padding: 0 9px 22px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(199, 155, 98, 0.3) transparent;
}

.model-item {
  position: relative;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  column-gap: 9px;
  width: 100%;
  padding: 12px 8px 11px 7px;
  border-top: 1px solid var(--catalog-line);
  text-align: left;
  color: #dfddd3;
  transition: background 0.25s var(--ease), color 0.25s;
}

.model-item:last-child {
  border-bottom: 1px solid var(--catalog-line);
}

.model-item::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--brass);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s var(--ease);
}

.model-item:hover {
  background: rgba(255, 255, 255, 0.035);
}

.model-item:hover::before,
.model-item.is-active::before {
  transform: scaleY(1);
}

.model-item.is-active {
  background:
    linear-gradient(90deg, rgba(169, 119, 60, 0.12), transparent 80%),
    rgba(255, 255, 255, 0.025);
}

.model-no {
  padding-top: 2px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: #7e8f8e;
}

.model-item.is-active .model-no {
  color: var(--brass-light);
}

.model-name {
  display: block;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ece8dc;
}

.model-item.is-active .model-name {
  color: #fffaf0;
}

.model-en {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 6.5px;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #71827f;
}

.model-meta {
  padding-top: 2px;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: #8b9a98;
  white-space: nowrap;
}

.model-item.is-active .model-meta {
  color: var(--brass-light);
}

.model-empty {
  padding: 28px 8px;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.8;
  letter-spacing: 0.08em;
  color: #71827f;
}

.catalog-foot {
  flex: 0 0 auto;
  padding: 14px 6px 0;
  border-top: 1px solid rgba(198, 214, 211, 0.15);
}

.catalog-foot > .eyebrow {
  margin-bottom: 8px;
  color: #758682;
}

.hint-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 6px;
  color: #9aa7a5;
  font-size: 9px;
  letter-spacing: 0.04em;
}

.hint-row kbd {
  min-width: 38px;
  padding: 2px 4px;
  border: 1px solid rgba(198, 214, 211, 0.16);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 400;
  text-align: center;
  color: #b9c2bd;
}

.catalog-signature {
  display: flex;
  gap: 8px;
  margin-top: 13px;
  padding-top: 9px;
  border-top: 1px dotted rgba(198, 214, 211, 0.15);
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.14em;
  color: #5b6d6a;
}

.catalog-signature span {
  white-space: nowrap;
}

/* ------------------------------------------------------------ stage */

.stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 53% 37%, #fcfaf4 0%, #f4f1e9 39%, #ece6da 76%, #e4ddcf 100%);
}

.stage::before {
  content: "";
  position: absolute;
  top: -18%;
  left: 17%;
  width: 66%;
  height: 64%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.7), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

#scene {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  outline: none;
}

#scene.is-dragging {
  cursor: grabbing;
}

.stage-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.46;
  background-image:
    linear-gradient(rgba(49, 74, 82, 0.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 74, 82, 0.065) 1px, transparent 1px),
    linear-gradient(rgba(49, 74, 82, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 74, 82, 0.026) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px, 16px 16px, 16px 16px;
  background-position: center center;
  mask-image: radial-gradient(ellipse at 52% 46%, #000 10%, rgba(0, 0, 0, 0.76) 47%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at 52% 46%, #000 10%, rgba(0, 0, 0, 0.76) 47%, transparent 78%);
  pointer-events: none;
}

.stage-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(75, 63, 44, 0.055), transparent 12%, transparent 88%, rgba(75, 63, 44, 0.05)),
    linear-gradient(0deg, rgba(75, 63, 44, 0.075), transparent 18%, transparent 86%, rgba(75, 63, 44, 0.035)),
    radial-gradient(ellipse at 50% 43%, transparent 45%, rgba(67, 58, 45, 0.08) 100%);
  mix-blend-mode: multiply;
}

.stage-head {
  position: absolute;
  top: 29px;
  left: 36px;
  z-index: 5;
  width: min(560px, 49%);
  pointer-events: none;
  animation: head-in 0.7s var(--ease) both;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 7.5px;
  line-height: 1;
  letter-spacing: 0.16em;
  color: #7a8585;
}

.crumbs i {
  font-style: normal;
  color: var(--brass);
}

.crumbs span {
  text-transform: uppercase;
}

.crumbs b {
  font-weight: 500;
  color: var(--brass);
}

.stage-head h2 {
  margin: 11px 0 7px;
  font-family: var(--serif);
  font-size: clamp(29px, 3vw, 43px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: 0.035em;
  color: var(--ink);
}

.model-en {
  margin: 0;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.4;
  letter-spacing: 0.25em;
  color: var(--steel);
  text-transform: uppercase;
}

.model-tag {
  display: inline-block;
  margin: 10px 0 0;
  padding: 4px 9px 3px;
  border-left: 1px solid var(--brass);
  background: rgba(247, 244, 236, 0.52);
  font-family: var(--sans);
  font-size: 9.5px;
  line-height: 1.4;
  letter-spacing: 0.09em;
  color: #6f7b7a;
  backdrop-filter: blur(4px);
}

.stage-status {
  position: absolute;
  top: 31px;
  right: 30px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 27px;
  padding: 0 10px;
  border: 1px solid rgba(30, 55, 64, 0.16);
  background: rgba(246, 243, 235, 0.56);
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.12em;
  color: #6d7a7b;
  pointer-events: none;
}

.stage-status b {
  margin-left: 7px;
  font-size: 8px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.status-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 0 3px rgba(169, 119, 60, 0.12);
  animation: status-pulse 2.4s ease-in-out infinite;
}

.selected-part {
  position: absolute;
  top: 77px;
  right: 30px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  max-width: 230px;
  pointer-events: none;
  text-align: right;
}

.sp-key {
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.16em;
  color: #8a9593;
}

.selected-part b {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.selected-part span:last-child {
  font-size: 8px;
  letter-spacing: 0.06em;
  color: #8a9593;
}

.stage-index {
  position: absolute;
  left: 37px;
  bottom: 113px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: #7c8989;
  pointer-events: none;
}

.stage-index span:first-child {
  color: var(--ink);
}

.stage-index i {
  display: block;
  width: 26px;
  height: 1px;
  background: #b5aea0;
}

.axis-wrap {
  position: absolute;
  right: 23px;
  bottom: 104px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  pointer-events: none;
}

.axis-wrap canvas {
  width: 76px;
  height: 76px;
  opacity: 0.85;
}

.axis-wrap > span {
  margin-top: -3px;
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.17em;
  color: #899391;
}

.label-layer,
.leader-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.label {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px 3px 5px;
  border: 1px solid rgba(30, 55, 64, 0.16);
  background: rgba(247, 244, 236, 0.86);
  box-shadow: 0 4px 16px rgba(28, 44, 48, 0.055);
  backdrop-filter: blur(5px);
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  transform: translate(0, -50%);
  transition: opacity 0.2s, border-color 0.2s, background 0.2s;
}

.label:hover {
  border-color: rgba(169, 119, 60, 0.65);
  background: rgba(252, 249, 241, 0.96);
}

.label .lb-no {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border-radius: 50%;
  background: var(--ink);
  color: #f8f3e8;
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0;
}

.label .lb-txt {
  font-family: var(--sans);
  font-size: 8.5px;
  line-height: 1.2;
  letter-spacing: 0.07em;
  color: #33464c;
}

.label .lb-sub {
  margin-left: 2px;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.03em;
  color: #968773;
}

.label.is-muted {
  opacity: 0.24;
}

.leader-layer line {
  stroke: rgba(169, 119, 60, 0.6);
  stroke-width: 0.7;
}

.leader-layer circle {
  fill: var(--paper-bright);
  stroke: var(--brass);
  stroke-width: 0.8;
}

/* ------------------------------------------------------------ dock */

.dock {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(840px, calc(100% - 48px));
  min-height: 68px;
  padding: 12px 15px;
  border: 1px solid rgba(30, 55, 64, 0.19);
  background:
    linear-gradient(180deg, rgba(252, 249, 242, 0.93), rgba(241, 237, 228, 0.9));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 18px 46px rgba(30, 43, 46, 0.12);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
  animation: dock-in 0.9s var(--ease) 0.15s both;
}

.dock::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 15px;
  width: 58px;
  height: 1px;
  background: var(--brass);
}

.explode-control {
  min-width: 140px;
  flex: 1 1 230px;
  padding: 0 2px;
}

.dock-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.13em;
  color: #7b8786;
}

.dock-label i {
  font-style: normal;
  color: var(--brass);
}

.dock-label b {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 16px;
  margin: 0;
  background: transparent;
  cursor: ew-resize;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(to right, var(--brass) var(--fill, 0%), #c8c1b4 var(--fill, 0%));
}

input[type="range"]::-moz-range-track {
  height: 2px;
  background: #c8c1b4;
}

input[type="range"]::-moz-range-progress {
  height: 2px;
  background: var(--brass);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  margin-top: -5.5px;
  border: 1px solid var(--ink);
  background: var(--paper-bright);
  box-shadow: 0 0 0 3px rgba(247, 244, 236, 0.7);
  transform: rotate(45deg);
  transition: background 0.2s, border-color 0.2s;
}

input[type="range"]:hover::-webkit-slider-thumb {
  background: var(--brass-pale);
  border-color: var(--brass);
}

input[type="range"]::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper-bright);
  transform: rotate(45deg);
}

.range-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 1px;
  padding: 0 1px;
}

.range-ticks i {
  width: 1px;
  height: 3px;
  background: #c8c1b4;
}

.dock-divider {
  width: 1px;
  height: 34px;
  flex: 0 0 1px;
  background: rgba(30, 55, 64, 0.13);
}

.round-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  transition: background 0.2s, color 0.2s;
}

.round-btn:hover {
  background: var(--ink);
  color: var(--paper-bright);
}

.round-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.round-btn .icon-play {
  fill: currentColor;
  stroke: none;
  margin-left: 2px;
}

.round-btn .icon-pause {
  display: none;
}

.round-btn.is-paused .icon-play {
  display: none;
}

.round-btn.is-paused .icon-pause {
  display: block;
}

.speed-control {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.speed-control span {
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.14em;
  color: #929c9a;
}

.speed-control button {
  min-width: 34px;
  padding: 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-align: left;
}

.speed-control button:hover {
  color: var(--brass);
}

.tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 36px;
  height: 40px;
  padding: 3px 6px;
  color: #6c7a7b;
  transition: color 0.2s, background 0.2s;
}

.tool-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-btn span {
  font-size: 7.5px;
  line-height: 1;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.tool-btn:hover {
  color: var(--ink);
  background: rgba(20, 38, 46, 0.045);
}

.tool-btn.is-active {
  color: var(--brass);
  background: rgba(169, 119, 60, 0.07);
}

.tool-btn--last {
  margin-right: -4px;
}

#dossierBtn {
  display: none;
}

/* ------------------------------------------------------------ toast / tip */

.toast {
  position: absolute;
  left: 50%;
  bottom: 103px;
  z-index: 15;
  padding: 7px 12px;
  background: var(--ink);
  color: #f5f0e3;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.3s, transform 0.3s var(--ease);
}

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

.part-tip {
  position: absolute;
  z-index: 18;
  padding: 4px 7px;
  background: rgba(20, 38, 46, 0.94);
  color: #f6f1e5;
  font-family: var(--mono);
  font-size: 7px;
  line-height: 1.4;
  letter-spacing: 0.06em;
  pointer-events: none;
  opacity: 0;
  transform: translate(10px, 12px);
  transition: opacity 0.12s;
  white-space: nowrap;
}

.part-tip.is-visible {
  opacity: 1;
}

/* ------------------------------------------------------------ loading */

.loading {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 42%, #fbf8f1, #f0ece2 70%);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}

.loading.is-done {
  opacity: 0;
  visibility: hidden;
}

.loading-inner {
  width: min(320px, 72%);
  text-align: center;
}

.loading-mark {
  margin-bottom: 18px;
  font-family: var(--serif);
  font-size: 46px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.loading-mark span {
  color: var(--brass);
}

.loading .eyebrow {
  color: var(--brass);
}

.loading-title {
  margin-top: 7px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--ink);
}

.loading-bar {
  position: relative;
  height: 1px;
  margin: 22px 0 10px;
  overflow: hidden;
  background: #d5cdbd;
}

.loading-bar i {
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 1px;
  background: var(--brass);
  animation: loading-scan 1.35s ease-in-out infinite;
}

.loading-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  color: #899391;
}

.webgl-error {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: var(--paper);
  text-align: center;
}

.webgl-error b {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: 0.08em;
}

.webgl-error p {
  max-width: 400px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}

/* ------------------------------------------------------------ dossier */

.dossier {
  position: relative;
  z-index: 14;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent 20%),
    #f7f4ed;
  border-left: 1px solid var(--line-strong);
  color: var(--ink);
}

.dossier::before {
  content: "";
  position: absolute;
  top: 0;
  left: -1px;
  width: 1px;
  height: 92px;
  background: var(--brass);
  opacity: 0.75;
}

.dossier-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex: 0 0 auto;
  padding: 21px 24px 15px;
  border-bottom: 1px solid var(--line);
}

.dossier-head .eyebrow {
  color: #7d8988;
}

.dossier-no {
  margin-top: -3px;
  font-family: var(--mono);
  font-size: 25px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--brass);
}

.dossier-close {
  display: none;
  position: absolute;
  top: 11px;
  right: 14px;
  z-index: 5;
  width: 28px;
  height: 28px;
  font-family: var(--mono);
  font-size: 19px;
  line-height: 1;
  color: var(--muted);
}

.dossier-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 24px 26px;
}

.dossier-section {
  margin-top: 23px;
}

.section-head {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.section-head > span {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.04em;
  color: var(--brass);
}

.section-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.section-head i {
  font-family: var(--mono);
  font-style: normal;
  font-size: 6px;
  letter-spacing: 0.12em;
  color: #9aa4a2;
}

.section-head small {
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.04em;
  color: #9aa4a2;
}

#principle {
  margin: 12px 0 0;
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.92;
  letter-spacing: 0.025em;
  color: #405258;
  text-align: justify;
}

#principle::first-letter {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1;
  color: var(--brass);
  padding-right: 2px;
}

.formula-card {
  position: relative;
  margin: 21px -4px 0;
  padding: 15px 16px 14px 18px;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(93, 125, 132, 0.24), transparent 48%),
    #152a32;
  color: #eee8da;
}

.formula-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--brass);
}

.formula-card::after {
  content: "ƒ";
  position: absolute;
  right: 12px;
  bottom: -19px;
  font-family: var(--serif);
  font-size: 76px;
  font-style: italic;
  line-height: 1;
  color: rgba(199, 155, 98, 0.09);
  pointer-events: none;
}

.formula-label {
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.15em;
  color: #aebbb7;
}

.formula-label i {
  font-style: normal;
  color: var(--brass-light);
}

.formula {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.95;
  letter-spacing: 0.01em;
  color: #f3eee2;
  white-space: pre-wrap;
}

.formula em {
  font-style: normal;
  color: #d7b27b;
}

.formula b {
  font-weight: 500;
  color: #fffdf7;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin-top: 11px;
}

.stat {
  min-width: 0;
  padding-top: 6px;
  border-top: 1px solid #bdb5a5;
}

.stat-label {
  display: block;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.08em;
  color: #8b9694;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-value {
  display: block;
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat-unit {
  margin-left: 1px;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0;
  color: #7f8b89;
}

.param-table {
  width: 100%;
  margin-top: 4px;
  border-collapse: collapse;
}

.param-table tr {
  border-bottom: 1px dotted #d3cbbc;
}

.param-table td {
  padding: 6.5px 0 6px;
  font-size: 9.5px;
  line-height: 1.45;
  letter-spacing: 0.02em;
}

.param-table td:first-child {
  color: #7a8685;
}

.param-table td:last-child {
  padding-left: 12px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.parts-list {
  margin-top: 2px;
}

.part-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 7px 4px 7px 0;
  border-bottom: 1px dotted #d3cbbc;
  text-align: left;
  transition: background 0.16s, padding-left 0.2s;
}

.part-row:hover,
.part-row.is-active {
  background: rgba(169, 119, 60, 0.065);
  padding-left: 4px;
}

.part-dot {
  width: 7px;
  height: 7px;
  border: 1px solid rgba(20, 38, 46, 0.22);
  border-radius: 50%;
  background: var(--part-color, #b8b8b0);
}

.part-name {
  overflow: hidden;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #33464c;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.part-num {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.03em;
  color: #9aa4a2;
}

.parts-hint {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.08em;
  color: #a0a9a6;
  text-align: right;
}

.notes {
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: note;
}

.notes li {
  position: relative;
  padding: 3px 0 7px 19px;
  font-size: 10.5px;
  line-height: 1.75;
  letter-spacing: 0.02em;
  color: #4b5b60;
  counter-increment: note;
}

.notes li::before {
  content: counter(note, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 5px;
  font-family: var(--mono);
  font-size: 6.5px;
  color: var(--brass);
}

.notes b {
  font-weight: 600;
  color: #263c45;
}

.standard {
  margin: 23px 0 0;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 6.5px;
  line-height: 1.8;
  letter-spacing: 0.04em;
  color: #979f9c;
}

.dossier-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 18px;
  padding-top: 9px;
  border-top: 1px dotted #d3cbbc;
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.1em;
  color: #a4aca9;
}

/* ------------------------------------------------------------ animation */

@keyframes head-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dock-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes status-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(169, 119, 60, 0.1);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(169, 119, 60, 0.04);
  }
}

@keyframes loading-scan {
  0% {
    left: -40%;
  }
  55% {
    left: 100%;
  }
  100% {
    left: 100%;
  }
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.7;
  }
}

.stage.is-switching .stage-head {
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.2s, transform 0.2s;
}

.stage.is-switching #scene {
  opacity: 0.35;
  transition: opacity 0.2s;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1460px) {
  :root {
    --catalog-w: 272px;
    --dossier-w: 342px;
  }

  .formula {
    font-size: 10.6px;
  }

  .dock {
    gap: 9px;
    padding-left: 13px;
    padding-right: 13px;
  }

  .tool-btn {
    min-width: 33px;
    padding-left: 4px;
    padding-right: 4px;
  }

  .meta-cell {
    min-width: 76px;
    padding: 0 15px;
  }
}

@media (max-width: 1240px) {
  :root {
    --catalog-w: 252px;
    --dossier-w: 318px;
  }

  .catalog {
    padding-left: 12px;
    padding-right: 12px;
  }

  .stage-head {
    left: 27px;
  }

  .stage-head h2 {
    font-size: 32px;
  }

  .dossier-head,
  .dossier-scroll {
    padding-left: 19px;
    padding-right: 19px;
  }

  .formula {
    font-size: 10px;
  }

  .dock {
    width: calc(100% - 28px);
    gap: 7px;
    padding: 10px 11px;
  }

  .explode-control {
    flex-basis: 180px;
  }

  .tool-btn span {
    display: none;
  }

  .tool-btn {
    min-width: 32px;
    height: 34px;
  }

  .tool-btn svg {
    width: 16px;
    height: 16px;
  }

  .speed-control {
    display: none;
  }
}

@media (max-width: 1080px) {
  :root {
    --catalog-w: 244px;
  }

  .app {
    grid-template-columns: var(--catalog-w) minmax(0, 1fr);
  }

  .dossier {
    position: fixed;
    top: var(--mast-h);
    right: 0;
    bottom: 0;
    z-index: 60;
    width: min(370px, 88vw);
    border-left: 1px solid var(--line-strong);
    box-shadow: -18px 0 60px rgba(20, 38, 46, 0.18);
    transform: translateX(102%);
    transition: transform 0.42s var(--ease);
  }

  .dossier.is-open {
    transform: translateX(0);
  }

  .dossier-close {
    display: block;
    top: 9px;
    right: 12px;
    width: 30px;
    height: 30px;
    font-size: 21px;
  }

  .dossier-head {
    padding-right: 48px;
  }

  .dossier-no {
    font-size: 21px;
  }

  #dossierBtn {
    display: flex;
  }

  .stage-head {
    width: min(560px, 62%);
  }

  .stage-status {
    right: 20px;
  }

  .selected-part {
    right: 20px;
  }

  .axis-wrap {
    right: 14px;
  }
}

@media (max-width: 860px) {
  :root {
    --mast-h: 64px;
  }

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

  .masthead {
    padding: 0 16px;
    gap: 12px;
  }

  .monogram {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    font-size: 14px;
  }

  .brand-copy h1 {
    font-size: 17px;
    letter-spacing: 0.09em;
  }

  .brand-copy p {
    font-size: 6px;
    letter-spacing: 0.14em;
  }

  .masthead-meta {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .catalog {
    position: fixed;
    top: var(--mast-h);
    left: 0;
    bottom: 0;
    z-index: 55;
    width: min(300px, 84vw);
    transform: translateX(-102%);
    transition: transform 0.42s var(--ease);
    box-shadow: 18px 0 50px rgba(7, 17, 21, 0.28);
  }

  .catalog.is-open {
    transform: translateX(0);
  }

  .stage-head {
    top: 20px;
    left: 19px;
    width: 73%;
  }

  .stage-head h2 {
    margin-top: 9px;
    font-size: clamp(24px, 6vw, 32px);
  }

  .model-en {
    font-size: 6.5px;
    letter-spacing: 0.17em;
  }

  .model-tag {
    margin-top: 7px;
    font-size: 8px;
  }

  .stage-status {
    top: 20px;
    right: 16px;
    padding: 0 7px;
    font-size: 6px;
  }

  .stage-status b {
    margin-left: 3px;
    font-size: 7px;
  }

  .selected-part {
    display: none;
  }

  .stage-index {
    display: none;
  }

  .axis-wrap {
    right: 8px;
    bottom: 91px;
  }

  .axis-wrap canvas {
    width: 58px;
    height: 58px;
  }

  .dock {
    bottom: 10px;
    width: calc(100% - 18px);
    min-height: 60px;
    padding: 8px 9px;
    gap: 6px;
  }

  .dock-divider {
    height: 28px;
  }

  .explode-control {
    flex-basis: 120px;
    min-width: 90px;
  }

  .dock-label {
    font-size: 6px;
    margin-bottom: 4px;
  }

  .dock-label b {
    font-size: 7px;
  }

  .range-ticks {
    display: none;
  }

  .round-btn {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
  }

  .tool-btn {
    min-width: 27px;
    height: 30px;
    padding: 2px;
  }

  .tool-btn svg {
    width: 14px;
    height: 14px;
  }

  .tool-btn span {
    display: none;
  }

  #resetView {
    display: none;
  }

  .label-layer {
    display: none;
  }

  .leader-layer {
    display: none;
  }

  .toast {
    bottom: 83px;
  }

  .dossier {
    top: var(--mast-h);
    width: min(390px, 94vw);
  }

  .section-head small {
    display: none;
  }

  .dossier-head {
    padding-top: 16px;
    padding-right: 48px;
  }
}

@media (max-width: 520px) {
  .stage-head {
    width: 80%;
  }

  .stage-status {
    top: 17px;
    right: 12px;
  }

  .stage-status span:nth-child(2) {
    display: none;
  }

  .selected-part {
    top: 49px;
    right: 12px;
  }

  .dock {
    gap: 3px;
  }

  .explode-control {
    flex: 1 1 auto;
    min-width: 74px;
  }

  .dock-divider,
  #xray,
  #exportPng {
    display: none;
  }

  .tool-btn {
    min-width: 25px;
  }

  #labelsBtn {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
