:root {
  --ink: #1d1d1f;
  --muted: #78787f;
  --line: #e6e5e0;
  --paper: #f7f7f3;
  --white: #ffffff;
  --orange: #ff6b32;
  --orange-soft: #fff0e8;
  --violet: #6457e8;
  --violet-soft: #eeecff;
  --green: #64b79a;
  --green-soft: #e9f6ef;
  --shadow: 0 20px 55px rgba(36, 33, 27, 0.1);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { min-width: 1080px; background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 12%, rgba(255, 221, 197, 0.44), transparent 23rem),
    linear-gradient(135deg, #fbfbf8 0%, #f3f3ee 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button, input { font: inherit; }
button { border: 0; cursor: pointer; color: inherit; }

.app-shell { min-height: 100vh; }

.topbar {
  height: 82px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(29, 29, 31, 0.07);
  background: rgba(251, 251, 248, 0.86);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-lockup { display: flex; align-items: center; gap: 13px; }
.brand-lockup h1 { margin: 2px 0 0; font-size: 22px; letter-spacing: -0.02em; }
.eyebrow { margin: 0; font-size: 10px; line-height: 1.2; letter-spacing: 0.16em; font-weight: 800; color: var(--muted); }

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding: 7px;
  background: var(--ink);
}
.brand-mark span { flex: 1; border-radius: 2px; background: #ff7a44; }
.brand-mark span:nth-child(1) { height: 62%; }
.brand-mark span:nth-child(2) { height: 100%; background: #7a6ef0; }
.brand-mark span:nth-child(3) { height: 80%; background: #85c5a7; }

.topbar-meta { display: flex; align-items: center; gap: 24px; color: var(--muted); font-size: 12px; }
.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  color: #26704e;
  background: var(--green-soft);
  border-radius: 999px;
  font-weight: 700;
}
.connection-pill.received { color: #9b4a20; background: var(--orange-soft); }
.connection-pill.received i { background: var(--orange); box-shadow: 0 0 0 4px rgba(255, 107, 50, 0.14); }
.connection-pill i, .mini-status .status-dot, .routing-chip i, .arcade-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; box-shadow: 0 0 0 4px rgba(100, 183, 154, 0.15); }
.topbar-connect { border: 0; border-radius: 999px; padding: 9px 14px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 800; cursor: pointer; box-shadow: 0 10px 24px rgba(38, 34, 30, .16); white-space: nowrap; }
.topbar-connect:hover { transform: translateY(-1px); }

.layout { display: grid; grid-template-columns: 250px minmax(660px, 1fr) 286px; min-height: calc(100vh - 82px); }

.sidebar {
  padding: 30px 20px 22px 30px;
  border-right: 1px solid rgba(29, 29, 31, 0.07);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.sidebar-intro h2 { margin: 13px 0 10px; max-width: 190px; font-size: 23px; line-height: 1.11; letter-spacing: -0.04em; }
.sidebar-intro p:last-child { max-width: 190px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.workbench-nav { margin-top: 44px; display: grid; gap: 6px; }
.workbench-tab {
  min-height: 65px;
  padding: 11px 10px;
  display: grid;
  grid-template-columns: 28px 1fr 18px;
  align-items: center;
  gap: 8px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: background .25s ease, border .25s ease, transform .25s ease;
}
.workbench-tab:hover { background: rgba(255,255,255,.74); transform: translateX(2px); }
.workbench-tab.active { background: var(--white); border-color: var(--line); box-shadow: 0 8px 23px rgba(40, 36, 27, 0.06); }
.tab-index { font-size: 10px; color: #a4a3a0; font-weight: 800; align-self: start; padding-top: 4px; }
.workbench-tab strong { display: block; font-size: 13px; }
.workbench-tab small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.tab-arrow { color: #aaa9a5; font-size: 16px; transition: transform .25s ease; }
.workbench-tab.active .tab-arrow { color: var(--orange); transform: translate(2px, -2px); }
.sidebar-footer { display: grid; gap: 17px; }
.mini-status { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.mini-status b { color: var(--ink); }
.text-button { padding: 0; text-align: left; background: transparent; font-size: 11px; color: var(--ink); font-weight: 700; }
.text-button span { color: var(--orange); font-size: 15px; margin-left: 6px; }

.main-content { padding: 32px 31px 42px; min-width: 0; }
.workbench { display: none; animation: rise-in .45s ease both; }
.workbench.active { display: block; }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 27px; }
.section-heading h2 { margin: 9px 0 0; font-size: clamp(26px, 2.6vw, 40px); line-height: 1; letter-spacing: -0.05em; }
.heading-actions { display: flex; align-items: center; gap: 10px; }
.demo-badge { padding: 7px 10px; background: var(--orange-soft); color: #b24f26; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .05em; white-space: nowrap; }
.demo-badge.warm { background: #fff4dd; color: #9d6a20; }
.demo-badge.green { background: var(--green-soft); color: #397a62; }
.demo-badge.purple { background: var(--violet-soft); color: #574bb2; }
.icon-button, .modal-close { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--muted); font-weight: 800; }

.stylecam-stage { display: grid; gap: 18px; }
.materials-zone, .results-zone { min-width: 0; }
.zone-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.zone-heading h3 { margin: 6px 0 0; font-size: 16px; letter-spacing: -0.02em; }
.zone-counter { font-size: 10px; color: var(--muted); }
.zone-counter b { color: var(--ink); }
.zone-actions { display: flex; align-items: center; gap: 10px; }
.upload-button { display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); color: var(--ink); font-size: 10px; font-weight: 800; transition: border-color .2s ease, color .2s ease, transform .2s ease; }
.upload-button:hover { border-color: var(--orange); color: var(--orange); transform: translateY(-1px); }
.upload-button span { color: var(--orange); font-size: 15px; line-height: 10px; }
.material-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.material-card { position: relative; min-height: 108px; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 12px; background: var(--white); text-align: left; }
.material-card img { width: 100%; height: 108px; display: block; object-fit: cover; filter: saturate(.85); transition: transform .5s ease, filter .5s ease; }
.material-card:hover img { transform: scale(1.05); filter: saturate(1.15); }
.material-card.selected { border-color: var(--orange); }
.material-card.selected:after { content: "已装载"; position: absolute; top: 8px; right: 8px; padding: 3px 5px; border-radius: 4px; background: var(--orange); color: white; font-size: 9px; font-weight: 800; }
.material-card.selected img { filter: saturate(1.15); }
.material-card figcaption { position: absolute; right: 8px; bottom: 7px; left: 8px; color: white; font-size: 10px; font-weight: 800; text-shadow: 0 1px 8px rgba(0,0,0,.45); }

.machine-zone {
  position: relative;
  max-width: 620px;
  margin: 7px auto 8px;
  padding: 17px 22px 19px;
  border: 1px solid #dad9d4;
  border-radius: 19px;
  background: linear-gradient(168deg, #fefefd 0%, #e9e8e2 100%);
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.9);
}
.machine-shadow { position: absolute; inset: 70% 10% -15px; border-radius: 50%; background: rgba(97, 88, 75, .13); filter: blur(18px); z-index: -1; }
.machine-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.machine-brand { font-size: 10px; font-weight: 900; letter-spacing: .18em; color: #8c8c87; }
.machine-brand span { color: var(--orange); }
.machine-light { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 5px rgba(255,107,50,.12), 0 0 16px rgba(255,107,50,.5); }
.printer-window { position: relative; overflow: hidden; height: 155px; border: 8px solid #d9d8d1; border-radius: 13px 13px 7px 7px; background: #555; box-shadow: inset 0 3px 10px rgba(0,0,0,.32); }
.printer-image { position: relative; width: 100%; height: 100%; background-position: center; background-size: cover; transition: background-image .4s ease, filter .28s ease, transform .28s ease; }
.printer-image:after { content: attr(data-intensity); position: absolute; right: 10px; top: 9px; padding: 4px 6px; border-radius: 4px; background: rgba(255,255,255,.86); color: #111; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.printer-window-label { position: absolute; left: 12px; bottom: 10px; padding: 5px 7px; border-radius: 5px; color: white; background: rgba(17,17,18,.52); font-size: 10px; }
.machine-console { min-height: 73px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 3px 9px; }
.console-copy { min-width: 0; }
.console-overline { display: block; margin-bottom: 4px; color: #92918d; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.console-copy strong { display: block; font-size: 19px; letter-spacing: -0.04em; }
.console-copy > span:last-child { display: block; margin-top: 4px; color: #878681; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.knob-wrap { display: grid; justify-items: center; gap: 6px; }
.knob { position: relative; width: 61px; height: 61px; border-radius: 50%; background: conic-gradient(from 225deg, #ff7a42, #e8b7a0 30%, #6c625b 72%, #322e2a 100%); box-shadow: inset 0 2px 4px rgba(255,255,255,.34), 0 4px 8px rgba(45,37,31,.2); transition: transform .3s cubic-bezier(.2,1.4,.4,1); }
.knob:before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: linear-gradient(145deg, #514946, #272321); box-shadow: inset 0 2px 3px rgba(255,255,255,.15), inset 0 -4px 7px rgba(0,0,0,.3); }
.knob-mark { position: absolute; width: 3px; height: 17px; top: 7px; left: 50%; border-radius: 3px; background: #ffe9de; transform: translateX(-50%); z-index: 2; }
.knob-caption { color: #8e8d89; font-size: 9px; font-weight: 800; }
.machine-button { width: 100%; height: 39px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 9px; background: var(--orange); color: white; box-shadow: 0 5px 0 #c64d21, 0 10px 18px rgba(255,107,50,.2); font-size: 12px; font-weight: 800; transition: transform .14s ease, box-shadow .14s ease; }
.machine-button:hover { transform: translateY(-1px); }
.machine-button:active { transform: translateY(4px); box-shadow: 0 1px 0 #c64d21; }
.button-led { width: 6px; height: 6px; border-radius: 50%; background: white; box-shadow: 0 0 10px white; }
.paper-slot { height: 9px; margin: 19px 14% 0; border-radius: 0 0 10px 10px; background: #bbb9b0; }
.paper-status { position: relative; top: 12px; text-align: center; color: #9b9991; font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.machine-zone.printing .paper-status { color: var(--orange); }
.machine-zone.printing .machine-light { animation: blink .8s infinite alternate; }
@keyframes blink { to { opacity: .3; transform: scale(.7); } }

.results-shelf { min-height: 143px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: stretch; }
.result-card { position: relative; overflow: hidden; min-height: 143px; padding: 0; border-radius: 12px; background: var(--white); text-align: left; border: 1px solid var(--line); }
.result-card img { width: 100%; height: 143px; display: block; object-fit: cover; }
.result-card:after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 38%, rgba(20,18,16,.72)); pointer-events: none; }
.result-card-label { position: absolute; z-index: 2; right: 10px; bottom: 9px; left: 10px; color: white; font-size: 10px; font-weight: 800; }
.result-card-label small { display: block; margin-top: 3px; color: rgba(255,255,255,.72); font-weight: 500; }
.result-card.active { border: 2px solid var(--orange); }
.result-card.active:before { content: "当前"; position: absolute; z-index: 3; top: 8px; left: 8px; padding: 3px 5px; border-radius: 4px; background: white; color: var(--orange); font-size: 9px; font-weight: 900; }
.result-preview { height: 245px; border-radius: 10px; background-position: center; background-size: cover; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }.compare-grid div { min-width: 0; }.compare-grid span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 800; }.compare-grid img, .compare-preview { width: 100%; height: 150px; display: block; object-fit: cover; border-radius: 8px; background-position: center; background-size: cover; }.compare-preview { box-shadow: inset 0 0 0 2px rgba(255,124,73,.55); }
.interaction-strip { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 8px; padding: 0 4px; border-top: 1px solid var(--line); }
.interaction-copy { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.status-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(255,107,50,.1); }
.active-parameter { display: flex; align-items: center; gap: 10px; font-size: 10px; color: var(--muted); }
.active-parameter b { color: var(--ink); }
.active-parameter em { padding: 5px 7px; border-radius: 5px; background: var(--orange-soft); color: var(--orange); font-style: normal; font-weight: 800; }

.light-stage { display: grid; gap: 18px; }
.light-hero { min-height: 285px; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border-radius: var(--radius); background: #1e211e; color: white; box-shadow: var(--shadow); }
.light-hero-copy { padding: 33px 30px; }
.light-hero-copy .eyebrow { color: #92a399; }
.light-hero-copy h3 { max-width: 330px; margin: 19px 0 12px; font-size: clamp(25px, 3vw, 43px); line-height: 1.02; letter-spacing: -0.05em; }
.light-hero-copy > p:not(.eyebrow) { max-width: 370px; color: #bfc9c1; font-size: 12px; line-height: 1.75; }
.light-readout { display: flex; gap: 14px; margin-top: 28px; color: #95a49a; font-size: 10px; }
.light-readout span { display: flex; align-items: center; gap: 7px; }
.readout-led { width: 7px; height: 7px; border-radius: 50%; background: #e0ad52; box-shadow: 0 0 11px #e0ad52; }
.readout-led.green { background: #71c29e; box-shadow: 0 0 11px #71c29e; }
.light-readout b { color: white; font-size: 9px; letter-spacing: .12em; }
.led-orbit { position: relative; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at center, rgba(94, 183, 141, .13), transparent 53%); }
.orbit-ring { position: absolute; border: 1px solid rgba(142, 187, 156, .24); border-radius: 50%; transform: rotate(-19deg) skewX(-7deg); }
.ring-one { width: 340px; height: 170px; }
.ring-two { width: 255px; height: 125px; opacity: .66; }
.led-strip { z-index: 2; display: flex; gap: 14px; align-items: center; transform: rotate(-8deg); }
.led-pixel { width: 38px; height: 38px; border-radius: 50%; background: #72c6a0; box-shadow: 0 0 22px currentColor, 0 0 45px color-mix(in srgb, currentColor 34%, transparent); transition: background .6s ease, box-shadow .6s ease, transform .4s ease; }
.led-pixel:nth-child(2), .led-pixel:nth-child(4) { transform: translateY(-20px); }
.orbit-label { position: absolute; right: 30px; bottom: 22px; color: #81958a; font-size: 9px; letter-spacing: .16em; }
.light-controls { display: grid; grid-template-columns: 1fr 1fr .8fr; gap: 12px; }
.light-control-card { min-height: 150px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.card-kicker { color: var(--muted); font-size: 9px; letter-spacing: .16em; font-weight: 900; }
.light-control-card h3 { margin: 10px 0 5px; font-size: 16px; letter-spacing: -0.03em; }
.light-control-card p { min-height: 34px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.swatch-row { display: flex; gap: 6px; margin-top: 17px; }
.swatch { width: 23px; height: 23px; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.pattern-meter { height: 34px; display: flex; align-items: flex-end; gap: 4px; margin-top: 18px; }
.pattern-meter span { width: 7px; border-radius: 4px 4px 2px 2px; background: var(--orange); animation: meter 1.35s ease-in-out infinite alternate; }
.pattern-meter span:nth-child(1) { height: 12px; animation-delay: -.9s; }.pattern-meter span:nth-child(2) { height: 24px; animation-delay: -.6s; }.pattern-meter span:nth-child(3) { height: 32px; animation-delay: -.3s; }.pattern-meter span:nth-child(4) { height: 20px; }.pattern-meter span:nth-child(5) { height: 10px; animation-delay: -.4s; }
@keyframes meter { to { transform: scaleY(.35); opacity: .55; } }
.mapping-card { padding: 17px; }
.mini-map-row { display: grid; grid-template-columns: 25px 1fr 25px 1fr; gap: 5px; align-items: center; margin-top: 9px; font-size: 10px; }
.mini-map-row span { color: var(--orange); font-weight: 900; }
.mini-map-row b { color: var(--muted); font-weight: 600; }

.arcade-stage { display: grid; grid-template-columns: minmax(0, 1fr) 246px; gap: 18px; }
.arcade-board { padding: 18px; border-radius: var(--radius); background: #202222; color: white; box-shadow: var(--shadow); }
.arcade-board-top, .arcade-board-bottom { display: flex; justify-content: space-between; gap: 10px; color: #9fa9a3; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.arcade-live { display: inline-flex; align-items: center; gap: 7px; }.arcade-live i { background: #72ca9f; }
.game-world { position: relative; display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(7, 1fr); gap: 4px; height: 430px; margin: 16px 0; padding: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,.11); border-radius: 12px; background: linear-gradient(rgba(25, 34, 31, .63), rgba(25, 34, 31, .78)), url("assets/forest.jpg") center/cover; }
.game-cell { min-width: 0; min-height: 0; border: 1px solid rgba(183, 222, 185, .08); border-radius: 5px; background: rgba(17, 35, 27, .14); }
.game-cell.player { position: relative; background: #ff7541; box-shadow: 0 0 0 3px rgba(255,117,65,.2), 0 0 22px rgba(255,117,65,.72); }
.game-cell.player:after { content: ""; position: absolute; inset: 30%; border-radius: 50%; background: #fff7ee; }
.game-cell.spark { background: #c6ef8a; box-shadow: 0 0 15px #c6ef8a; animation: spark-pulse 1.2s infinite alternate; }
@keyframes spark-pulse { to { transform: scale(.68); opacity: .45; } }
.game-cell.pulse { animation: cell-pulse .5s ease; }
@keyframes cell-pulse { 50% { background: rgba(198,239,138,.62); } }
.arcade-board-bottom { align-items: center; letter-spacing: 0; font-weight: 500; }
.small-action { padding: 7px 10px; border: 1px solid rgba(255,255,255,.17); border-radius: 7px; color: white; background: rgba(255,255,255,.08); font-size: 10px; font-weight: 800; }
.arcade-aside { min-height: 470px; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.arcade-art { height: 150px; margin: -1px -1px 23px; border-radius: 10px; background: linear-gradient(145deg, rgba(29,34,28,.08), rgba(29,34,28,.55)), url("assets/night.jpg") center/cover; }
.arcade-aside h3 { margin: 11px 0 9px; font-size: 21px; line-height: 1.1; letter-spacing: -0.04em; }
.arcade-aside p:not(.eyebrow) { color: var(--muted); font-size: 11px; line-height: 1.7; }
.arcade-legend { display: grid; gap: 10px; margin-top: 27px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.arcade-legend b { margin-right: 5px; color: var(--orange); font-size: 9px; }

.setup-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 18px; }
.setup-panel { min-height: 370px; padding: 23px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-heading h3 { margin: 8px 0 0; font-size: 19px; letter-spacing: -0.04em; }
.routing-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 999px; background: var(--green-soft); color: #3e7b62; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.routing-chip i { width: 5px; height: 5px; box-shadow: none; }
.board-version { color: var(--muted); font-size: 9px; letter-spacing: .08em; font-weight: 800; }
.panel-lead { max-width: 370px; margin: 17px 0 21px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.route-cards { display: grid; gap: 8px; }
.route-card { min-height: 50px; display: grid; grid-template-columns: 28px 1fr auto; gap: 9px; align-items: center; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fbfbf9; text-align: left; }
.route-card.selected { border-color: var(--orange); background: var(--orange-soft); }
.route-card span { color: var(--muted); font-size: 10px; font-weight: 800; }
.route-card b { font-size: 11px; }.route-card small { color: var(--muted); font-size: 9px; }
.primary-action { width: 100%; height: 39px; margin-top: 20px; border-radius: 8px; background: var(--ink); color: white; font-size: 11px; font-weight: 800; }
.primary-action span { margin-left: 7px; color: #ff9670; font-size: 16px; }
.setup-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.setup-actions .primary-action { grid-column: 1 / -1; margin-top: 0; }
.secondary-action { min-height: 36px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfbf9; color: var(--ink); font-size: 10px; font-weight: 800; transition: border-color .2s ease, color .2s ease, background .2s ease; }
.secondary-action:hover:not(:disabled) { border-color: var(--orange); color: var(--orange); background: var(--orange-soft); }
.secondary-action:disabled { cursor: not-allowed; opacity: .45; }
.danger-action:hover:not(:disabled) { border-color: #bf3c2c; color: #bf3c2c; background: #fff0ed; }
.bridge-note { min-height: 34px; margin: 11px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.hid-control-panel { display: grid; gap: 11px; margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--line); }
.compact-heading { align-items: center; }
.compact-heading h3 { margin-top: 6px; font-size: 15px; }
.compact-heading .board-version { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.compact-lead { max-width: none; margin: 0; }
.hid-learning-row { display: grid; grid-template-columns: minmax(120px, .8fr) 1fr 1fr; gap: 8px; align-items: stretch; }
.hid-target-field { display: grid; gap: 5px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; font-size: 9px; font-weight: 800; }
.hid-target-field select { width: 100%; min-width: 0; height: 25px; padding: 3px 2px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 10px; font-weight: 700; }
.hid-learning-row .secondary-action { min-width: 0; }
.hid-learning-status { min-height: 26px; display: flex; align-items: center; padding: 7px 9px; border-radius: 7px; background: var(--violet-soft); color: #574bb2; font-size: 10px; line-height: 1.45; }
.hid-raw-line { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 9px; }
.hid-raw-line code { min-width: 0; overflow: hidden; flex: 1; padding: 5px 7px; border-radius: 5px; background: #f4f3ed; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.wifi-field { display: grid; gap: 5px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; font-size: 9px; font-weight: 800; }
.wifi-field input { width: 100%; min-width: 0; height: 25px; padding: 3px 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; font-weight: 500; }
.wifi-pairing { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 9px; }
.wifi-pairing code { overflow: hidden; flex: 1; color: #26704e; font-size: 10px; text-overflow: ellipsis; }
.wifi-pairing button { padding: 4px 7px; border-radius: 5px; background: var(--green-soft); color: #26704e; font-size: 9px; font-weight: 800; }
.board-table-wrap { margin-top: 21px; overflow: auto; }
.board-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.board-table th { padding: 0 6px 10px; color: var(--muted); border-bottom: 1px solid var(--line); text-align: left; font-size: 9px; letter-spacing: .08em; }
.board-table td { padding: 10px 6px; border-bottom: 1px solid #efeee9; vertical-align: top; }.board-table td:first-child { font-weight: 800; }.board-table td:nth-child(2) { color: var(--orange); font-weight: 800; }
.setup-footer { margin-top: 18px; }
.health-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; }
.health-card { position: relative; display: grid; grid-template-columns: 31px 1fr; gap: 1px 8px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.66); }
.health-icon { grid-row: span 2; display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; background: var(--violet-soft); color: var(--violet); font-size: 9px; font-weight: 900; }
.health-card b { font-size: 10px; }.health-card small { color: var(--muted); font-size: 9px; }.health-card i { position: absolute; top: 9px; right: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(100,183,154,.13); }
.health-card i.inactive { background: #c9c8c2; box-shadow: none; }

.hardware-rail { padding: 30px 30px 21px 20px; border-left: 1px solid rgba(29, 29, 31, 0.07); display: flex; flex-direction: column; gap: 16px; }
.rail-heading { display: flex; align-items: flex-end; justify-content: space-between; }.rail-heading h2 { margin: 8px 0 0; font-size: 22px; letter-spacing: -0.04em; }.rail-version { color: var(--muted); font-size: 10px; font-weight: 800; }
.hardware-card { padding: 14px; border: 1px solid #d6d4ce; border-radius: 16px; background: #e5e4dd; box-shadow: 0 13px 25px rgba(28,26,21,.08); }
.board-topline { display: flex; justify-content: space-between; color: #8b8a83; font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.hardware-board { position: relative; min-height: 280px; margin-top: 12px; padding: 23px 12px 16px; overflow: hidden; border-radius: 11px; background: linear-gradient(145deg, #363b38, #1f2522); box-shadow: inset 0 1px rgba(255,255,255,.16); }
.hardware-board:after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(30deg, transparent 0 20px, rgba(142, 184, 140, .06) 21px 22px); pointer-events: none; }
.key-grid { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hardware-key { height: 39px; position: relative; border: 1px solid #9da59b; border-bottom-width: 3px; border-radius: 7px; background: linear-gradient(145deg, #f1efe7, #babcb0); color: #48524a; font-size: 11px; font-weight: 900; box-shadow: 0 3px 6px rgba(0,0,0,.26); transition: transform .11s ease, background .11s ease, box-shadow .11s ease; }
.hardware-key small { display: block; margin-top: 2px; color: #838980; font-size: 7px; font-weight: 800; }
.hardware-key.pressed { transform: translateY(3px); border-bottom-width: 1px; background: linear-gradient(145deg, #ff9975, #ed633b); color: white; box-shadow: 0 0 16px rgba(255,107,50,.45); }.hardware-key.pressed small { color: rgba(255,255,255,.78); }
.encoder-hardware { position: relative; z-index: 2; display: grid; place-items: center; margin-top: 21px; }
.encoder-glow { position: absolute; width: 100px; height: 42px; border-radius: 50%; background: rgba(255, 100, 50, .19); filter: blur(15px); }
.encoder-knob { position: relative; width: 72px; height: 72px; border-radius: 50%; background: conic-gradient(from 215deg, #ff9365, #df6c43 35%, #413b38 74%, #211d1a); box-shadow: inset 0 2px 4px rgba(255,255,255,.3), 0 7px 10px rgba(0,0,0,.35); transition: transform .25s cubic-bezier(.2,1.5,.4,1); }
.encoder-knob:after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: linear-gradient(145deg, #4e4b46, #252321); box-shadow: inset 0 3px 4px rgba(255,255,255,.13); }
.encoder-indicator { position: absolute; z-index: 2; top: 8px; left: 50%; width: 3px; height: 18px; border-radius: 3px; background: #ffe5d5; transform: translateX(-50%); }
.encoder-label { position: relative; display: grid; gap: 3px; margin-top: 11px; text-align: center; }.encoder-label span { color: #8b958c; font-size: 8px; letter-spacing: .15em; }.encoder-label b { color: #d9e2d7; font-size: 9px; }
.hardware-status { display: grid; gap: 7px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(105,106,99,.35); }
.status-line { display: flex; align-items: center; justify-content: space-between; color: #747870; font-size: 9px; }.status-line span { display: inline-flex; align-items: center; gap: 6px; }.status-line b { color: #4f564f; font-size: 8px; letter-spacing: .06em; }.status-line i { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }.green-dot { background: #64bd91; }.orange-dot { background: #df8b53; }.purple-dot { background: #8b7be3; }
.key-hint { display: grid; gap: 9px; padding: 16px 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.55); }.hint-title { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; font-size: 11px; }.hint-key { padding: 4px 6px; border-radius: 5px; color: var(--orange); background: var(--orange-soft); font-size: 9px; font-weight: 900; }.hint-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }.hint-row span:first-child { color: var(--ink); font-weight: 800; }
.input-monitor { display: grid; gap: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.64); }
.monitor-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .09em; }
.monitor-heading b { color: #9a9992; font-size: 8px; font-weight: 700; letter-spacing: 0; white-space: nowrap; }
.monitor-action { min-height: 29px; display: flex; align-items: center; padding: 7px 8px; border-radius: 7px; background: #f4f3ed; color: var(--ink); font-size: 10px; font-weight: 800; }
.monitor-history { display: grid; gap: 6px; }
.monitor-history span { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; }
.monitor-history b { color: var(--orange); font-size: 9px; }
.monitor-history small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.rail-footer { display: flex; justify-content: space-between; margin-top: auto; color: var(--muted); font-size: 9px; }.rail-battery { color: #3f8a68; font-weight: 800; }.rail-battery i { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--green); }

.toast { position: fixed; z-index: 50; right: 28px; bottom: 24px; max-width: 330px; padding: 12px 15px; border-radius: 9px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .25s ease, transform .25s ease; }.toast.show { opacity: 1; transform: translateY(0); }
.modal-backdrop { position: fixed; z-index: 60; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(28,27,24,.43); backdrop-filter: blur(8px); }.modal-backdrop[hidden] { display: none; }.modal { position: relative; width: min(520px, 100%); padding: 28px; border-radius: 16px; background: var(--white); box-shadow: 0 30px 80px rgba(0,0,0,.2); }.modal h2 { margin: 9px 0 17px; font-size: 27px; letter-spacing: -0.05em; }.modal-close { position: absolute; top: 18px; right: 18px; font-size: 20px; font-weight: 400; }.modal p, .modal li { color: var(--muted); font-size: 12px; line-height: 1.75; }.modal ul { padding-left: 20px; }.idea-card { padding: 13px; margin-top: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fbfbf9; }.idea-card b { display: block; margin-bottom: 4px; font-size: 12px; }.idea-card p { margin: 0; }

@media (max-width: 1220px) {
  .layout { grid-template-columns: 220px minmax(600px, 1fr) 260px; }
  .sidebar { padding-left: 22px; }
  .hardware-rail { padding-right: 22px; }
  .main-content { padding-left: 22px; padding-right: 22px; }
  .material-grid { grid-template-columns: repeat(2, 1fr); }
  .light-controls, .setup-grid { grid-template-columns: 1fr 1fr; }
  .mapping-card { grid-column: span 2; }
  .hid-learning-row { grid-template-columns: 1fr 1fr; }
  .hid-target-field { grid-column: 1 / -1; }
  .health-cards { grid-template-columns: repeat(2, 1fr); }
}
