:root {
  --ink: #111214;
  --ink-soft: #25282b;
  --paper: #f4efe6;
  --paper-deep: #e6dcc8;
  --red: #8a1f1c;
  --red-deep: #63120f;
  --gold: #b98a3d;
  --gold-soft: #d6b77c;
  --silver: #c9cbcb;
  --muted: #8e8d88;
  --line: rgba(255, 255, 255, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font: inherit;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: #0d0e0f;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  text-align: center;
  max-width: 360px;
}

.loader-mark {
  width: 46px;
  height: 46px;
  margin: 0 auto 22px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--gold-soft);
  border-radius: 50%;
  animation: spin 1.1s linear infinite;
}

.loader h1 {
  margin: 0 0 8px;
  font-family: "Songti SC", "STSong", serif;
  font-weight: 600;
  letter-spacing: 0.18em;
  font-size: 28px;
}

.loader p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.loader-bar {
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.loader-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  transition: width 0.2s ease;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 56px);
  pointer-events: none;
}

.site-header > * {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.5);
}

.brand-seal {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 4px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.main-nav {
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.28);
  backdrop-filter: blur(14px);
}

.main-nav a {
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.main-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.main-nav .back-home {
  color: var(--gold);
  border: 1px solid rgba(214, 183, 124, 0.45);
  background: rgba(214, 183, 124, 0.08);
}

.main-nav .back-home:hover {
  color: #111;
  background: var(--gold);
}

.viewer-section {
  position: relative;
  height: 100svh;
  min-height: 680px;
  overflow: hidden;
  background: #101112;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-copy {
  position: absolute;
  left: clamp(22px, 5vw, 72px);
  top: clamp(118px, 20vh, 188px);
  max-width: 520px;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.38);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--gold-soft);
  text-transform: uppercase;
}

.hero-copy h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(42px, 7vw, 84px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.06em;
}

.hero-sub {
  max-width: 440px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.8;
}

.finish-panel {
  position: absolute;
  right: clamp(18px, 4vw, 56px);
  bottom: clamp(96px, 15vh, 140px);
  width: min(360px, calc(100vw - 36px));
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(13, 14, 15, 0.54);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.panel-toggle {
  display: none;
}

.panel-label {
  margin: 12px 0 8px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 11px;
  letter-spacing: 0.18em;
}

.panel-label:first-child {
  margin-top: 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.segmented button {
  min-width: 0;
  padding: 9px 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.segmented button:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.segmented button.active {
  border-color: rgba(214, 183, 124, 0.75);
  background: rgba(214, 183, 124, 0.13);
  color: #fff;
}

.hint-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  cursor: pointer;
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle .track {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.2s ease;
}

.toggle .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.toggle input:checked + .track {
  background: rgba(214, 183, 124, 0.75);
}

.toggle input:checked + .track::after {
  transform: translateX(16px);
}

.spec-strip {
  position: absolute;
  left: clamp(22px, 5vw, 72px);
  bottom: clamp(28px, 6vh, 52px);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 60%;
}

.spec-strip div {
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(13, 14, 15, 0.38);
  backdrop-filter: blur(10px);
}

.spec-strip span {
  display: block;
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 10px;
}

.spec-strip b {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.section-head {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: end;
  max-width: 1180px;
  margin: 0 auto 52px;
}

.section-head h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.04em;
}

.section-head > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

.exploded-section,
.gallery-section {
  padding: clamp(64px, 9vw, 120px) clamp(20px, 6vw, 88px);
  background: #111214;
}

.gallery-section {
  background:
    radial-gradient(circle at 82% 12%, rgba(178, 107, 35, 0.12), transparent 34%),
    #0e0f10;
}

.exploded-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  align-items: center;
}

.diagram {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(0, 0, 0, 0.1)),
    #161718;
  box-shadow: var(--shadow);
}

.diagram svg {
  display: block;
  width: 100%;
  height: auto;
}

.diagram-layer {
  transition: transform 0.55s ease, opacity 0.3s ease;
  transform-box: fill-box;
  transform-origin: center;
}

.diagram[data-mode="explode"] .layer-shell {
  transform: translateY(-30px);
}

.diagram[data-mode="explode"] .layer-plates {
  transform: translateY(-16px) translateX(8px);
}

.diagram[data-mode="explode"] .layer-base {
  transform: translateY(18px);
}

.diagram[data-mode="skeleton"] .layer-shell,
.diagram[data-mode="skeleton"] .layer-plates,
.diagram[data-mode="skeleton"] .layer-base {
  opacity: 0.16;
}

.explode-controls {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.segmented-stack {
  grid-template-columns: 1fr;
}

.segmented-stack button {
  padding: 11px 12px;
}

.explode-legend {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
}

.explode-legend div {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 4px 10px;
  align-items: start;
}

.explode-legend .swatch {
  grid-row: span 2;
  width: 12px;
  height: 12px;
  margin-top: 3px;
  border-radius: 3px;
}

.swatch.shell {
  background: linear-gradient(135deg, #e9ece9, #8e9491);
}

.swatch.skeleton {
  background: linear-gradient(135deg, #ffd98f, #b26b23);
}

.swatch.plates {
  background: linear-gradient(135deg, #c85c52, #68a1bd, #d6b77c);
}

.swatch.base {
  background: #45423e;
}

.explode-legend dt {
  font-size: 13px;
  font-weight: 600;
}

.explode-legend dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  line-height: 1.6;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
}

.gallery-grid figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #171819;
}

.gallery-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-grid figure:hover img {
  transform: scale(1.02);
}

.gallery-grid figcaption {
  padding: 14px 16px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.manual-section {
  padding: clamp(64px, 10vw, 130px) clamp(20px, 6vw, 88px);
  background:
    linear-gradient(180deg, #151517 0%, #101112 100%);
}

.manual-head {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: end;
  max-width: 1180px;
  margin: 0 auto 64px;
}

.manual-head h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.04em;
}

.manual-head > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

.timeline {
  list-style: none;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0;
  display: grid;
  gap: 12px;
}

.step {
  display: grid;
  grid-template-columns: 74px 1fr 210px;
  gap: 22px;
  align-items: start;
  padding: 26px 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.step:hover {
  border-color: rgba(214, 183, 124, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

.step-index {
  color: var(--gold-soft);
  font-family: Georgia, serif;
  font-size: 20px;
}

.step-body h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.step-body p {
  margin: 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 14px;
  line-height: 1.9;
}

.step aside {
  justify-self: end;
  align-self: start;
  padding: 7px 12px;
  border-left: 2px solid rgba(214, 183, 124, 0.5);
  color: rgba(255, 255, 255, 0.54);
  font-size: 12px;
}

.spec-grid {
  max-width: 1180px;
  margin: 56px auto 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.spec-grid article {
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.spec-grid span {
  display: block;
  margin-bottom: 12px;
  color: var(--gold-soft);
  font-size: 11px;
  letter-spacing: 0.2em;
}

.spec-grid h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.spec-grid p {
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  line-height: 1.7;
}

.site-footer {
  padding: 34px clamp(20px, 6vw, 88px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.42);
  font-size: 12px;
  line-height: 1.8;
}

@media (max-width: 900px) {
  .finish-panel {
    left: 0;
    right: 0;
    width: auto;
    bottom: 0;
    transform: translateY(calc(100% - 52px));
    transition: transform 0.3s ease;
    padding: 52px 14px 14px;
    border-radius: 12px 12px 0 0;
  }

  .finish-panel.open {
    transform: translateY(0);
    max-height: 70vh;
    overflow: auto;
  }

  .panel-toggle {
    display: block;
    position: absolute;
    top: 10px;
    right: 10px;
    width: auto;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.86);
    font-size: 12px;
    letter-spacing: 0.08em;
    cursor: pointer;
  }

  .panel-toggle::after {
    content: "+";
    color: rgba(214, 183, 124, 0.9);
    font-size: 18px;
    line-height: 1;
  }

  .finish-panel.open .panel-toggle::after {
    content: "×";
  }

  .spec-strip {
    bottom: 74px;
    max-width: 60%;
  }

  .manual-head {
    grid-template-columns: 1fr;
  }

  .section-head {
    grid-template-columns: 1fr;
  }

  .exploded-layout {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .step {
    grid-template-columns: 52px 1fr;
  }

  .step aside {
    grid-column: 2;
    justify-self: start;
  }

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

@media (max-width: 640px) {
  .main-nav {
    display: flex;
    position: fixed;
    top: 12px;
    left: auto;
    right: 12px;
    z-index: 60;
    max-width: calc(100vw - 24px);
    overflow-x: auto;
    background: rgba(10, 10, 10, 0.72);
  }

  .main-nav a:not(.back-home) {
    display: none;
  }

  .main-nav .back-home {
    display: inline-flex;
    white-space: nowrap;
  }

  .hero-copy {
    top: 96px;
    left: 18px;
    max-width: calc(100vw - 36px);
  }

  .hero-sub {
    font-size: 13px;
  }

  .finish-panel {
    left: 0;
    right: 0;
    width: auto;
    bottom: 0;
    transform: translateY(calc(100% - 52px));
    transition: transform 0.3s ease;
    padding: 52px 14px 14px;
    border-radius: 12px 12px 0 0;
  }

  .finish-panel.open {
    transform: translateY(0);
    max-height: 70vh;
    overflow: auto;
  }

  .panel-toggle {
    display: block;
    position: absolute;
    top: 10px;
    right: 10px;
    width: auto;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.86);
    font-size: 12px;
    letter-spacing: 0.08em;
    cursor: pointer;
  }

  .panel-toggle::after {
    content: "+";
    color: rgba(214, 183, 124, 0.9);
    font-size: 18px;
    line-height: 1;
  }

  .finish-panel.open .panel-toggle::after {
    content: "×";
  }

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

  .spec-strip {
    display: none;
  }

  .timeline {
    gap: 10px;
  }

  .step {
    grid-template-columns: 1fr;
    padding: 20px 16px;
  }

  .step aside {
    grid-column: 1;
  }

  .spec-grid {
    grid-template-columns: 1fr;
  }
}
