:root{color-scheme:light;--ink:#232624;--muted:#626961;--fine:#dcded6;--accent:#c54528;--paper:#fdfcf9;--mono:ui-monospace,"SFMono-Regular",Consolas,"Liberation Mono",monospace;--sans:Inter,"Noto Sans TC","PingFang TC","Microsoft JhengHei",system-ui,sans-serif}
*{box-sizing:border-box}
body{background:var(--paper);color:var(--ink);font-family:var(--sans);margin:0;font-size:16px;-webkit-font-smoothing:antialiased}
button,input{font:inherit}
button{cursor:pointer;touch-action:manipulation;color:inherit}
button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #247f9d;outline-offset:4px}
button:disabled{opacity:.5;cursor:default}
svg{display:block}
.ico{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.svg-defs{position:absolute;overflow:hidden}
.wrap{width:min(1376px,100%);margin:0 auto;padding:0 clamp(20px,4.5vw,72px)}
.topbar{border-bottom:1px solid var(--fine);background:#fffefa}
.topbar .wrap{height:70px;display:flex;align-items:center;justify-content:space-between;gap:14px}
.top-left{display:flex;align-items:center;gap:12px;min-width:0}
.top-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
.fa-back-pill{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 12px;border:1px solid var(--fine);border-radius:999px;background:#f7f7f2;color:var(--ink);text-decoration:none;font-size:13px;font-weight:600;white-space:nowrap;touch-action:manipulation}
.fa-back-pill:hover{background:#efefe8}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.brandmark{width:33px;height:33px;color:var(--accent);flex-shrink:0}
.brand-en{font-family:var(--sans);font-weight:740;letter-spacing:-.055em;font-size:23px;white-space:nowrap}
.brand-zh{color:#545b53;font-size:14px;letter-spacing:.1em;border-left:1px solid #cbcec5;padding-left:14px;margin-left:4px;font-weight:550;white-space:nowrap}
.help-button,.reset,.camera button,.close{background:transparent;border:1px solid var(--fine);border-radius:7px;display:inline-flex;align-items:center;justify-content:center;gap:7px}
.help-button{min-height:36px;padding:0 12px;font-weight:550;font-size:14px;background:#fffefa;white-space:nowrap}
.help-button .ico{width:16px;height:16px}
.help-button:hover,.reset:hover,.camera button:hover,.close:hover{background:#efefe8}
main.wrap{padding-bottom:40px}
.intro{padding:clamp(23px,3vw,45px) 0 clamp(19px,2vw,28px)}
h1,h2,h3,p{margin:0}
.intro h1{font-size:clamp(32px,3.25vw,49px);line-height:1.23;letter-spacing:-.055em;font-weight:740}
.intro p{font-size:15px;line-height:1.65;margin-top:8px;color:var(--muted);letter-spacing:.015em}
.workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(270px,302px);gap:18px;align-items:stretch}
.stage{position:relative;min-width:0;border:1px solid #d8dace;border-radius:14px;background-color:#f4f5ef;background-image:radial-gradient(ellipse at 49% 38%,#f9faf5 0%,#f6f7f1cf 45%,#f0f1eaa1 100%),radial-gradient(#a3aaa04a .8px,transparent 1px);background-size:auto,14px 14px;isolation:isolate;overflow:hidden;min-height:409px;height:clamp(418px,37vw,525px)}
#view{width:100%;height:100%;position:absolute;inset:0;touch-action:none;cursor:grab;display:block}
#view:active{cursor:grabbing}
.overlay-top,.overlay-bottom{position:absolute;left:19px;right:19px;display:flex;align-items:center;justify-content:space-between;gap:12px;pointer-events:none}
.overlay-top{top:17px}
.overlay-bottom{bottom:15px}
.badge{display:inline-flex;align-items:center;gap:8px;border:1px solid #d9ded2;border-radius:999px;padding:6px 11px;background:#fffefadf;font-size:13px;line-height:1.1;color:#385441;font-weight:650}
.dot{width:7px;height:7px;flex-shrink:0;border-radius:50%;background:#49855b}
.badge[data-mode="paused"]{color:#785934}
.badge[data-mode="paused"] .dot{background:#ad7b37}
.badge[data-mode="coast"]{color:#525f66}
.badge[data-mode="coast"] .dot{background:#667c8a}
.timer,.gesture{display:flex;align-items:center;gap:6px;color:#60685f}
.timer{font:13px var(--mono);letter-spacing:.02em}
.timer .ico{width:15px;height:15px}
.gesture{font-size:12px}
.gesture .ico{width:16px;height:16px}
.camera{display:flex;border:1px solid #d3d7cc;border-radius:7px;overflow:hidden;background:#fffefbed;pointer-events:auto}
.camera button{border:0;border-radius:0;width:36px;height:34px}
.camera button+button{border-left:1px solid #e0e1da}
.camera .ico{width:17px;height:17px}
.gesture .touch{display:none}
.controls,.card{border:1px solid var(--fine);border-radius:14px;background:#fffefa}
.controls{padding:23px 22px 19px;display:flex;flex-direction:column;gap:0}
.panel-heading{display:flex;align-items:center;gap:9px}
.panel-heading .ico{width:19px;height:19px}
.controls h2,.read-head h2{font-size:19px;line-height:1.35;letter-spacing:-.035em;font-weight:700}
.control-title{border-bottom:1px solid var(--fine);padding-bottom:17px}
.motor-row{display:flex;align-items:center;justify-content:space-between;padding:19px 0 0;font-weight:650;font-size:15px}
.switch{border:none;position:relative;width:39px;height:23px;border-radius:99px;background:#9ca298;transition:background .15s}
.switch::after{content:"";position:absolute;width:17px;height:17px;top:3px;left:3px;background:#fff;border-radius:50%;box-shadow:0 1px 3px #0002;transition:transform .15s}
.switch[aria-checked="true"]{background:var(--accent)}
.switch[aria-checked="true"]::after{transform:translateX(16px)}
.control-group{margin-top:23px}
.control-label{display:flex;align-items:baseline;justify-content:space-between;gap:7px}
.control-label label{font-weight:640;font-size:15px}
.control-label output{font-family:var(--mono);font-size:18px;font-weight:600;letter-spacing:-.05em}
.control-label small{font-size:12px;font-family:var(--mono);font-weight:500;color:var(--muted);margin-left:3px;letter-spacing:0}
input[type=range]{--fill:0%;-webkit-appearance:none;appearance:none;width:100%;display:block;margin:9px 0 0;height:28px;background:transparent;cursor:pointer;outline-offset:0;touch-action:none}
input[type=range]::-webkit-slider-runnable-track{height:4px;border-radius:20px;background:linear-gradient(to right,var(--accent) 0 var(--fill),#dedfd7 var(--fill) 100%)}
input[type=range]::-moz-range-track{height:4px;border-radius:20px;background:#dedfd7}
input[type=range]::-moz-range-progress{height:4px;border-radius:20px;background:var(--accent)}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;height:16px;width:16px;margin-top:-6px;border-radius:50%;background:#fffefa;border:4px solid var(--accent);box-shadow:0 1px 2px #0002}
input[type=range]::-moz-range-thumb{height:9px;width:9px;border-radius:50%;background:#fffefa;border:4px solid var(--accent)}
.limits{display:flex;justify-content:space-between;font:12px var(--mono);color:#70766e}
.gravity-line{margin:19px 0 15px;padding:10px 11px;background:#f3f4ee;border-radius:6px;display:flex;align-items:center;justify-content:space-between;gap:8px;color:#576056;font-size:13px}
.gravity-line span{display:inline-flex;align-items:center;gap:5px}
.gravity-line .ico{width:15px;height:15px}
.gravity-line b{font:500 12px var(--mono);white-space:nowrap}
.transport{display:flex;gap:8px;border-top:1px solid var(--fine);padding-top:18px;margin-top:auto}
.transport button{min-height:40px;font-size:14px;font-weight:600}
.play{background:var(--ink);color:#fff;border:none;border-radius:7px;flex:1;display:flex;align-items:center;justify-content:center;gap:8px}
.play:hover{background:#373d38}
.play .ico,.reset .ico{width:15px;height:15px}
.reset{padding:0 11px;white-space:nowrap}
.readings{margin-top:25px}
.read-head{display:flex;align-items:center;justify-content:space-between;margin:0 0 13px;gap:8px}
.read-head>p{font-size:13px;color:var(--muted)}
.card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.card{min-width:0;padding:16px 18px 11px;position:relative;overflow:hidden}
.card .card-head{display:flex;align-items:center;gap:8px}
.card .card-head>.ico{color:var(--chart);width:17px;height:17px}
.card h3{font-size:15px;font-weight:630}
.card .readval{display:flex;align-items:baseline;gap:6px;margin-top:6px}
.readval output{font:500 clamp(26px,2.35vw,36px)/1.2 var(--mono);letter-spacing:-.075em;font-variant-numeric:tabular-nums}
.unit{font:13px var(--mono);color:#636a61}
.plot{display:block;width:100%;height:31px;margin-top:4px;overflow:visible}
.plot .guide{stroke:#e5e7df;stroke-width:1;stroke-dasharray:3 4}
.plot .line{fill:none;stroke:var(--chart);stroke-width:1.75;stroke-linejoin:round;stroke-linecap:round}
.plot path{vector-effect:non-scaling-stroke}
.card--g{--chart:#c54528}
.card--speed{--chart:#34766c}
.card--actual{--chart:#626e84}
dialog{margin:auto;width:min(660px,calc(100vw - 30px));max-height:85dvh;border:1px solid #d6dacf;border-radius:15px;padding:0;background:var(--paper);color:var(--ink);box-shadow:0 20px 75px #24292132}
dialog::backdrop{background:#252b2766;backdrop-filter:blur(3px)}
.dialog-head{position:sticky;top:0;background:var(--paper);z-index:1;display:flex;justify-content:space-between;align-items:center;padding:18px 24px;border-bottom:1px solid var(--fine)}
.dialog-head h2{font-size:21px}
.close{width:36px;height:36px}
.dialog-body{padding:19px 24px 24px}
.ref-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 0 16px}
.ref-pair img{width:100%;border:1px solid #e5e6df;border-radius:8px;object-fit:contain;background:#fff}
.dialog-body h3{font-size:16px;margin:16px 0 5px}
.dialog-body p{font-size:14px;line-height:1.72;color:#51584f}
.dialog-body a{color:#3a5648;text-underline-offset:3px}
.dialog-body .refs{margin-top:16px;font-size:13px}
.error{position:absolute;left:6%;top:43%;background:#fff;padding:14px;border-radius:6px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(min-width:1500px){.workspace{grid-template-columns:minmax(0,1fr) 330px}.controls{padding:26px}.control-group{margin-top:29px}}
@media(max-width:900px){.wrap{padding-inline:22px}.workspace{grid-template-columns:minmax(0,1fr) 250px;gap:12px}.controls{padding:17px 15px}.overlay-top,.overlay-bottom{left:13px;right:13px}.gesture{font-size:11px}.camera button{width:34px}.card{padding:13px}.card-grid{gap:10px}}
@media(max-width:680px){
  .wrap{padding-inline:16px}
  .topbar .wrap{height:58px;gap:8px}
  .top-left{gap:8px}
  .fa-back-pill{min-height:36px;padding:0 10px;font-size:12px}
  .brand-en{font-size:19px}
  .brand{gap:7px}
  .brandmark{width:25px;height:25px}
  .brand-zh{display:none}
  .help-button{min-height:38px;padding:0 10px;font-size:13px}
  .intro{padding:20px 0 14px}
  .intro h1{font-size:32px}
  .intro p{font-size:14px;margin-top:4px}
  .workspace{display:flex;flex-direction:column;gap:12px}
  .stage{min-height:0;height:clamp(290px,82vw,415px)}
  .controls{display:grid;grid-template-columns:1fr 1fr;gap:12px 20px;padding:16px}
  .control-title{padding:0;border:0}
  .motor-row{justify-content:flex-end;padding:0;gap:9px;font-size:14px}
  .control-group{margin:0}
  .gravity-line{grid-column:1/-1;margin:0;padding:7px 10px}
  .transport{grid-column:1/-1;margin:0;padding-top:12px}
  .transport button{min-height:44px}
  .control-label label{font-size:14px}
  .control-label output{font-size:16px}
  .overlay-top{top:12px}
  .overlay-bottom{bottom:11px}
  .card-grid{grid-template-columns:1fr;gap:7px}
  .card{display:grid;grid-template-columns:minmax(100px,1fr) minmax(80px,.65fr) minmax(37px,.8fr);padding:12px;align-items:center;gap:8px}
  .card .readval,.plot{margin:0}
  .readval output{font-size:24px}
  .readings{margin-top:19px}
  .read-head{margin-bottom:10px}
  .dialog-body,.dialog-head{padding-left:17px;padding-right:17px}
  .dialog-body{padding-top:14px}
  .gesture .touch{display:inline}
  .gesture .mouse{display:none}
  .camera button{width:40px;height:38px}
}
@media(max-width:420px){
  .wrap{padding-inline:12px}
  .topbar .wrap{gap:6px}
  .brand-en{font-size:16px}
  .brandmark{display:none}
  .fa-back-pill{padding:0 8px;font-size:12px}
  .help-button{padding:0 8px;font-size:12px}
  .fa-about-btn{display:none}
  .intro h1{font-size:28px}
  .controls{padding:12px;gap:12px}
  .gesture{font-size:10px}
  .card{grid-template-columns:1fr 78px 60px}
}
@media(prefers-reduced-motion:reduce){*{transition-duration:0s!important}}
