:root { color-scheme: light; font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif; color: #17263b; background: #edf1f6; font-synthesis: none; --blue: #215cc5; --border: #dce3ed; --muted: #62728a; --red: #bd2936; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
select { font: inherit; width: 100%; min-height: 38px; border: 1px solid #ccd7e6; border-radius: 6px; padding: 7px 10px; background: #fff; color: #20324b; }
select:disabled { background: #f5f7fa; color: #8e98a8; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .43; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, pre:focus-visible { outline: 3px solid #8cb4fc; outline-offset: 3px; }
.topbar { min-height: 78px; padding: 16px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--border); background: #fff; }
.brand { display: flex; gap: 12px; align-items: center; color: #17263b; font-weight: 800; text-decoration: none; letter-spacing: .6px; }
.brand-mark { width: 36px; height: 36px; background: #172b49; color: #fff; display: grid; place-items: center; border-radius: 9px; font-size: 21px; }
.brand-sub { font-size: 11px; letter-spacing: 1.5px; color: var(--muted); font-weight: 600; margin-left: 6px; }
.connection-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.badge, .state-badge, .tag, .count { display: inline-flex; align-items: center; border-radius: 6px; font-size: 12px; padding: 6px 9px; background: #edf1f7; color: #5b6b81; font-weight: 600; }
.badge.connected { color: #267353; background: #e8f4ed; }
.badge.connecting { color: #9b6a14; background: #fff1d7; }
.button { border: 1px solid #d3dce9; background: #fff; color: #2b3e58; border-radius: 7px; min-height: 38px; padding: 8px 12px; font-size: 13px; font-weight: 600; line-height: 1.4; transition: background .15s, border-color .15s; }
.button:hover:not(:disabled) { background: #f1f5fc; border-color: #aec1df; }
.button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.button.primary:hover:not(:disabled) { background: #184fae; }
.button.stop { background: var(--red); color: #fff; border-color: var(--red); display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding-inline: 17px; }
.button.stop:hover:not(:disabled) { background: #a61d2a; }
.stop-square { width: 10px; height: 10px; background: currentColor; border-radius: 1px; }
kbd { font: 10px "Segoe UI", sans-serif; padding: 2px 4px; border-radius: 3px; background: #fff2; border: 1px solid #ffffff55; margin-left: 5px; }
main { max-width: 1480px; margin: 0 auto; padding: 27px 28px 18px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.4; letter-spacing: -.6px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 20px; }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 1.1px; color: var(--muted); margin-bottom: 5px; }
.intro { color: var(--muted); font-size: 13px; margin-top: 6px; }
.bluetooth-pairing { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 14px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.bluetooth-pairing > div { display: flex; align-items: center; gap: 10px; }
.bluetooth-pairing label { margin: 0; white-space: nowrap; }
.bluetooth-pairing input { width: 120px; font-family: Consolas, monospace; letter-spacing: 2px; }
.bluetooth-pairing p { flex: 1 1 240px; line-height: 1.7; }
.state-panel { text-align: right; max-width: 420px; }
.state-panel p { font-size: 12px; color: var(--muted); margin: 6px 0; }
.state-badge { background: #e0e7f1; }
.state-badge.idle { background: #e1f0e7; color: #267253; }
.state-badge.busy { background: #dfebff; color: #215cc5; }
.state-badge.fault { background: #fae4e6; color: #a72935; }
.state-badge.unknown { background: #e0e6ef; color: #5f6f85; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.mono { font-family: "Cascadia Code", Consolas, monospace; }
.notice, .power-note { border: 1px solid #e3d6b8; background: #fff9eb; padding: 12px 15px; border-radius: 8px; color: #795b23; font-size: 12px; line-height: 1.8; margin-bottom: 10px; }
.power-note { display: flex; align-items: flex-start; gap: 10px; }
.note-dot { background: #c69132; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; margin-top: 8px; }
.feedback { font-size: 12px; color: var(--muted); min-height: 24px; margin: 9px 1px 13px; line-height: 1.8; }
.feedback.error { color: #ad2935; }
.feedback.confirmed { color: #247452; }
.workspace { display: grid; grid-template-columns: minmax(280px, .88fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.motor-panel { padding: 17px 18px; margin-bottom: 20px; }
.motor-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.motor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 15px; }
.motor-actions p { margin-left: 3px; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 3px 10px #18375904; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.section-heading p { margin-top: 5px; }
.channels-panel { overflow: hidden; }
.channels-panel > .section-heading { padding: 17px 18px 13px; margin: 0; border-bottom: 1px solid #e7ecf3; }
.channel-row { display: grid; width: 100%; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 10px; text-align: left; padding: 11px 15px; min-height: 49px; border: 0; border-bottom: 1px solid #edf1f6; background: #fff; color: inherit; border-left: 3px solid transparent; }
.channel-row:hover { background: #f7f9fd; }
.channel-row[aria-pressed="true"] { background: #edf4ff; border-left-color: var(--blue); }
.channel-number { font-family: Consolas, monospace; font-size: 13px; font-weight: 700; color: #425c7e; }
.channel-name { font-size: 12px; display: block; line-height: 1.5; }
.channel-range { display: block; font-family: Consolas, monospace; font-size: 10px; color: #76849a; margin-top: 2px; }
.channel-state { padding: 3px 6px; border-radius: 4px; font-size: 10px; color: #7e8b9d; background: #f2f4f8; white-space: nowrap; }
.channel-state.configured { color: #246d51; background: #e7f3ec; }
.panel-footer { padding: 12px 15px; display: flex; gap: 8px; flex-wrap: wrap; }
.small-button { font-size: 11px; min-height: 32px; padding: 6px 10px; }
.controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 15px; }
.selected-header { grid-column: 1 / -1; min-height: 42px; display: flex; gap: 12px; align-items: center; justify-content: space-between; padding-inline: 2px; }
.control-card { padding: 17px; }
.tag { font-size: 10px; padding: 4px 6px; white-space: nowrap; font-weight: 500; }
label { display: block; font-size: 11px; color: #5d6d84; font-weight: 600; margin: 10px 0 5px; }
input { width: 100%; min-width: 0; height: 38px; border: 1px solid #ccd7e6; border-radius: 6px; padding: 7px 10px; background: #fff; color: #20324b; font-size: 14px; }
input:disabled { background: #f5f7fa; color: #8e98a8; }
input[type="number"] { font-family: "Cascadia Code", Consolas, monospace; }
.target-input { display: flex; gap: 7px; }
.target-input input { font-size: 19px; font-weight: 600; text-align: center; }
.step-buttons { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; margin-top: 10px; }
.step-button { min-width: 0; padding: 6px 3px; font-family: Consolas, monospace; font-size: 13px; }
.hint { margin-top: 7px; color: #728097; font-size: 10px; line-height: 1.65; }
.stacked-actions { display: grid; gap: 8px; margin-top: 15px; }
.stacked-actions .button { font-size: 12px; }
.triple-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.triple-fields input { padding-inline: 7px; }
.full-width { width: 100%; margin-top: 16px; }
.paired-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.paired-actions .button { font-size: 11px; padding-inline: 6px; }
.danger-text { color: #af3d49; }
.calibration-note { border-top: 1px solid #e8edf4; margin-top: 15px; padding-top: 12px; }
.calibration-note p { color: #75839a; font-size: 10px; line-height: 1.8; margin-bottom: 5px; overflow-wrap: anywhere; }
.offset-card { grid-column: 1 / -1; padding: 16px 17px; }
.offset-actions { display: flex; gap: 9px; align-items: flex-end; margin-top: 5px; }
.offset-actions > div { width: 190px; }
.offset-actions .button { font-size: 11px; }
.console-panel { margin-top: 20px; padding: 16px 18px; }
.console-panel .section-heading { margin-bottom: 12px; }
.serial-log { min-height: 135px; height: 210px; overflow: auto; margin: 0; padding: 13px 15px; background: #13223a; color: #c7d5e9; border-radius: 7px; font: 11px/1.7 "Cascadia Code", Consolas, "Microsoft YaHei", monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.command-form { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.command-label { margin: 0; flex-shrink: 0; }
.command-form input { font-family: Consolas, monospace; font-size: 12px; }
.command-form .button { flex-shrink: 0; }
.page-footer { color: #8390a3; font-size: 10px; text-align: center; padding-top: 16px; }
@media (max-width: 1120px) { .workspace { grid-template-columns: minmax(240px, .8fr) minmax(0, 1.6fr); gap: 15px; } .controls { grid-template-columns: 1fr; } .selected-header, .offset-card { grid-column: 1; } .channel-row { padding-inline: 10px; gap: 6px; } .paired-actions .button { font-size: 12px; } }
@media (max-width: 740px) { .topbar { padding: 13px 16px; flex-direction: column; align-items: flex-start; gap: 13px; } .connection-actions { width: 100%; } .brand-sub { margin-left: 8px; } main { padding: 22px 15px 16px; } .page-heading { align-items: flex-start; gap: 12px; } h1 { font-size: 24px; } .state-panel { max-width: 175px; } .state-panel p { font-size: 10px; } .workspace { grid-template-columns: 1fr; } .channel-list { display: grid; grid-template-columns: 1fr 1fr; } .channel-row { grid-template-columns: 35px 1fr; min-height: 58px; padding: 8px; gap: 5px; } .channel-state { display: none; } .channel-name { font-size: 10px; } .channel-range { font-size: 9px; } .channel-number { font-size: 11px; } .selected-header { padding: 3px 0; } .selected-header h2 { font-size: 16px; } .offset-actions { flex-wrap: wrap; } .offset-actions > div { width: 100%; } .command-form { flex-wrap: wrap; } .command-form input { flex: 1 1 60%; } .command-label { flex-basis: 100%; } .stop { flex-grow: 1; justify-content: center; } .console-panel { padding-inline: 13px; } }
@media (prefers-reduced-motion: reduce) { .button { transition: none; } }
