:root {
  color-scheme: light;
  --paper: #edf0eb;
  --ink: #172f2c;
  --muted: #526760;
  --teal: #17665c;
  --line: rgba(29, 63, 54, .15);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}
* { box-sizing: border-box; }
html { margin: 0; background: var(--paper); }
body { margin: 0; color: var(--ink); font: 14px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button, summary, a, input { outline-offset: 5px; }
button:focus-visible, summary:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--teal); }
button:disabled { cursor: wait; opacity: .55; }
[hidden] { display: none !important; }
::selection { background: #bbd5cc; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: -80px; left: 16px; padding: 12px 20px; background: var(--ink); color: #fff; border-radius: 8px; }
.skip-link:focus { top: 16px; }
#scroll-track { position: relative; height: 600vh; height: 600svh; }
#viewer { position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 570px; overflow: hidden; background: var(--paper); isolation: isolate; }
#viewer::before { content: ""; position: absolute; z-index: -1; inset: 0; background: radial-gradient(ellipse at 66% 42%, #f7f8f4 0, transparent 60%); pointer-events: none; }
.site-header { position: absolute; z-index: 4; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 27px 38px; }
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: 10px; font-weight: 650; letter-spacing: .18em; color: #3f5851; white-space: nowrap; }
.brand-mark { width: 8px; height: 8px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--teal); margin-right: 2px; }
.eyebrow-divider { color: #74837b; font-weight: 400; }
h1 { margin: 8px 0 0; font-size: 23px; font-weight: 570; letter-spacing: -.045em; line-height: 1.3; }
h1 .title-dot { margin: 0 3px; color: #59736a; }
h1 span:last-child { font-weight: 420; }
.configuration { display: flex; align-items: center; gap: 15px; padding: 10px 0 10px 22px; border-left: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.configuration strong { font-size: 14px; font-weight: 580; letter-spacing: .06em; }
.configuration-divider { margin: 0 11px; color: #82938a; }
.configuration-grid { display: grid; grid-template-columns: 6px 6px; gap: 3px; transform: rotate(-10deg); }
.configuration-grid i { display: block; width: 6px; height: 6px; border: 1px solid #4d7066; border-radius: 1px; }
.phase-panel { position: absolute; z-index: 3; left: 38px; top: 23%; width: min(23vw, 300px); pointer-events: none; }
.phase-heading { display: flex; align-items: center; gap: 10px; color: var(--teal); font-size: 11px; font-weight: 600; letter-spacing: .12em; }
.phase-rule { width: 22px; height: 1px; background: var(--teal); }
.phase-number { display: block; margin: 24px 0 14px; font-size: clamp(66px, 6.2vw, 100px); font-weight: 300; letter-spacing: -.08em; line-height: .96; color: #47675c; font-variant-numeric: tabular-nums; }
.phase-copy h2 { margin: 0 0 11px; font-size: clamp(22px, 2.2vw, 34px); font-weight: 500; line-height: 1.35; letter-spacing: -.035em; }
.phase-copy p { margin: 0; max-width: 20em; font-size: 13px; line-height: 1.85; color: var(--muted); text-wrap: pretty; }
.part-counts { display: flex; gap: 34px; margin: 33px 0 0; padding: 23px 0 0; border-top: 1px solid var(--line); }
.part-counts dt { color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.part-counts dd { margin: 3px 0 0; font-size: 23px; font-weight: 400; line-height: 1.3; font-variant-numeric: tabular-nums; }
.part-counts dd span { margin-left: 6px; color: var(--muted); font-size: 11px; }
.assembly-caption { margin-top: 13px; color: var(--muted); font-size: 11px; }
#viewport { position: absolute; z-index: 1; top: 96px; left: 27vw; right: 0; bottom: 178px; min-height: 180px; outline: 1px solid transparent; outline-offset: -8px; border-radius: 28px; transition: outline-color .25s; }
#viewport canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
body.inspect-mode #viewport { outline-color: rgba(23,102,92,.16); }
body.inspect-mode #viewport canvas { touch-action: none; cursor: grab; }
body.inspect-mode #viewport canvas:active { cursor: grabbing; }
.viewport-mode { position: absolute; z-index: 3; top: 17px; right: 26px; display: flex; align-items: center; gap: 6px; opacity: 0; color: #326052; font-size: 10px; letter-spacing: .05em; pointer-events: none; transition: opacity .2s; }
.viewport-mode span { width: 5px; height: 5px; border-radius: 50%; background: #42806b; }
body.inspect-mode .viewport-mode { opacity: 1; }
.loading-state { position: absolute; z-index: 5; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 19px; background: rgba(237,240,235,.95); color: #385a4f; font-size: 12px; }
.loader-orbit { width: 32px; height: 32px; border: 1px solid rgba(23,102,92,.2); border-top-color: var(--teal); border-radius: 50%; animation: orbit 1s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
.error-state { position: absolute; z-index: 6; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; background: #edf0eb; text-align: center; }
.error-state > svg { width: 32px; height: 32px; margin-bottom: 12px; color: #7e6337; }
.error-state strong { font-weight: 550; font-size: 17px; }
.error-state p { max-width: 360px; color: var(--muted); font-size: 12px; }
.retry-button { min-height: 44px; margin-top: 8px; padding: 9px 24px; border: 1px solid var(--line); border-radius: 8px; background: #f9faf7; color: var(--ink); }
.view-label { position: absolute; z-index: 2; top: 50%; right: 21px; display: flex; align-items: center; gap: 14px; writing-mode: vertical-rl; color: #698074; font-size: 8px; letter-spacing: .22em; pointer-events: none; }
.view-cross { font-size: 18px; font-weight: 300; }
.viewer-footer { position: absolute; z-index: 8; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); width: min(930px, calc(100% - 76px)); transform: translateX(-50%); }
.interaction-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 5px 11px; }
.mode-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 550; color: #335f52; }
.mode-dot { display: block; width: 5px; height: 5px; background: #3f7f66; border-radius: 50%; }
body.is-playing .mode-dot { box-shadow: 0 0 0 4px rgba(63,127,102,.12); }
#interaction-hint { color: var(--muted); font-size: 11px; }
.control-bar { padding: 12px 16px 11px; border: 1px solid rgba(63,90,76,.16); border-radius: 15px; background: rgba(250,251,248,.91); box-shadow: 0 12px 32px -24px rgba(30,54,45,.45), inset 0 1px 0 rgba(255,255,255,.8); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.timeline-row { display: flex; align-items: center; gap: 17px; min-height: 27px; padding: 0 4px 5px; }
.timeline-row label { font-size: 10px; color: var(--muted); white-space: nowrap; }
#progress { flex: 1; width: 100%; min-width: 20px; height: 22px; margin: 0; appearance: none; -webkit-appearance: none; cursor: pointer; background: transparent; accent-color: var(--teal); touch-action: pan-y; }
#progress::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(to right, var(--teal) var(--progress, 0%), #d6dfd7 var(--progress, 0%)); border-radius: 3px; }
#progress::-moz-range-track { height: 3px; background: #d6dfd7; border-radius: 3px; }
#progress::-moz-range-progress { height: 3px; background: var(--teal); border-radius: 3px; }
#progress::-webkit-slider-thumb { width: 13px; height: 13px; margin-top: -5px; appearance: none; -webkit-appearance: none; background: var(--teal); border: 3px solid #fafbf8; border-radius: 50%; box-shadow: 0 0 0 1px var(--teal); }
#progress::-moz-range-thumb { width: 9px; height: 9px; background: var(--teal); border: 3px solid #fafbf8; border-radius: 50%; box-shadow: 0 0 0 1px var(--teal); }
#percent { min-width: 36px; text-align: right; font-size: 11px; font-weight: 550; font-variant-numeric: tabular-nums; }
.button-row { display: flex; align-items: center; gap: 7px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; padding: 9px 16px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #304d42; font-size: 12px; font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.button svg { flex: 0 0 17px; width: 17px; height: 17px; }
.button:hover { background: #e4ebe3; }
.button:active { background: #d9e5dc; }
.button-primary { min-width: 124px; background: #1d5145; color: #fff; }
.button-primary:hover { background: #173e35; }
.play-icon { width: 11px; font-size: 10px; line-height: 1; }
.button-inspect[aria-pressed="true"] { background: #dce9df; color: #174e3c; border-color: #aecabc; }
.button-separator { width: 1px; height: 19px; background: var(--line); margin: 0 5px; }
.button-reset { margin-left: auto; color: var(--muted); }
.footer-note { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 9px 5px 0; color: #61776c; font-size: 10px; }
.instructions { position: relative; }
.instructions summary { list-style: none; cursor: pointer; padding: 0 0 0 12px; color: #506e60; }
.instructions summary::-webkit-details-marker { display: none; }
.instructions summary::after { content: " +"; margin-left: 4px; }
.instructions[open] summary::after { content: " −"; }
.instructions-content { position: absolute; right: 0; bottom: 28px; width: min(310px, calc(100vw - 40px)); padding: 21px 22px; border: 1px solid #d0dcd1; border-radius: 12px; background: #f9fbf7; box-shadow: 0 8px 30px rgba(30,54,45,.1); color: #425e50; font-size: 12px; line-height: 1.8; }
.instructions-content strong { color: var(--ink); font-size: 14px; font-weight: 550; }
.instructions-content p { margin: 10px 0 0; }
.noscript-message { position: absolute; z-index: 50; top: 45%; left: 50%; width: min(450px, 90%); transform: translate(-50%,-50%); padding: 24px; background: #fff; border: 1px solid #b3c3b5; border-radius: 12px; }
@media (min-width: 1500px) {
  .site-header { padding: 34px 52px; }
  .phase-panel { left: 52px; }
  #viewport { top: 108px; bottom: 190px; }
  .viewer-footer { bottom: max(28px, env(safe-area-inset-bottom)); }
}
@media (max-width: 1000px) {
  .site-header { padding: 23px 28px; }
  .phase-panel { left: 28px; width: 23vw; top: 23%; }
  .phase-number { font-size: 68px; }
  .phase-copy h2 { font-size: 26px; }
  .part-counts { gap: 24px; margin-top: 25px; padding-top: 18px; }
  .button { padding-inline: 13px; }
  .viewer-footer { width: calc(100% - 48px); }
}
@media (max-width: 700px) {
  #viewer { min-height: 550px; }
  .site-header { padding: 20px 21px 12px; gap: 10px; align-items: flex-start; }
  .eyebrow { font-size: 8px; letter-spacing: .13em; gap: 7px; }
  .brand-mark { width: 6px; height: 6px; }
  h1 { font-size: 19px; margin-top: 8px; }
  h1 .title-dot { margin-inline: 1px; }
  .configuration { margin-top: 2px; padding: 2px 0 2px 11px; gap: 8px; font-size: 10px; }
  .configuration strong { font-size: 11px; letter-spacing: 0; }
  .configuration-divider { margin-inline: 6px; }
  .configuration-grid { display: none; }
  .phase-panel { top: 95px; left: 21px; right: 21px; width: auto; }
  .phase-heading { font-size: 9px; gap: 7px; letter-spacing: .07em; }
  .phase-rule { width: 16px; }
  .phase-layout { display: flex; align-items: center; gap: 17px; margin-top: 7px; }
  .phase-number { flex: 0 0 47px; margin: 0; font-size: 48px; }
  .phase-copy h2 { margin: 0 0 3px; font-size: 21px; line-height: 1.25; }
  .phase-copy p { max-width: 38em; font-size: 10px; line-height: 1.5; }
  .part-counts { position: absolute; top: -3px; right: 0; margin: 0; padding: 0; border: 0; gap: 11px; }
  .part-counts div { display: flex; align-items: baseline; gap: 4px; }
  .part-counts dt { font-size: 8px; }
  .part-counts dd { font-size: 10px; margin: 0; }
  .part-counts dd span { font-size: 8px; margin-left: 2px; }
  .assembly-caption { display: none; }
  #viewport { top: 170px; left: 0; right: 0; bottom: calc(182px + env(safe-area-inset-bottom)); min-height: 145px; border-radius: 20px; }
  .viewport-mode { top: 12px; right: 18px; font-size: 9px; }
  .view-label { display: none; }
  .viewer-footer { bottom: max(9px, env(safe-area-inset-bottom)); width: calc(100% - 24px); }
  .interaction-row { gap: 8px; margin: 0 4px 8px; }
  .mode-pill { font-size: 9px; gap: 5px; }
  #interaction-hint { font-size: 9px; text-align: right; }
  .control-bar { padding: 6px 8px 7px; border-radius: 13px; }
  .timeline-row { gap: 11px; padding: 0 4px 2px; min-height: 27px; }
  .timeline-row label { font-size: 9px; }
  #percent { font-size: 10px; min-width: 32px; }
  .button-row { display: grid; grid-template-columns: 1.03fr 1fr 1fr; gap: 2px 4px; }
  .button { min-height: 44px; padding: 7px 5px; gap: 5px; font-size: 10px; }
  .button-primary { min-width: 0; grid-column: 1; grid-row: 1; }
  .button-inspect { grid-column: 2; grid-row: 1; }
  .button-reset { grid-column: 3; grid-row: 1; margin-left: 0; }
  #exploded { grid-column: 1; grid-row: 2; }
  #assembled { grid-column: 2 / span 2; grid-row: 2; }
  .button svg { width: 15px; height: 15px; flex-basis: 15px; }
  .button-separator { display: none; }
  .footer-note { padding: 6px 4px 0; font-size: 8px; gap: 5px; }
  .instructions summary { padding-left: 5px; }
}
@media (max-width: 370px) {
  .site-header { padding-inline: 16px; }
  h1 { font-size: 17px; }
  .configuration { font-size: 9px; padding-left: 7px; }
  .configuration strong { font-size: 10px; }
  .configuration-divider { margin-inline: 4px; }
  .phase-panel { left: 16px; right: 16px; }
  .phase-copy h2 { font-size: 19px; }
  .phase-copy p { font-size: 9px; }
  .part-counts { gap: 7px; }
}
@media (max-height: 680px) and (min-width: 701px) {
  .site-header { padding-top: 18px; padding-bottom: 18px; }
  .phase-panel { top: 23%; }
  .phase-number { margin-top: 14px; margin-bottom: 12px; font-size: 58px; }
  .phase-copy h2 { font-size: 24px; }
  .part-counts { margin-top: 17px; padding-top: 12px; }
  .assembly-caption { margin-top: 8px; }
}
@media (max-height: 580px) and (orientation: landscape) {
  #viewer { min-height: 350px; }
  .site-header { padding: 12px 20px; }
  h1 { font-size: 17px; margin-top: 4px; }
  .eyebrow { font-size: 8px; }
  .phase-panel { top: 94px; left: 20px; width: 24%; }
  .phase-number { margin: 10px 0; font-size: 43px; }
  .phase-copy h2 { font-size: 20px; }
  .phase-copy p { font-size: 10px; line-height: 1.6; }
  .part-counts, .assembly-caption { display: none; }
  #viewport { top: 66px; left: 27vw; bottom: 115px; min-height: 130px; }
  .viewer-footer { bottom: 6px; width: calc(100% - 36px); }
  .interaction-row, .footer-note { display: none; }
  .control-bar { padding: 6px 10px; }
  .button { min-height: 44px; font-size: 10px; padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .loader-orbit { animation-duration: 2s; }
}
