* { box-sizing: border-box; }

@property --keyboard-rgb-hue {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

:root {
  --bg-page: #e8edf4;
  --bg-stage: linear-gradient(180deg, #c7ced8 0%, #b8c0cb 100%);
  --bg-card: rgba(255, 255, 255, 0.78);
  --bg-card-strong: rgba(255, 255, 255, 0.9);
  --bg-soft: rgba(247, 250, 253, 0.76);
  --line-soft: rgba(107, 125, 148, 0.26);
  --line-strong: #5d6672;
  --text-main: #3d4652;
  --text-soft: #60748c;
  --accent: #5a90d6;
  --accent-strong: #4178c0;
  --keyboard-light-rgb: 112, 144, 255;
  --shadow-soft: 0 10px 28px rgba(51, 69, 92, 0.12);
}

body {
  margin: 0;
  background: var(--bg-page);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text-soft);
}

body.modal-open {
  overflow: hidden;
}

.accessories-only #productModal,
.accessories-only #productSwitcher,
.foot-switch-only #productModal,
.foot-switch-only #productSwitcher {
  display: none !important;
}

.productModal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 27, 43, 0.42);
  backdrop-filter: blur(4px);
}

.productModal.hidden {
  display: none;
}

.productModalCard {
  width: min(760px, calc(100vw - 32px));
  border: 1px solid #d7e0eb;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfcfe 0%, #eef3f9 100%);
  box-shadow: 0 18px 44px rgba(33, 52, 74, 0.18);
  padding: 28px 28px 24px;
}

.productModalTitle {
  font-size: 28px;
  font-weight: 800;
  color: #334866;
}

.productModalSubTitle {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: #657a94;
}

.zhMain,
.enSub {
  display: block;
}

.productModalTitle .zhMain {
  font-size: 28px;
  line-height: 1.18;
  font-weight: 900;
  color: #334866;
}

.productModalTitle .enSub {
  margin-top: 5px;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 700;
  color: rgba(82, 101, 124, 0.54);
}

.productModalSubTitle .zhMain,
.connectGuideTip .zhMain {
  font-size: 14px;
  line-height: 1.55;
  font-weight: 700;
}

.productModalSubTitle .enSub,
.connectGuideTip .enSub {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
  color: rgba(86, 105, 128, 0.56);
}

.productModalOptions {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.productOptionBtn {
  --sequence-index: 0;
  min-height: 118px;
  border: 2px solid #4a4d52;
  border-radius: 14px;
  background: #ecebea;
  color: #34383d;
  box-shadow: inset 0 0 0 2px #d7d6d5;
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 12px;
  animation: productOptionBorderGlow 6.3s linear infinite;
  animation-delay: calc(var(--sequence-index) * 0.7s);
  transition: transform 0.24s cubic-bezier(.2, .8, .2, 1), border-color 0.24s ease, box-shadow 0.3s ease, background-color 0.24s ease;
}

.productOptionBtn:nth-child(1) { --sequence-index: 0; }
.productOptionBtn:nth-child(2) { --sequence-index: 1; }
.productOptionBtn:nth-child(3) { --sequence-index: 2; }
.productOptionBtn:nth-child(4) { --sequence-index: 3; }
.productOptionBtn:nth-child(5) { --sequence-index: 4; }
.productOptionBtn:nth-child(6) { --sequence-index: 5; }
.productOptionBtn:nth-child(7) { --sequence-index: 6; }
.productOptionBtn:nth-child(8) { --sequence-index: 7; }
.productOptionBtn:nth-child(9) { --sequence-index: 8; }

@keyframes productOptionBorderGlow {
  0% {
    border-color: #4a4d52;
    box-shadow: inset 0 0 0 2px #d7d6d5;
  }
  3.5% {
    border-color: #5b9fe8;
    box-shadow:
      inset 0 0 0 2px rgba(218, 237, 255, 0.96),
      0 0 0 4px rgba(96, 161, 232, 0.14),
      0 0 22px 7px rgba(65, 133, 214, 0.27),
      0 10px 24px rgba(53, 103, 166, 0.18);
  }
  8% {
    border-color: #4a4d52;
    box-shadow: inset 0 0 0 2px #d7d6d5;
  }
  100% {
    border-color: #4a4d52;
    box-shadow: inset 0 0 0 2px #d7d6d5;
  }
}

.productOptionBtn:hover {
  animation: none;
  z-index: 3;
  background: #f5f9ff;
  border-color: #4f96e2;
  box-shadow:
    inset 0 0 0 2px rgba(222, 240, 255, 1),
    0 0 0 6px rgba(93, 159, 230, 0.16),
    0 0 32px 12px rgba(61, 128, 211, 0.3),
    0 18px 34px rgba(45, 91, 151, 0.24);
  transform: scale(1.055);
}

.productOptionBtn:active {
  transform: scale(1.025);
}

@media (prefers-reduced-motion: reduce) {
  .productOptionBtn {
    animation: none;
  }
}

.productOptionTitle {
  font-size: 18px;
  font-weight: 800;
}

.productOptionPreview {
  flex: 0 0 auto;
  position: relative;
  box-sizing: border-box;
  margin-top: 6px;
}

.keyboardPreview {
  --preview-cols: 3;
  width: 76px;
  min-height: 30px;
  display: grid;
  grid-template-columns: repeat(var(--preview-cols), minmax(0, 1fr));
  grid-auto-rows: 10px;
  gap: 3px;
  align-content: center;
  padding: 5px 7px;
  border: 1px solid rgba(74, 83, 94, 0.64);
  border-radius: 7px;
  background: linear-gradient(180deg, #cfd5dc 0%, #aeb7c1 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72), 0 2px 4px rgba(55, 66, 78, 0.16);
}

.keyboardPreview[data-count="1"] { width: 42px; }
.keyboardPreview[data-count="2"] { width: 54px; }
.keyboardPreview[data-count="3"] { width: 66px; }
.keyboardPreview[data-count="4"] { width: 50px; }

.keyboardPreview i {
  display: block;
  min-width: 0;
  border: 1px solid rgba(67, 77, 89, 0.72);
  border-radius: 3px;
  background: linear-gradient(180deg, #f9fafb 0%, #e2e6eb 100%);
  box-shadow: inset 0 1px 0 #fff, 0 1px 1px rgba(44, 53, 64, 0.2);
}

.footPreview {
  width: 58px;
  height: 30px;
}

.footCable {
  position: absolute;
  left: 28px;
  top: 0;
  width: 2px;
  height: 8px;
  border-radius: 2px;
  background: #7c8793;
}

.footPedal {
  position: absolute;
  left: 12px;
  bottom: 0;
  width: 34px;
  height: 22px;
  border: 1px solid #68737f;
  border-radius: 7px 7px 10px 10px;
  background: linear-gradient(145deg, #e8ebef 0%, #9da8b4 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.78), 0 2px 4px rgba(54, 64, 76, 0.18);
  transform: perspective(40px) rotateX(8deg);
}

.usbPreview {
  width: 68px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(75, 86, 99, 0.58);
  border-radius: 7px;
  background: linear-gradient(180deg, #dce2e8 0%, #bcc5cf 100%);
  color: #596675;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75), 0 2px 4px rgba(54,64,76,0.15);
}

.usbPreview b {
  font-size: 10px;
  line-height: 1;
}

.usbPlug {
  width: 14px;
  height: 9px;
  border: 1px solid #697582;
  border-radius: 2px;
  background: #f5f7f9;
  box-shadow: inset 3px 0 0 #aeb8c3;
}

.productOptionTitleEn {
  font-size: 11px;
  font-weight: 700;
  color: rgba(78, 93, 111, 0.52);
}

.productVideoTutorialBtn {
  width: 100%;
  height: 52px;
  margin-top: 18px;
  border: 1px solid rgba(65, 120, 192, 0.52);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(232,241,253,0.92));
  color: #386da9;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.88),
    0 12px 28px rgba(73, 112, 160, 0.16);
  cursor: pointer;
  transition: transform 0.24s cubic-bezier(.2, .8, .2, 1), border-color 0.24s ease, box-shadow 0.3s ease, background 0.24s ease;
}

.productVideoTutorialBtn:hover {
  transform: scale(1.025);
  border-color: rgba(65, 120, 192, 0.92);
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(225,239,255,0.98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.96),
    0 0 0 5px rgba(91, 155, 228, 0.13),
    0 0 30px 10px rgba(65, 132, 213, 0.24),
    0 18px 34px rgba(55, 103, 164, 0.2);
}

.productVideoTutorialBtn:active {
  transform: scale(1.01);
}

.videoTutorialModal {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: rgba(12, 22, 36, 0.58);
  backdrop-filter: blur(7px);
}

.videoTutorialModal.hidden {
  display: none;
}

.videoTutorialCard {
  width: min(960px, calc(100vw - 36px));
  border: 1px solid rgba(224, 234, 246, 0.88);
  border-radius: 22px;
  background: linear-gradient(180deg, #f7faff 0%, #e8eef7 100%);
  box-shadow: 0 26px 72px rgba(15, 27, 43, 0.35);
  padding: 18px;
}

.videoTutorialHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 0 4px 0 8px;
}

.videoTutorialHead strong {
  display: block;
  font-size: 24px;
  line-height: 1.2;
  color: #26313d;
  font-weight: 900;
}

.videoTutorialHead span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: rgba(82, 101, 124, 0.72);
  font-weight: 700;
}

#videoTutorialClose,
#modeHelpClose,
#keyboardTestClose {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(87, 104, 124, 0.34);
  border-radius: 50%;
  background: rgba(255,255,255,0.86);
  color: #3d4652;
  font-size: 28px;
  line-height: 1;
  font-weight: 500;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}

#videoTutorialClose:hover,
#modeHelpClose:hover,
#keyboardTestClose:hover {
  background: #fff;
}

.keyboardTestCard {
  width: min(1180px, calc(100vw - 36px));
  height: min(86vh, 820px);
  display: flex;
  flex-direction: column;
}

.keyboardTestHead {
  flex: 0 0 auto;
}

.keyboardTestActions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#keyboardTestExternal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid rgba(65, 120, 192, 0.5);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #386da9;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

#keyboardTestExternal:hover {
  background: #fff;
  border-color: rgba(65, 120, 192, 0.78);
}

.keyboardTestFrame {
  display: block;
  width: 100%;
  flex: 1 1 auto;
  min-height: 420px;
  border: 1px solid rgba(116, 135, 158, 0.28);
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.56);
}

.keyboardTestFrame:focus-visible {
  outline: 3px solid rgba(65, 120, 192, 0.42);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .keyboardTestModal { padding: 10px; }
  .keyboardTestCard { width: calc(100vw - 20px); height: calc(100vh - 20px); padding: 12px; }
  .keyboardTestHead { align-items: flex-start; gap: 10px; }
  .keyboardTestHead strong { font-size: 19px; }
  .keyboardTestHead span { font-size: 11px; }
  #keyboardTestExternal { min-height: 34px; padding: 0 10px; font-size: 11px; }
  #keyboardTestClose { width: 36px; height: 36px; font-size: 24px; }
  .keyboardTestFrame { min-height: 300px; }
}

.modeHelpCard {
  width: min(620px, calc(100vw - 36px));
}

.modeHelpText {
  padding: 22px 24px;
  border: 1px solid rgba(116, 135, 158, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  color: #35475d;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.8;
}

.videoTutorialPlayer {
  display: block;
  width: 100%;
  max-height: min(70vh, 620px);
  border-radius: 16px;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.connectGuideCard {
  width: min(620px, calc(100vw - 32px));
  padding: 22px 24px 20px;
}

.connectGuideBadge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: rgba(90, 144, 214, 0.12);
  border: 1px solid rgba(65, 120, 192, 0.22);
  color: #4178c0;
  font-size: 13px;
  font-weight: 800;
}

.connectGuideBadge .zhMain {
  font-size: 13px;
  line-height: 1;
}

.connectGuideBadge .enSub {
  margin-left: 7px;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  color: rgba(65, 120, 192, 0.58);
}

.connectGuideBadge .zhMain,
.connectGuideBadge .enSub {
  display: inline-block;
}

.connectGuideDevice {
  display: none;
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.9), rgba(238,244,251,0.86));
  border: 1px solid rgba(123, 143, 166, 0.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
  display: none;
  gap: 6px;
}

.connectGuideTip {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 246, 219, 0.78);
  border: 1px solid rgba(211, 157, 52, 0.28);
  color: #7a5a18;
  font-size: 14px;
  line-height: 1.42;
  font-weight: 700;
}

.connectGuidePicture {
  margin-top: 12px;
  padding: 12px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 8%, rgba(90,144,214,0.16), transparent 34%),
    linear-gradient(180deg, rgba(241,247,255,0.94), rgba(226,235,247,0.9));
  border: 1px solid rgba(105, 128, 158, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.82),
    0 14px 28px rgba(65, 82, 106, 0.12);
}

.connectGuidePictureTitle {
  color: #315f98;
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 8px;
}

.browserChooserMock {
  position: relative;
  border: 2px solid rgba(76, 86, 99, 0.58);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(37, 53, 75, 0.14);
}

.browserChooserTitle {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(84, 97, 112, 0.18);
  color: #26313d;
  font-size: 16px;
  font-weight: 900;
}

.browserChooserList {
  padding: 12px;
}

.browserChooserRow {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border: 3px solid rgba(65, 120, 192, 0.78);
  border-radius: 12px;
  background: linear-gradient(180deg, #f7fbff, #eaf3ff);
  box-shadow: 0 0 0 5px rgba(65, 120, 192, 0.12);
}

.browserChooserRadio {
  width: 20px;
  height: 20px;
  border: 6px solid #4f8bd2;
  border-radius: 50%;
  background: #fff;
}

.browserChooserName {
  display: block;
  color: #1f2d3d;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
}

.browserChooserMeta {
  display: block;
  margin-top: 4px;
  color: rgba(61, 78, 98, 0.66);
  font-size: 12px;
  font-weight: 800;
}

.browserChooserBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #4f8bd2;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(65, 120, 192, 0.24);
}

.browserChooserActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 14px 12px;
  border-top: 1px solid rgba(84, 97, 112, 0.14);
  background: #f8fafc;
}

.browserChooserActions span,
.browserChooserActions strong {
  min-width: 72px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
}

.browserChooserActions span {
  border: 1px solid rgba(84, 97, 112, 0.42);
  color: #5e6d7f;
  background: #fff;
}

.browserChooserActions strong {
  color: #fff;
  background: #4f8bd2;
  border: 1px solid #4178c0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.22s ease, background 0.18s ease;
}

.browserChooserActions strong:hover,
.browserChooserActions strong:focus-visible {
  background: #3f82d2;
  box-shadow: 0 0 0 4px rgba(79, 139, 210, 0.16), 0 8px 18px rgba(65, 120, 192, 0.28);
  outline: none;
  transform: scale(1.06);
}

.connectGuidePictureNote {
  margin-top: 8px;
  text-align: center;
  color: #315f98;
  font-size: 14px;
  font-weight: 900;
}

.connectGuideDevice span {
  color: #8198b6;
  font-size: 13px;
  font-weight: 700;
}

.connectGuideDevice span .enSub {
  margin-top: 2px;
  font-size: 10px;
  color: rgba(94, 116, 143, 0.52);
}

.connectGuideDevice strong {
  color: #26313d;
  font-size: 22px;
  font-weight: 900;
}

.connectGuideDevice strong .zhMain {
  font-size: 22px;
  line-height: 1.16;
}

.connectGuideDevice strong .enSub {
  margin-top: 3px;
  font-size: 12px;
  color: rgba(67, 80, 96, 0.52);
}

.connectGuideDevice em {
  color: #5c7090;
  font-size: 14px;
  font-style: normal;
}

.connectGuideDevice em:empty {
  display: none;
}

.connectGuideChooserPreview {
  margin-top: 8px;
  min-height: 64px;
  padding: 12px 14px;
  border: 2px solid rgba(65, 120, 192, 0.62);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.92),
    0 10px 22px rgba(65, 120, 192, 0.12);
  display: grid;
  grid-template-columns: 18px 1fr;
  grid-template-areas:
    "radio name"
    "radio meta";
  column-gap: 10px;
  align-items: center;
}

.connectGuideChooserPreview i {
  grid-area: radio;
  width: 18px;
  height: 18px;
  border: 5px solid #4f8bd2;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 139, 210, 0.14);
}

.connectGuideChooserPreview b {
  grid-area: name;
  color: #26313d;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 900;
}

.connectGuideChooserPreview small {
  grid-area: meta;
  margin-top: 2px;
  color: rgba(82, 101, 124, 0.62);
  font-size: 12px;
  font-weight: 700;
}

.connectGuideChooserPreview.secondary {
  border-color: rgba(123, 143, 166, 0.24);
  background: rgba(247, 250, 253, 0.74);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.74);
}

.connectGuideChooserPreview.secondary i {
  border-color: rgba(123, 143, 166, 0.48);
  box-shadow: none;
}

.connectGuideChooserPreview.secondary b {
  color: rgba(61, 70, 82, 0.74);
}

.connectGuideActions {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(240px, 360px);
  justify-content: center;
  gap: 12px;
}

.connectGuideBtn {
  height: 52px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.connectGuideBtn .zhMain {
  font-size: 16px;
  line-height: 1.1;
}

.connectGuideBtn .enSub {
  margin-top: 3px;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  opacity: 0.62;
}

.connectGuideBtn.secondary {
  border: 1px solid rgba(84, 97, 112, 0.55);
  background: rgba(255,255,255,0.86);
  color: #3d4652;
}

.connectGuideBtn.primary {
  border: 1px solid #3f73b3;
  background: linear-gradient(180deg, #6fa6e7 0%, #4e8ed8 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.32),
    0 10px 18px rgba(65, 120, 192, 0.22);
}

#connectGuideConfirm,
#operationGuideConfirm {
  animation: deviceChooserCtaPulse 1.65s ease-in-out infinite;
  transition: transform 0.22s cubic-bezier(.2, .8, .2, 1), box-shadow 0.26s ease, filter 0.2s ease;
}

@keyframes deviceChooserCtaPulse {
  0%, 100% {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.44), 0 10px 24px rgba(65, 120, 192, 0.22);
    transform: scale(1);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.62),
      0 0 0 6px rgba(83, 148, 224, 0.14),
      0 0 28px 9px rgba(65, 130, 211, 0.24),
      0 14px 30px rgba(55, 104, 166, 0.24);
    transform: scale(1.025);
  }
}

#connectGuideConfirm:hover,
#connectGuideConfirm:focus-visible,
#operationGuideConfirm:hover,
#operationGuideConfirm:focus-visible {
  animation-play-state: paused;
  filter: brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.68),
    0 0 0 7px rgba(83, 148, 224, 0.16),
    0 0 34px 12px rgba(65, 130, 211, 0.3),
    0 18px 36px rgba(55, 104, 166, 0.26);
  outline: none;
  transform: scale(1.035);
}

#connectGuideConfirm:disabled,
#operationGuideConfirm:disabled {
  animation: none;
  transform: none;
}

.connectGuideBtn:disabled {
  opacity: 0.62;
  cursor: wait;
}

.operationGuideCard {
  width: min(760px, calc(100vw - 32px));
}

.operationSteps {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}

.operationStep {
  min-height: 72px;
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(123, 143, 166, 0.24);
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(238,244,251,0.82));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.operationStep strong {
  grid-row: 1 / 3;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(180deg, #6fa6e7, #4e8ed8);
  box-shadow: 0 8px 14px rgba(65, 120, 192, 0.18);
  font-size: 20px;
}

.operationStep span {
  color: #2f3b49;
  font-size: 16px;
  font-weight: 900;
}

.operationStep small {
  margin-top: 3px;
  color: rgba(82, 101, 124, 0.55);
  font-size: 12px;
  font-weight: 700;
}

.app {
  width: min(1600px, calc(100vw - 18px));
  margin: 10px auto;
  padding: 0 10px;
}

.mockStage {
  --stage-pad-x: 28px;
  --left-col-w: 620px;
  --right-col-w: 0px;
  --col-gap: 0.5cm;
  --content-top: 54px;
  --stack-gap: 0.3cm;
  --status-h: 108px;
  --control-h: 90px;
  --tabs-h: 88px;
  --mid-left: calc(var(--stage-pad-x) + var(--left-col-w) + var(--col-gap));
  --mid-width: calc(100% - var(--stage-pad-x) - var(--mid-left) - var(--stage-pad-x));
  position: relative;
  width: 100%;
  height: 420px;
  border: 1px solid rgba(112, 128, 146, 0.28);
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-stage);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), var(--shadow-soft);
}

.overlay { position: absolute; }

.stageLabel {
  position: static;
  width: 90%;
  margin-top: 0.5cm;
  font-size: 12px;
  color: #7a8da4;
  text-align: left;
}

.stageBrand {
  position: absolute;
  left: var(--stage-pad-x);
  top: 20px;
  font-size: 18px;
  font-weight: 800;
  color: #26313d;
  line-height: 1.2;
}

.langToggle {
  right: 24px;
  top: 18px;
  width: 72px;
  height: 34px;
  border: 1px solid rgba(84, 97, 112, 0.55);
  border-radius: 999px;
  background: transparent;
  color: #3d4652;
  font-size: 13px;
  font-weight: 900;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.72),
    0 8px 18px rgba(68, 82, 101, 0.1);
  cursor: pointer;
}

.langToggle:active {
  transform: translateY(1px);
}

.keyboardTestBtn {
  right: 24px;
  top: 60px;
  min-width: 164px;
  height: 34px;
  padding: 0 15px;
  border: 1px solid rgba(65, 120, 192, 0.52);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #386da9;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(68, 82, 101, 0.1);
  cursor: pointer;
}

.keyboardTestBtn:hover {
  background: #fff;
  border-color: rgba(65, 120, 192, 0.78);
}

.keyboardTestBtn:active {
  transform: translateY(1px);
}

.tutorialTopBtn {
  right: 108px;
  top: 18px;
  min-width: 96px;
  height: 34px;
  padding: 0 16px;
  border: 1px solid rgba(65, 120, 192, 0.54);
  border-radius: 999px;
  background: linear-gradient(180deg, #73a8e8 0%, #4f8bd2 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.44),
    0 10px 20px rgba(65, 120, 192, 0.22);
  cursor: pointer;
}

.tutorialTopBtn:hover {
  filter: brightness(1.04);
}

.tutorialTopBtn:active {
  transform: translateY(1px);
}

.offlineTopBtn {
  right: 220px;
  top: 18px;
  min-width: 220px;
  max-width: 330px;
  height: 34px;
  padding: 0 16px;
  border: 1px solid rgba(65, 120, 192, 0.54);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #386da9;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 8px 18px rgba(68, 82, 101, 0.1);
  cursor: pointer;
}

.offlineTopBtn:hover {
  background: #fff;
  border-color: rgba(65, 120, 192, 0.78);
}

.offlineTopBtn:active {
  transform: translateY(1px);
}

.productSwitcher {
  display: none;
}

.productBtn {
  min-width: 84px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(84, 97, 112, 0.58);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.82);
}

.productBtn.active {
  background: linear-gradient(180deg, #76a6e3 0%, #5a90d6 100%);
  border-color: var(--accent-strong);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(157, 198, 246, 0.9);
}

.statusBlock {
  left: var(--stage-pad-x);
  top: var(--content-top);
  width: var(--left-col-w);
  height: 108px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: rgba(244, 249, 255, 0.46);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  gap: 10px;
  padding: 14px 18px;
}

.label1,
.label2,
.statusText,
.statusBlock .stageLabel {
  display: none !important;
}

.topControls {
  position: static;
  width: min(100%, 540px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: center;
  margin-top: 0;
  margin-bottom: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.writeNotice {
  display: none;
  min-height: 18px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #6e8098;
}
.writeNotice.show {
  display: block;
}
.writeNotice.ok {
  color: #228a4e;
}
.writeNotice.err {
  color: #c53d3d;
}

button, .fileLabel {
  border: 1px solid rgba(84, 97, 112, 0.62);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text-main);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.84);
}
button:disabled { opacity: .5; cursor: not-allowed; }
.fileLabel input { display: none; }

.ctlBtn {
  width: 100%;
  height: 42px;
  padding: 0;
  font-size: 16px;
  font-weight: 700;
  border-radius: 16px;
  position: relative;
  z-index: 1;
  transition: transform 0.22s cubic-bezier(.2, .8, .2, 1), border-color 0.22s ease, box-shadow 0.28s ease, filter 0.2s ease, background 0.2s ease;
}

.ctlBtn:not(:disabled):hover {
  z-index: 5;
  border-color: #4f92dd;
  background: #f3f8ff;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.94),
    0 0 0 5px rgba(85, 148, 221, 0.14),
    0 0 28px 9px rgba(65, 128, 207, 0.26),
    0 14px 26px rgba(48, 76, 111, 0.2);
  filter: brightness(1.04);
  transform: scale(1.045) translateY(-2px);
}

.ctlBtn:not(:disabled):active {
  transform: scale(1.015);
}

.ctlBtn.connectSuccess {
  animation: connectSuccessFlash 0.7s ease;
}

.ctlBtn.connectError {
  animation: connectErrorFlash 0.7s ease;
}

@keyframes connectSuccessFlash {
  0% {
    background: rgba(255, 255, 255, 0.86);
    border-color: rgba(84, 97, 112, 0.62);
    color: var(--text-main);
  }
  35% {
    background: #e6f8ed;
    border-color: #2f9b59;
    color: #1f7d47;
    box-shadow: 0 0 0 6px rgba(47, 155, 89, 0.12);
  }
  100% {
    background: rgba(255, 255, 255, 0.86);
    border-color: rgba(84, 97, 112, 0.62);
    color: var(--text-main);
  }
}

@keyframes connectErrorFlash {
  0% {
    background: rgba(255, 255, 255, 0.86);
    border-color: rgba(84, 97, 112, 0.62);
    color: var(--text-main);
  }
  35% {
    background: #fdeaea;
    border-color: #d35b5b;
    color: #b43c3c;
    box-shadow: 0 0 0 6px rgba(211, 91, 91, 0.12);
  }
  100% {
    background: rgba(255, 255, 255, 0.86);
    border-color: rgba(84, 97, 112, 0.62);
    color: var(--text-main);
  }
}

.keyTitle {
  display: none;
}

.keyButtons {
  --panel-pad-x: 14px;
  --panel-pad-y: 14px;
  left: calc(var(--mid-left) - 3cm);
  right: auto;
  top: 56px;
  width: var(--mid-width);
  min-height: 132px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px 16px;
  justify-items: center;
  align-items: start;
  justify-content: center;
  align-content: start;
  position: relative;
  isolation: isolate;
}

.keyButtons::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(var(--panel-pad-y) * -1);
  transform: translateX(-50%);
  width: calc(var(--panel-w, 100%) + (var(--panel-pad-x) * 2));
  height: calc(100% + (var(--panel-pad-y) * 2));
  z-index: -1;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0%, rgba(243, 248, 255, 0.14) 22%, rgba(220, 230, 242, 0.2) 100%);
  border: 1px solid rgba(132, 151, 175, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 14px 24px rgba(70, 87, 110, 0.08);
}

.keyButtons::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -56px;
  transform: translateX(-50%);
  width: 86px;
  height: 70px;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(245, 249, 254, 0.98) 0%, rgba(214, 224, 236, 0.96) 100%) center 0 / 16px 42px no-repeat,
    linear-gradient(180deg, rgba(245, 249, 254, 0.98) 0%, rgba(214, 224, 236, 0.96) 100%) center 26px / 76px 18px no-repeat;
  border-radius: 18px 18px 12px 12px;
  box-shadow:
    0 10px 18px rgba(68, 84, 104, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(120, 135, 153, 0.18);
  pointer-events: none;
}

.keyboardCableLabel {
  position: absolute;
  left: 50%;
  top: -34px;
  z-index: 3;
  transform: translateX(-50%);
  min-width: 56px;
  padding: 3px 7px;
  border: 1px solid rgba(91, 116, 146, 0.28);
  border-radius: 999px;
  background: rgba(248, 251, 255, 0.9);
  color: #526b89;
  box-shadow: 0 3px 8px rgba(68, 84, 104, 0.1);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

.downloadDeviceBtn {
  right: 78px;
  top: 226px;
  width: 126px;
  height: 126px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 2px solid rgba(63, 115, 179, 0.82);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 24%, rgba(255,255,255,0.42) 0%, rgba(255,255,255,0) 34%),
    linear-gradient(180deg, #76acec 0%, #4b8cd8 100%);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0.02em;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.36),
    inset 0 0 0 1px rgba(157,198,246,0.72),
    0 16px 30px rgba(65, 120, 192, 0.24),
    0 0 0 0 rgba(90, 144, 214, 0.35);
  cursor: pointer;
  animation: downloadPulse 1.7s ease-in-out infinite;
}

.downloadDeviceBtn::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.32);
  pointer-events: none;
}

.downloadDeviceBtn span {
  position: relative;
  z-index: 1;
}

.downloadDeviceBtn:disabled {
  border-color: rgba(112, 128, 146, 0.28);
  background: rgba(244, 249, 255, 0.45);
  color: rgba(61, 70, 82, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.42),
    0 10px 22px rgba(68, 82, 101, 0.08);
  cursor: not-allowed;
  animation: none;
}

.downloadDeviceBtn.isWriting {
  animation: downloadWorking 0.85s ease-in-out infinite;
}

.downloadDeviceBtn.isSuccess {
  border-color: rgba(42, 150, 83, 0.86);
  background:
    radial-gradient(circle at 32% 24%, rgba(255,255,255,0.42) 0%, rgba(255,255,255,0) 34%),
    linear-gradient(180deg, #5fcf8b 0%, #2f9b59 100%);
  animation: downloadSuccessPop 0.55s ease both;
}

.downloadDeviceBtn.isError {
  border-color: rgba(196, 68, 68, 0.86);
  background:
    radial-gradient(circle at 32% 24%, rgba(255,255,255,0.42) 0%, rgba(255,255,255,0) 34%),
    linear-gradient(180deg, #ee7b7b 0%, #c94444 100%);
  animation: downloadErrorShake 0.38s ease both;
}

.downloadDeviceBtn:not(:disabled):active {
  transform: scale(0.96);
}

@keyframes downloadWorking {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.04); filter: brightness(1.08); }
}

@keyframes downloadSuccessPop {
  0% { transform: scale(0.96); }
  55% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes downloadErrorShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

@keyframes downloadPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.36),
      inset 0 0 0 1px rgba(157,198,246,0.72),
      0 16px 30px rgba(65, 120, 192, 0.24),
      0 0 0 0 rgba(90, 144, 214, 0.3);
  }
  50% {
    transform: scale(1.07);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.36),
      inset 0 0 0 1px rgba(157,198,246,0.72),
      0 20px 38px rgba(65, 120, 192, 0.3),
      0 0 0 12px rgba(90, 144, 214, 0);
  }
}

.keyBtn {
  width: 56px;
  height: 56px;
  min-height: 56px;
  border: 1px solid rgba(84, 97, 112, 0.62);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  aspect-ratio: 1 / 1;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.84), 0 6px 16px rgba(67, 83, 101, 0.12);
  position: relative;
  z-index: 1;
  transition: transform 0.22s cubic-bezier(.2, .8, .2, 1), border-color 0.22s ease, box-shadow 0.28s ease, filter 0.22s ease;
}

.keyBtnTitle {
  display: block;
  font-size: 0.68em;
  font-weight: 800;
  opacity: 0.9;
}
.keyBtnValue {
  display: block;
  margin-top: 8px;
  font-size: 0.9em;
  font-weight: 800;
  opacity: 0.98;
  line-height: 1.15;
  max-width: 90%;
  overflow-wrap: anywhere;
}
.keyBtn.hasValue .keyBtnValue {
  margin-top: 0;
  font-size: 1.08em;
  max-width: 84%;
}
.keyBtn.active {
  background: linear-gradient(180deg, #79aae5 0%, #5a90d6 100%);
  color: #fff;
  border-color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(157, 198, 246, 0.9), 0 10px 20px rgba(65, 120, 192, 0.22);
}
.keyBtn:hover {
  animation: none;
  z-index: 10;
  border-color: #4f92dd;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.92),
    0 0 0 5px rgba(85, 148, 221, 0.14),
    0 0 28px 9px rgba(65, 128, 207, 0.28),
    0 18px 30px rgba(48, 76, 111, 0.24);
  filter: brightness(1.04);
  transform: scale(1.065) translateY(-3px);
}
.keyBtn.active:hover {
  box-shadow:
    inset 0 0 0 1px rgba(211, 232, 255, 1),
    0 0 0 5px rgba(85, 148, 221, 0.18),
    0 0 32px 11px rgba(65, 128, 207, 0.38),
    0 18px 32px rgba(48, 76, 111, 0.28);
}
.keyBtn:active {
  transform: scale(1.025);
}
.keyBtn.syncFlash {
  animation: keySyncFlash 0.65s ease;
}

@keyframes keySyncFlash {
  0% {
    transform: scale(1);
    box-shadow: inset 0 0 0 1px rgba(157, 198, 246, 0.9), 0 10px 20px rgba(65, 120, 192, 0.22);
  }
  35% {
    transform: scale(1.04);
    box-shadow: inset 0 0 0 1px rgba(196, 225, 255, 1), 0 0 0 7px rgba(116, 168, 239, 0.18), 0 12px 24px rgba(65, 120, 192, 0.28);
  }
  100% {
    transform: scale(1);
    box-shadow: inset 0 0 0 1px rgba(157, 198, 246, 0.9), 0 10px 20px rgba(65, 120, 192, 0.22);
  }
}

.keyButtons[data-count="1"] {
  --panel-w: 220px;
  min-height: 184px;
}

.keyButtons[data-count="1"]::before {
  width: calc(var(--panel-w) + (var(--panel-pad-x) * 2));
  height: calc(100% + (var(--panel-pad-y) * 2));
}

.keyButtons[data-count="1"] .keyBtn {
  width: 184px;
  height: 184px;
  min-height: 184px;
  font-size: 28px;
  border-radius: 16px;
}
.keyButtons[data-count="1"] .keyBtnValue {
  font-size: 0.7em;
}
.keyButtons[data-count="1"] .keyBtn.hasValue .keyBtnValue {
  font-size: 0.9em;
}

.keyButtons[data-count="2"] {
  --panel-w: calc(352px + 0.4cm);
  min-height: 176px;
  gap: 24px 0.4cm;
}

.keyButtons[data-count="2"] .keyBtn {
  width: 176px;
  height: 176px;
  min-height: 176px;
  font-size: 26px;
  border-radius: 16px;
}
.keyButtons[data-count="2"] .keyBtnValue {
  font-size: 0.68em;
}
.keyButtons[data-count="2"] .keyBtn.hasValue .keyBtnValue {
  font-size: 0.86em;
}

.keyButtons[data-count="3"] {
  --panel-w: calc(396px + 0.8cm);
  min-height: 132px;
  gap: 24px 0.4cm;
}

.keyButtons[data-count="3"] .keyBtn {
  width: 132px;
  height: 132px;
  min-height: 132px;
  font-size: 22px;
  border-radius: 14px;
}
.keyButtons[data-count="3"] .keyBtnValue,
.keyButtons[data-count="4"] .keyBtnValue,
.keyButtons[data-count="6"] .keyBtnValue,
.keyButtons[data-count="9"] .keyBtnValue,
.keyButtons[data-count="10"] .keyBtnValue {
  font-size: 0.62em;
}
.keyButtons[data-count="3"] .keyBtn.hasValue .keyBtnValue,
.keyButtons[data-count="4"] .keyBtn.hasValue .keyBtnValue,
.keyButtons[data-count="6"] .keyBtn.hasValue .keyBtnValue,
.keyButtons[data-count="9"] .keyBtn.hasValue .keyBtnValue,
.keyButtons[data-count="10"] .keyBtn.hasValue .keyBtnValue {
  font-size: 0.8em;
}

.keyButtons[data-count="4"] {
  --panel-w: calc(264px + 0.4cm);
  min-height: 288px;
  gap: 24px 0.4cm;
}

.keyButtons[data-count="4"] .keyBtn {
  width: 132px;
  height: 132px;
  min-height: 132px;
  font-size: 22px;
  border-radius: 14px;
}

.keyButtons[data-count="6"] {
  --panel-w: calc(336px + 0.8cm);
  min-height: 242px;
  gap: 18px 0.4cm;
}

.keyButtons[data-count="6"] .keyBtn {
  width: 112px;
  height: 112px;
  min-height: 112px;
  font-size: 18px;
  border-radius: 12px;
}

.keyButtons[data-count="9"] {
  --panel-w: calc(270px + 0.8cm);
  min-height: 298px;
  gap: 14px 0.4cm;
}

.keyButtons[data-count="9"] .keyBtn {
  width: 90px;
  height: 90px;
  min-height: 90px;
  font-size: 16px;
  border-radius: 10px;
}

.keyButtons[data-count="10"] {
  --panel-w: calc(390px + 1.6cm);
  min-height: 168px;
  gap: 12px 0.4cm;
}

.keyButtons[data-count="10"] .keyBtn {
  width: 78px;
  height: 78px;
  min-height: 78px;
  font-size: 14px;
  border-radius: 10px;
}

.modeTabs {
  left: var(--stage-pad-x);
  right: auto;
  top: calc(var(--content-top) + var(--status-h) + var(--stack-gap) + var(--control-h) + var(--stack-gap));
  width: var(--left-col-w);
  min-height: var(--tabs-h);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(244, 249, 255, 0.5);
  border: 1px solid rgba(119, 136, 155, 0.18);
  box-shadow: var(--shadow-soft);
}

.modeBtn {
  min-width: 0;
  width: 100%;
  height: 42px;
  border: 1px solid rgba(84, 97, 112, 0.62);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text-main);
  border-radius: 16px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.84);
  position: relative;
  z-index: 1;
  transition: transform 0.22s cubic-bezier(.2, .8, .2, 1), border-color 0.22s ease, box-shadow 0.28s ease, filter 0.2s ease, background 0.2s ease;
}

.modeBtn.active {
  border-color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(157, 198, 246, 0.9);
  background: linear-gradient(180deg, #f7fbff 0%, #e9f1fb 100%);
  color: var(--accent-strong);
}

.modeBtn:hover {
  z-index: 6;
  border-color: #4f92dd;
  background: #f5f9ff;
  box-shadow:
    inset 0 0 0 1px rgba(216, 235, 255, 0.96),
    0 0 0 4px rgba(85, 148, 221, 0.13),
    0 0 24px 8px rgba(65, 128, 207, 0.24),
    0 12px 22px rgba(48, 76, 111, 0.18);
  filter: brightness(1.04);
  transform: scale(1.055) translateY(-2px);
}

.modeBtn.active:hover {
  box-shadow:
    inset 0 0 0 1px rgba(216, 235, 255, 1),
    0 0 0 5px rgba(85, 148, 221, 0.16),
    0 0 28px 10px rgba(65, 128, 207, 0.3),
    0 14px 24px rgba(48, 76, 111, 0.2);
}

.modeBtn:active {
  transform: scale(1.02);
}

.configTitle {
  display: none;
}

.modeLabel {
  display: none;
}
.controlRow {
  left: var(--stage-pad-x);
  right: auto;
  top: calc(var(--content-top) + var(--status-h) + var(--stack-gap));
  width: var(--left-col-w);
  min-height: var(--control-h);
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) auto 96px auto auto 72px;
  align-items: center;
  column-gap: 12px;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(244, 249, 255, 0.5);
  border: 1px solid rgba(119, 136, 155, 0.18);
  box-shadow: var(--shadow-soft);
}
.stageModeRow {
  position: relative;
  width: 100%;
  margin-top: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #8198b6;
  font-weight: 700;
  white-space: nowrap;
}
.stageModeLabel {
  color: #8198b6;
  font-size: inherit;
  font-weight: inherit;
  white-space: nowrap;
}
.stageModeRow::before {
  content: none;
}
.stageModeRow select {
  width: 100%;
  min-width: 180px;
  height: 42px;
  border: 1px solid rgba(123, 143, 166, 0.42);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
}

.controlHelpTarget,
.actionHelpTarget {
  position: relative;
  display: block;
  box-sizing: content-box;
  padding-top: 13px;
}

.modeTabHelpTarget {
  position: relative;
  display: block;
  width: 100%;
}

.modeTabHelpTarget .inlineHelpBtn {
  top: -19px;
  right: 1px;
}

.modeSelectHelpTarget {
  flex: 1 1 auto;
  min-width: 180px;
}

.debounceHelpTarget {
  width: 96px;
}

.colorHelpTarget {
  width: 66px;
  height: 50px;
}

.inlineHelpBtn {
  position: absolute;
  top: -6px;
  right: 1px;
  z-index: 5;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid rgba(103, 117, 135, 0.52);
  border-radius: 50%;
  background-color: transparent !important;
  background-image: none !important;
  appearance: none;
  -webkit-appearance: none;
  color: #687584;
  font: 700 11px/16px system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: center;
  cursor: pointer;
  box-shadow: none;
  opacity: 0.76;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.inlineHelpBtn:hover {
  background-color: #f2f7fd !important;
  border-color: rgba(69, 126, 190, 0.72);
  color: #3977ba;
  opacity: 1;
}

.inlineHelpBtn:focus-visible {
  outline: 3px solid rgba(53, 132, 218, 0.4);
  outline-offset: 2px;
}

.inlineHelpBtn:active {
  background-color: #e7f0fa !important;
}

body.modal-open .inlineHelpBtn {
  visibility: hidden;
}

.debounceLabel {
  position: static;
  font-size: 14px;
  margin: 0;
  color: #8198b6;
  font-weight: 700;
  white-space: nowrap;
}

.debounceUnit {
  position: static;
  font-size: 14px;
  margin: 0;
  color: #8198b6;
  font-weight: 700;
  white-space: nowrap;
}
.debounceInput {
  position: static;
  width: 96px;
  height: 42px;
  border: 1px solid rgba(123, 143, 166, 0.42);
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.92);
  margin-top: 0;
}
.colorLabel {
  position: static;
  font-size: 14px;
  margin: 0;
  color: #8198b6;
  font-weight: 700;
  white-space: nowrap;
  align-self: center;
  justify-self: end;
}
.colorInput {
  position: static;
  width: 66px;
  height: 50px;
  border: 1px solid rgba(123, 143, 166, 0.46);
  border-radius: 12px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.92);
  margin-top: 0;
  align-self: center;
  justify-self: start;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.72),
    0 4px 10px rgba(63, 80, 101, 0.08);
  cursor: pointer;
}
.colorInput::-webkit-color-swatch-wrapper {
  padding: 0;
}
.colorInput::-webkit-color-swatch {
  border: 0;
  border-radius: 8px;
}

.colorOffHint {
  position: absolute;
  top: 66px;
  left: 50%;
  width: 96px;
  transform: translateX(-50%);
  color: #748ba8;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.colorOffHint.is-off {
  color: #b94c4c;
}

.colorInput.color-is-off {
  border-color: rgba(198, 72, 72, 0.78);
  box-shadow: 0 0 0 4px rgba(198, 72, 72, 0.12);
}

.lightSettings {
  display: none;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(180px, 1fr) auto minmax(120px, 0.48fr);
  align-items: center;
  column-gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(123, 143, 166, 0.18);
}

.mockStage.lighting-enabled {
  --control-h: 154px;
  height: 484px;
}

.mockStage.lighting-enabled .lightSettings {
  display: grid;
}

.lightEffectLabel,
.lightSpeedLabel {
  color: #8198b6;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.lightSettings select {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 38px 0 14px;
  border: 1px solid rgba(123, 143, 166, 0.38);
  border-radius: 12px;
  appearance: none;
  -webkit-appearance: none;
  color: #34475f;
  font: 700 14px system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    linear-gradient(45deg, transparent 50%, #71839a 50%) calc(100% - 17px) 17px / 5px 5px no-repeat,
    linear-gradient(135deg, #71839a 50%, transparent 50%) calc(100% - 12px) 17px / 5px 5px no-repeat,
    rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82), 0 4px 10px rgba(63, 80, 101, 0.06);
  cursor: pointer;
}

.lightSettings select:hover,
.lightSettings select:focus-visible {
  border-color: rgba(65, 120, 192, 0.8);
  box-shadow: 0 0 0 4px rgba(85, 148, 221, 0.12);
  outline: none;
}

.panel {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(122, 138, 156, 0.2);
  border-radius: 18px;
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.editorHead { display: none; }
.dataTools { display: flex; gap: 8px; margin-bottom: 6px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #4f6278; }
input, select, textarea {
  border: 1px solid rgba(123, 143, 166, 0.38);
  border-radius: 10px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.92);
}

.tabPage { display: none; margin-bottom: 4px; }
.tabPage.active { display: block; }
.pageTitle { font-size: 13px; color: #4f6278; margin-bottom: 8px; font-weight: 700; }
.pageTitleWithAction {
  display: flex;
  align-items: center;
  gap: 10px;
}
.actionHelpTarget {
  display: inline-block;
}
.kbdActionBtn {
  height: 34px;
  border: 2px solid #4a4d52;
  border-radius: 8px;
  background: #ecebea;
  color: #34383d;
  box-shadow: inset 0 0 0 2px #d7d6d5;
  font-size: 13px;
  font-weight: 700;
  padding: 0 12px;
  position: relative;
  z-index: 1;
  transition: transform 0.22s cubic-bezier(.2, .8, .2, 1), border-color 0.22s ease, box-shadow 0.28s ease, filter 0.2s ease, background 0.2s ease;
}

.kbdActionBtn:hover {
  z-index: 8;
  border-color: #4f92dd;
  background: #f5f9ff;
  box-shadow:
    inset 0 0 0 2px rgba(218, 237, 255, 0.96),
    0 0 0 5px rgba(85, 148, 221, 0.15),
    0 0 26px 9px rgba(65, 128, 207, 0.28),
    0 13px 24px rgba(48, 76, 111, 0.2);
  filter: brightness(1.04);
  transform: scale(1.06) translateY(-2px);
}

.kbdActionBtn:active {
  transform: scale(1.02);
}

.kbdWrap { display: grid; grid-template-columns: 1fr; gap: 4px; }
.kbdBoard {
  display: grid;
  grid-template-columns: max-content max-content max-content;
  gap: 10px;
  align-items: end;
  justify-content: flex-start;
  border: 1px solid #9ca3af;
  border-radius: 8px;
  background: #b8bcc2;
  padding: 10px;
}

#tabPageKeyboard .kbdBoard {
  --keyboard-rgb-hue: 0;
  animation: keyboardBoardAmbient 2.6s ease-in-out infinite, keyboardRgbHue 8s linear infinite;
}

@keyframes keyboardRgbHue {
  from { --keyboard-rgb-hue: 0; }
  to { --keyboard-rgb-hue: 360; }
}

@keyframes keyboardBoardAmbient {
  0%, 100% {
    border-color: hsl(var(--keyboard-rgb-hue) 88% 62% / 0.42);
    box-shadow:
      inset 0 0 16px hsl(var(--keyboard-rgb-hue) 88% 62% / 0.12),
      0 0 0 3px hsl(var(--keyboard-rgb-hue) 88% 62% / 0.08),
      0 0 18px 5px hsl(var(--keyboard-rgb-hue) 88% 62% / 0.16);
  }
  50% {
    border-color: hsl(var(--keyboard-rgb-hue) 88% 62% / 0.9);
    box-shadow:
      inset 0 0 28px hsl(var(--keyboard-rgb-hue) 88% 62% / 0.28),
      0 0 0 5px hsl(var(--keyboard-rgb-hue) 88% 62% / 0.16),
      0 0 34px 11px hsl(var(--keyboard-rgb-hue) 88% 62% / 0.36);
  }
}
.kbdLayout { padding: 0; }
.kbdLayout .kcap {
  width: 56px;
  min-width: 56px;
  height: 48px;
  font-size: 14px;
  padding: 0;
  position: relative;
  z-index: 2;
}
.kbdLayout .kcap.wide { width: 150px; min-width: 150px; }
.kbdLayout .kcap.space { width: 538px; min-width: 538px; }      /* 让 RCtrl 与 RShift 右边齐平 */
.kbdLayout .kcap.k-tab { width: 86px; min-width: 86px; }        /* 1.5u */
.kbdLayout .kcap.k-caps { width: 100px; min-width: 100px; }     /* 1.75u */
.kbdLayout .kcap.k-lshift { width: 128px; min-width: 128px; }   /* 2.25u */
.kbdLayout .kcap.k-backspace { width: calc(114px - 0.3cm); min-width: calc(114px - 0.3cm); }/* 2u */
.kbdLayout .kcap.k-enter { width: calc(128px - 0.2cm); min-width: calc(128px - 0.2cm); }    /* 2.25u */
.kbdLayout .kcap.k-rshift { width: 156px; min-width: 156px; }   /* 2.75u */
.kbdLayout .kcap.k-backslash { width: calc(86px - 0.3cm); min-width: calc(86px - 0.3cm); }  /* 1.5u */
.kbdRight .kcap,
.kbdNum .kcap {
  width: 58px;
  min-width: 58px;
  height: 48px;
  font-size: 14px;
  padding: 0;
}
.kbdRight { padding: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; height: 100%; }
.arrowPad { margin-top: 0; }
.kbdNum { padding: 0; display: flex; align-items: flex-end; }
.kbdBoard.apple-layout .kbdNum {
  display: none;
}
.kbdBoard.apple-layout .kbdRight .topNav,
.kbdBoard.apple-layout .kbdRight .navPad {
  display: none;
}
.kbdBoard.apple-layout .kcap.apple-hide {
  display: none !important;
}
.kbdBoard.apple-layout .kbdRight {
  justify-content: flex-end;
  align-self: end;
  margin-left: calc(-250px + 2.8cm);
  pointer-events: none;
  z-index: 1;
}
.kbdBoard.apple-layout .kbdLayout .kcap.space {
  width: 254px;
  min-width: 254px;
}
.kbdBoard.apple-layout .kbdLayout [data-mod="RAlt"],
.kbdBoard.apple-layout .kbdLayout [data-mod="RWin"] {
  width: 102px;
  min-width: 102px;
  font-size: 13px;
}
.kbdBoard.apple-layout .kbdLayout [data-mod="RCtrl"] {
  width: calc(124px - 0.8cm);
  min-width: calc(124px - 0.8cm);
}
.kbdBoard.apple-layout {
  grid-template-columns: max-content max-content;
  column-gap: 0;
}
.kbdBoard.apple-layout .arrowPad .kcap {
  height: 24px;
  min-height: 24px;
  width: 44px;
  min-width: 44px;
  pointer-events: auto;
}
.kbdBoard.apple-layout .arrowPad .blank {
  min-height: 24px;
  width: 44px;
  min-width: 44px;
}
.kbdBoard.apple-layout .arrowPad {
  grid-template-columns: repeat(3, 44px);
  gap: 3px;
}
.navPad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.topNav { margin-bottom: 4px; }
.arrowPad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.numpad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.numpad {
  grid-template-areas:
    "num div mul sub"
    "n7 n8 n9 add"
    "n4 n5 n6 add"
    "n1 n2 n3 enter"
    "n0 n0 dot enter";
}
.n-num { grid-area: num; }
.n-div { grid-area: div; }
.n-mul { grid-area: mul; }
.n-sub { grid-area: sub; }
.n-7 { grid-area: n7; }
.n-8 { grid-area: n8; }
.n-9 { grid-area: n9; }
.n-add { grid-area: add; }
.n-4 { grid-area: n4; }
.n-5 { grid-area: n5; }
.n-6 { grid-area: n6; }
.n-1 { grid-area: n1; }
.n-2 { grid-area: n2; }
.n-3 { grid-area: n3; }
.n-enter { grid-area: enter; }
.n-0 { grid-area: n0; }
.n-dot { grid-area: dot; }
.blank { min-height: 44px; }
.krow { display: flex; gap: 6px; margin-bottom: 4px; flex-wrap: nowrap; }
.fnrow .kcap:nth-child(1) { margin-right: 10px; }
.fnrow .kcap:nth-child(5) { margin-right: 16px; }
.fnrow .kcap:nth-child(9) { margin-right: 16px; }
.kcap {
  min-width: 34px;
  height: 44px;
  border: 2px solid #4a4d52;
  background: #ecebea;
  color: #34383d;
  border-radius: 6px;
  font-size: 12px;
  padding: 0 8px;
  box-shadow: inset 0 0 0 2px #d7d6d5;
  text-align: center;
  justify-content: center;
  align-items: center;
}

/* 键盘设置页灯效：颜色跟随顶部颜色选择器，字符串页不受影响。 */
#tabPageKeyboard .kbdBoard .kcap:not(.active) {
  animation: keyboardKeyBreath 2.6s ease-in-out infinite;
  transition: transform 0.2s cubic-bezier(.2, .8, .2, 1), filter 0.25s ease, box-shadow 0.25s ease, border-color 0.2s ease, background 0.2s ease;
}

@keyframes keyboardKeyBreath {
  0%, 100% {
    filter:
      drop-shadow(0 0 2px hsl(var(--keyboard-rgb-hue) 88% 62% / 0.28))
      drop-shadow(0 0 4px hsl(var(--keyboard-rgb-hue) 88% 62% / 0.16));
  }
  50% {
    filter:
      drop-shadow(0 0 5px hsl(var(--keyboard-rgb-hue) 88% 62% / 0.78))
      drop-shadow(0 0 12px hsl(var(--keyboard-rgb-hue) 88% 62% / 0.58));
  }
}

#tabPageKeyboard .kbdBoard .kcap:hover {
  animation: none;
  z-index: 20;
  border-color: hsl(var(--keyboard-rgb-hue) 88% 62%);
  background: linear-gradient(hsl(var(--keyboard-rgb-hue) 88% 62% / 0.2), hsl(var(--keyboard-rgb-hue) 88% 62% / 0.2)), #f8fbff;
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.72),
    0 0 0 4px hsl(var(--keyboard-rgb-hue) 88% 62% / 0.26),
    0 0 28px 11px hsl(var(--keyboard-rgb-hue) 88% 62% / 0.66),
    0 14px 24px rgba(37, 57, 82, 0.24);
  filter: none;
  transform: scale(1.14) translateY(-3px);
}

#tabPageKeyboard .kbdBoard .kcap:active {
  transform: scale(1.05);
}

@media (prefers-reduced-motion: reduce) {
  #tabPageKeyboard .kbdBoard,
  #tabPageKeyboard .kbdBoard .kcap:not(.active) {
    animation: none;
  }
}
.kcap.active { background: #4c8dd9; color: #fff; border-color: #3a73b5; }
.kcap.wide2 { min-width: 122px; grid-column: span 2; }
.kcap.tall { min-height: 66px; grid-row: span 2; }

.kcap.dark {
  background: #5a5c60;
  color: #d8d6ce;
  border-color: #2d2e31;
  box-shadow: inset 0 0 0 2px #4f5155;
}
/* 选中态优先级高于 dark，确保修饰键可见蓝色选中 */
.kcap.dark.active,
.kcap.active {
  background: #4c8dd9 !important;
  color: #ffffff !important;
  border-color: #3a73b5 !important;
  box-shadow: inset 0 0 0 2px #74a8ef !important;
}
.kbdLayout .kcap.duo {
  height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  line-height: 1;
}
.kbdLayout .kcap.duo .keyTop { font-size: 16px; }
.kbdLayout .kcap.duo .keySub { margin-top: 6px; font-size: 12px; opacity: 0.95; }
.numpad .kcap {
  height: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  line-height: 1;
}
.numpad .kcap.tall {
  min-height: 104px;
  justify-content: flex-start;
  padding-top: 10px;
}
.numpad .kcap.wide2 {
  width: 138px;
  min-width: 138px;
}
.numTop { font-size: 18px; }
.numSub { margin-top: 6px; font-size: 12px; opacity: 0.95; }
.numAccent { color: #f15a29; }
.numEnter { color: #89b14a; font-size: 16px; margin-top: 22px; }
.txt-accent-orange { color: #f39a32 !important; }
.txt-accent-green { color: #89b14a !important; }
.txt-accent-red { color: #ef6437 !important; }
.txt-accent-blue { color: #2d8cc6 !important; }

.kbdEditor { border: 1px solid #d7e0eb; border-radius: 8px; background: #fcfdff; padding: 8px; }
.miniTools { display: flex; gap: 8px; margin-bottom: 8px; }
.mouseGrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
#mouseRawPanel { display: none !important; }
.mousePanel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0 auto 12px;
  width: min(100%, 1120px);
  margin-left: auto;
  margin-right: auto;
  align-items: start;
}
.mouseGroup {
  border: 1px solid rgba(118, 134, 153, 0.42);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,0.34) 0%, rgba(255,255,255,0) 42%),
    linear-gradient(180deg, #c4cad2 0%, #adb5bf 100%);
  padding: 18px 22px 16px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.44),
    0 18px 34px rgba(68, 82, 101, 0.12);
  width: 100%;
  height: auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 360px minmax(440px, 1fr);
  grid-template-areas:
    "title title"
    "mouse controls"
    "vals vals";
  gap: 12px 28px;
  align-items: center;
}
.mouseGroupTitle {
  font-size: 14px;
  color: #5c7090;
  margin: 0;
  font-weight: 700;
  text-align: left;
  letter-spacing: 0.06em;
  grid-area: title;
}
.mouseBtnGrid {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 6px 0 2px;
}
.mouseBtnGridInline {
  grid-area: mouse;
  position: relative;
  display: block;
  width: 340px;
  height: 246px;
  min-height: 246px;
  max-height: 246px;
  margin: 0 auto;
  padding: 0;
  overflow: visible;
}
.mouseBtnGridInline::before {
  content: "";
  position: absolute;
  left: 70px;
  top: 14px;
  width: 200px;
  height: 218px;
  border: 4px solid rgba(108, 124, 145, 0.72);
  border-radius: 98px 98px 76px 76px / 118px 118px 88px 88px;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(255,255,255,0.96) 0%, rgba(255,255,255,0.56) 36%, rgba(255,255,255,0) 70%),
    linear-gradient(180deg, rgba(249, 252, 255, 0.92) 0%, rgba(230, 236, 244, 0.72) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.64),
    0 14px 22px rgba(63, 80, 101, 0.08);
}
.mouseBtnGridInline .mouseMouseSeam,
.mouseBtnGridInline .mouseWheelSlot {
  position: absolute;
  pointer-events: none;
}
.mouseBtnGridInline .mouseMouseSeam {
  left: 50%;
  top: 46px;
  transform: translateX(-50%);
  width: 2px;
  height: 82px;
  background: linear-gradient(180deg, rgba(98, 112, 130, 0), rgba(98, 112, 130, 0.42), rgba(98, 112, 130, 0));
  border-radius: 999px;
}
.mouseBtnGridInline::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 48px;
  transform: translateX(-50%);
  width: 24px;
  height: 54px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(180deg, rgba(106,122,144,0.42) 0 3px, transparent 3px 8px),
    linear-gradient(180deg, rgba(232,238,246,0.96), rgba(174,188,205,0.96));
  box-shadow:
    inset 0 0 0 2px rgba(98, 112, 130, 0.42),
    0 2px 5px rgba(67, 83, 101, 0.08);
}
.mouseMoveGrid {
  grid-area: controls;
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px 14px;
  max-width: none;
  margin: 0;
  grid-template-areas:
    ". up ."
    "left down right"
    "wheelp wheelm .";
  padding: 0;
}
.mouseBtn, .mouseMoveBtn {
  height: 54px;
  border: 2px solid #4a4d52;
  border-radius: 12px;
  background: #ecebea;
  color: #34383d;
  font-weight: 700;
  font-size: 20px;
  box-shadow: inset 0 0 0 2px #d7d6d5;
}
.mouseBtnGridInline .mouseBtn {
  position: absolute;
  top: 42px;
  width: 76px;
  height: 82px;
  border: 2px solid rgba(75, 82, 91, 0.86);
  border-radius: 42px 20px 30px 34px;
  font-size: 15px;
  line-height: 1.2;
  background: linear-gradient(180deg, rgba(252, 252, 251, 0.96), rgba(238, 238, 237, 0.94));
  box-shadow:
    inset 0 0 0 2px rgba(215, 214, 213, 0.82),
    0 4px 10px rgba(67, 83, 101, 0.08);
}
.mouseBtnGridInline .mouseBtn[data-mb="1"] {
  left: 86px;
  border-radius: 42px 20px 30px 36px;
}
.mouseBtnGridInline .mouseBtn[data-mb="2"] {
  left: 50%;
  top: 44px;
  transform: translateX(-50%);
  width: 24px;
  height: 58px;
  border-radius: 999px;
  font-size: 9px;
  padding: 0 3px;
  background: rgba(240, 244, 249, 0.95);
  box-shadow:
    inset 0 0 0 2px #d7d6d5,
    0 2px 8px rgba(67, 83, 101, 0.08);
  border: 2px solid #5c6672;
  z-index: 2;
}
.mouseBtnGridInline .mouseBtn[data-mb="4"] {
  right: 86px;
  border-radius: 20px 42px 36px 30px;
}
.mouseBtnGridInline .mouseBtn[data-mb="2"].active {
  transform: translateX(-50%);
  background: rgba(90, 144, 214, 0.22);
  box-shadow:
    inset 0 0 0 2px rgba(63,115,179,0.45),
    0 0 0 4px rgba(116,168,239,0.18);
}
.mouseMoveBtn {
  height: 48px;
  border-radius: 13px;
  font-size: 22px;
}
.mouseMoveGrid .mouseMoveBtn[data-axis="y"][data-val="-10"],
.mouseMoveGrid .mouseMoveBtn[data-axis="y"][data-val="10"],
.mouseMoveGrid .mouseMoveBtn[data-axis="x"][data-val="-10"],
.mouseMoveGrid .mouseMoveBtn[data-axis="x"][data-val="10"] {
  background: linear-gradient(180deg, #f7f7f6 0%, #e6e4e2 100%);
  box-shadow:
    inset 0 0 0 2px #d7d6d5,
    0 6px 12px rgba(67, 83, 101, 0.08);
}
.mouseMoveGrid .mouseMoveBtn[data-axis="w"][data-val="10"],
.mouseMoveGrid .mouseMoveBtn[data-axis="w"][data-val="-10"] {
  font-size: 18px;
}
.mouseMoveGrid::before {
  content: "";
  grid-area: down;
  place-self: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, rgba(255,255,255,0.46) 0%, rgba(214,220,228,0.18) 55%, rgba(150,160,173,0.08) 100%);
  z-index: 0;
  pointer-events: none;
}
.mouseMoveGrid .mouseMoveBtn {
  position: relative;
  z-index: 1;
}
.mouseBtn.active, .mouseMoveBtn.active {
  background: #5f95d6;
  color: #fff;
  border-color: #3f73b3;
  box-shadow: inset 0 0 0 2px #74a8ef;
}
.mouseVals {
  grid-area: vals;
  margin-top: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  color: #2f527c;
}
.mouseVals span {
  min-width: 74px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(244, 249, 255, 0.5);
  border: 1px solid rgba(119, 136, 155, 0.2);
}
.mouseControlItem {
  display: grid;
  gap: 6px;
  align-items: start;
}
.mouseControlItem label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #2f527c;
}
.mouseControlItem input {
  width: 100%;
  height: 36px;
  font-size: 15px;
}
.mouseControlItem.axis-up { grid-area: up; }
.mouseControlItem.axis-left { grid-area: left; }
.mouseControlItem.axis-down { grid-area: down; }
.mouseControlItem.axis-right { grid-area: right; }
.mouseControlItem.axis-wheel-up { grid-area: wheelp; }
.mouseControlItem.axis-wheel-down { grid-area: wheelm; }
.mouseControlItem .mouseMoveBtn {
  width: 100%;
}
#log {
  display: none !important;
}
.multiGrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.multiTools {
  display: grid;
  grid-template-columns: 180px 120px 120px 120px;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}
.multiKeyboardMount .kcap.pending-step {
  background: #5f95d6 !important;
  color: #fff !important;
  border-color: #3f73b3 !important;
  box-shadow: inset 0 0 0 2px #74a8ef !important;
}
.multiKeyboardMount .kcap.pending-mod {
  background: #8ab4ea !important;
  color: #fff !important;
  border-color: #4f82c3 !important;
  box-shadow: inset 0 0 0 2px #bfd7f7 !important;
}
.multiManual {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}
.multiList {
  min-height: 72px;
  border: 1px dashed #b7cbe4;
  border-radius: 8px;
  background: #f8fbff;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.multiList {
  min-height: 0;
  border: 0;
  background: transparent;
  padding: 2px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.multiChip {
  border: 1px solid #a9c1df;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: #2f527c;
  background: #fff;
}
.multiHint {
  margin-top: 6px;
  font-size: 12px;
  color: #607796;
}
.mediaGrid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.mediaBtn {
  height: 52px;
  border: 2px solid #4a4d52;
  border-radius: 8px;
  background: #ecebea;
  color: #34383d;
  box-shadow: inset 0 0 0 2px #d7d6d5;
  font-weight: 700;
  font-size: 20px;
}
.mediaBtn.active {
  background: #5f95d6;
  color: #fff;
  border-color: #3f73b3;
  box-shadow: inset 0 0 0 2px #74a8ef;
}
.editorGrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.globalRow { margin-top: 4px; }
.hiddenGlobal { display: none; }
.multiBottom {
  margin-top: 4px;
  border: 1px solid #d7e0eb;
  border-radius: 8px;
  background: #f8fbff;
  padding: 6px;
}
.multiKeyboardMount {
  margin-bottom: 10px;
}
.multiKeyboardMount .kbdWrap {
  gap: 6px;
}
.multiKeyboardMount .kbdBoard {
  justify-content: flex-start;
}
.tab-media #mediaRawPanel,
.tab-media #multiBottom {
  display: none !important;
}

#hexPreview { width: 100%; margin-top: 8px; font-family: ui-monospace, Menlo, monospace; }
#hexPreview { display: none; }
#log {
  margin: 6px 0 0;
  background: #0f1b2b;
  color: #c8e4ff;
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  max-height: 180px;
  overflow: auto;
}

@media (max-width: 1100px) {
  .mockStage {
    --stage-pad-x: 20px;
    --left-col-w: 460px;
    --right-col-w: 0px;
    --col-gap: 0.5cm;
    --status-h: 108px;
    --control-h: 90px;
    --tabs-h: 88px;
    height: 440px;
  }
  .productModalOptions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tutorialTopBtn { right: 96px; top: 14px; min-width: 86px; height: 32px; padding: 0 12px; font-size: 12px; }
  .offlineTopBtn { right: 190px; top: 14px; min-width: 170px; max-width: 240px; height: 32px; padding: 0 12px; font-size: 11px; }
  .langToggle { top: 14px; right: 18px; width: 66px; height: 32px; }
  .keyboardTestBtn { top: 54px; right: 18px; min-width: 154px; height: 32px; padding: 0 12px; font-size: 11px; }
  .videoTutorialCard { padding: 14px; }
  .videoTutorialHead strong { font-size: 20px; }
  .topControls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .productBtn { min-width: 42px; height: 24px; padding: 0 8px; font-size: 11px; }
  .keyButtons { top: 50px; }
  .modeTabs { left: var(--stage-pad-x); width: var(--left-col-w); gap: 8px; padding: 10px 12px; }
  .controlRow { left: var(--stage-pad-x); width: var(--left-col-w); grid-template-columns: minmax(0, 1.4fr) auto 84px auto auto 48px; column-gap: 8px; padding: 12px; }
  .stageModeRow { gap: 10px; font-size: 13px; }
  .stageModeRow select { min-width: 140px; }
  .debounceInput { width: 84px; }
  .colorLabel { top: auto; left: auto; }
  .colorInput { top: auto; left: auto; width: 50px; height: 40px; }
  .colorOffHint { top: 56px; font-size: 10px; }
  .mockStage.lighting-enabled { --control-h: 154px; height: 504px; }
  .lightSettings { grid-template-columns: auto minmax(140px, 1fr) auto minmax(100px, 0.55fr); column-gap: 8px; }
  .lightEffectLabel, .lightSpeedLabel { font-size: 12px; }
  .ctlBtn { width: 100%; font-size: 15px; }
  .kbdBoard { grid-template-columns: 1fr; }
  .editorGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mouseGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mousePanel { grid-template-columns: 1fr; }
  .mouseMoveGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mouseDirInputs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .multiGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .multiTools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .multiManual { grid-template-columns: 1fr; }
  .mediaGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .modeBtn { width: 100%; height: 40px; font-size: 12px; }
}
