/* CodingWand 魔杖管家 — 纯科技酷黑主题（阶段0 手写 CSS） */
:root {
  --bg: #0a0c10;
  --panel: #11141b;
  --panel-2: #171b24;
  --border: #1f2530;
  --text: #e6e8ec;
  --muted: #8a92a0;
  --accent: #2dd4bf; /* 科技青 */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body,
#root {
  height: 100%;
}

body {
  font-family: 'Segoe UI', 'Microsoft YaHei', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  overflow: hidden;
}

.root {
  display: flex;
  flex-direction: column;
  height: 100vh;
}
.app {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ── 左侧导航 ───────────────────────────────────────── */
.sidebar {
  width: 212px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 24px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  box-shadow: 0 0 14px rgba(62, 240, 160, 0.22);
}
.brand-mark svg {
  display: block;
}
.brand-name {
  font-size: 15px;
  font-weight: 600;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 9px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover {
  background: var(--panel-2);
  color: var(--text);
}
.nav-item.active {
  background: var(--panel-2);
  color: var(--text);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}

.sidebar-foot {
  margin-top: auto;
  padding: 10px 8px 2px;
  font-size: 11.5px;
  color: var(--muted);
  opacity: 0.7;
}

/* ── 右侧内容 ───────────────────────────────────────── */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;      /* 内容列水平居中——最大化时不再靠左堆、右边空一大片（2026-07-15 用户：只居中不加宽） */
  overflow-y: auto;         /* 滚动条落在窗口边，不在居中列里飘 */
  min-width: 0;
}
.page {
  width: 100%;
  max-width: 816px;         /* = 720 卡片 + 两侧 48 内边距：卡片保持原宽，超宽窗口时整列居中；默认窗口宽度够不到这个上限、视图不变 */
  padding: 44px 48px;
}
.page-title {
  font-size: 24px;
  font-weight: 700;
}
.page-desc {
  margin-top: 9px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;         /* 原 max-width:620 去掉——跟 720 卡片左右齐平（2026-07-15 用户：居中齐平） */
}
.page-stub {
  margin-top: 30px;
  padding: 46px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.page-stub-tag {
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.25);
}

/* ── 底部状态条 ─────────────────────────────────────── */
.statusbar {
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  font-size: 12.5px;
  color: var(--muted);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4b5563;
}
.dot.on {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.spacer {
  flex: 1;
}
.muted {
  color: var(--muted);
}

/* ── 改键页 ─────────────────────────────────────────── */
.keys-page {
  display: flex;
  flex-direction: column;
}
.keys-layout {
  display: flex;
  gap: 36px;
  margin-top: 26px;
}

/* 魔杖示意图 */
.wand-panel {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.wand-svg {
  width: 196px;
  height: 418px;
}
.wand-tip-text {
  font-size: 12.5px;
  color: var(--muted);
}
.ctrl {
  cursor: pointer;
}
.ctrl-face {
  fill: #222a36;
  stroke: #38465a;
  stroke-width: 1.5;
  transition: fill 0.12s, stroke 0.12s;
}
.ctrl-knob {
  fill: #3a4658;
  transition: fill 0.12s;
}
.ctrl-halo {
  fill: transparent;
  stroke: transparent;
  stroke-width: 2;
  transition: stroke 0.12s, fill 0.12s;
}
.ctrl-num {
  fill: #aeb6c2;
  font-size: 18px;
  font-weight: 700;
  text-anchor: middle;
  pointer-events: none;
}
.ctrl-name {
  fill: #aeb6c2;
  font-size: 14px;
  font-weight: 600;
  text-anchor: start;
  transition: fill 0.12s;
}
.ctrl:hover .ctrl-face {
  fill: #2b3543;
  stroke: #4a5b72;
}
.ctrl:hover .ctrl-knob {
  fill: #4a5870;
}
.ctrl.sel .ctrl-face {
  fill: #143b38;
  stroke: var(--accent);
}
.ctrl.sel .ctrl-knob {
  fill: var(--accent);
}
.ctrl.sel .ctrl-halo {
  stroke: var(--accent);
  fill: rgba(45, 212, 191, 0.08);
}
.ctrl.sel .ctrl-num {
  fill: #d8fbf4;
}
.ctrl:hover .ctrl-name {
  fill: #d8e2ee;
}
.ctrl.sel .ctrl-name {
  fill: var(--accent);
}

/* 编辑面板 */
.editor-col {
  flex: 1;
  min-width: 0;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.editor-panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
}
.editor-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.editor-title {
  font-size: 18px;
  font-weight: 700;
}
.editor-hint {
  font-size: 12.5px;
  color: var(--muted);
}
.bind-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}
.bind-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 11px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  text-align: left;
}
.bind-row.clickable {
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.bind-row.clickable:hover {
  border-color: #33506a;
  background: #1b2330;
}
.bind-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 60px;
}
.bind-label {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}
.bind-sub {
  font-size: 11.5px;
  color: var(--muted);
}
.bind-val {
  flex: 1;
  font-size: 14px;
  color: var(--accent);
}
.bind-edit {
  color: var(--muted);
  flex-shrink: 0;
}
.bind-row.clickable:hover .bind-edit {
  color: var(--text);
}
.editor-foot {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
  opacity: 0.8;
}

/* 底部操作 */
.keys-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.btn-ghost,
.btn-primary {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.12s;
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: #33506a;
}
.btn-primary {
  background: var(--accent);
  color: #04221d;
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:disabled {
  background: #1c2530;
  color: #5a6573;
  border-color: var(--border);
  cursor: not-allowed;
  font-weight: 500;
}

/* ── 选功能弹窗 ─────────────────────────────────────── */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 8, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal {
  width: 460px;
  max-width: calc(100vw - 60px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  padding: 22px;
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}
.tabs {
  display: flex;
  gap: 6px;
  background: var(--bg);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.tab {
  flex: 1;
  padding: 8px 6px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.tab:hover {
  color: var(--text);
}
.tab.on {
  background: var(--panel-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}
.modal-body {
  min-height: 124px;
  padding: 20px 2px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.cap-box {
  width: 100%;
  padding: 22px;
  border-radius: 12px;
  border: 1.5px dashed #3a4658;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.cap-box:hover {
  border-color: var(--accent);
}
.cap-box.capturing {
  border-color: var(--accent);
  border-style: solid;
  color: var(--accent);
  animation: capPulse 1s ease-in-out infinite;
}
@keyframes capPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(45, 212, 191, 0); }
}
.cap-hint {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}
.sticky-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.sticky-head {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.sticky-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 10px;
}
.sticky-mods {
  grid-template-columns: repeat(4, 1fr);
}
.sticky-dur {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.sticky-dur-label {
  font-size: 13px;
  color: var(--text);
}
.sticky-dur-note {
  font-size: 12px;
  color: var(--muted);
}
.macro-input {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.macro-input:focus {
  outline: none;
  border-color: var(--accent);
}
.opt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.opt {
  padding: 14px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.12s;
}
.opt:hover {
  border-color: #33506a;
}
.opt.on {
  border-color: var(--accent);
  background: #143b38;
  color: #d8fbf4;
}
.none-note {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.modal-preview {
  font-size: 13px;
  color: var(--muted);
}
.modal-preview b {
  color: var(--accent);
  font-weight: 600;
}
.modal-btns {
  display: flex;
  gap: 10px;
}

/* ── 就地展开编辑（手风琴） ─────────────────────────── */
.bind-chev {
  color: var(--muted);
  transition: transform 0.18s, color 0.12s;
  flex-shrink: 0;
}
.bind-acc.open .bind-chev {
  transform: rotate(180deg);
  color: var(--text);
}
.bind-acc.open .bind-row {
  background: #1b2330;
  border-color: #33506a;
  border-bottom-color: transparent;
  border-radius: 11px 11px 0 0;
}
.bind-editor {
  border: 1px solid #33506a;
  border-top: none;
  border-radius: 0 0 11px 11px;
  background: var(--panel-2);
  padding: 16px;
  overflow: hidden;
  animation: accDown 0.2s ease;
}
@keyframes accDown {
  from { transform: translateY(-5px); }
  to { transform: translateY(0); }
}
.inline-body {
  margin-top: 14px;
}
.none-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.opt.danger {
  flex: 0 0 auto;
  padding: 10px 20px;
  border-color: #5a3030;
  color: #e8a8a8;
  background: transparent;
}
.opt.danger:hover {
  border-color: #b3433a;
  background: rgba(179, 67, 58, 0.12);
}

/* ── 按键录制 / 鼠标点选 切换 + 屏幕键盘 ───────────────── */
.key-mode {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.key-mode-btn {
  flex: 1;
  padding: 9px 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.key-mode-btn:hover {
  color: var(--text);
}
.key-mode-btn.on {
  border-color: var(--accent);
  background: #143b38;
  color: #d8fbf4;
}
.osk-tip {
  margin-top: 0;
  margin-bottom: 8px;
}
.osk-preview {
  text-align: center;
  font-size: 15px;
  color: var(--accent);
  padding: 9px;
  margin-bottom: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 19px;
}
.osk {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.osk-row {
  display: flex;
  gap: 5px;
}
.osk-modrow {
  margin-bottom: 3px;
}
.osk-key {
  flex: 1 1 0;
  min-width: 0;
  padding: 9px 2px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.1s, background 0.1s, color 0.1s, box-shadow 0.3s;
}
.osk-key:hover {
  border-color: #33506a;
}
.osk-key.on {
  border-color: var(--accent);
  background: #143b38;
  color: #d8fbf4;
}
.osk-mod {
  font-weight: 600;
}
.osk-mod.on {
  border-color: var(--accent);
  background: var(--accent);
  color: #05201d;
}
/* 物理按键"正被按下"的高亮（2026-07-15 用户调）：瞬时亮起——.pressed 内 transition:none 取消淡入；
   松手后的淡出交给 .osk-key 基础过渡（box-shadow 0.3s 渐隐）。配色用偏蓝的天蓝青 #38bdf8，刻意避开
   主题/选中/应用的青绿 var(--accent)，一眼分清"此刻按的键(蓝)" vs "当前映射的键(绿)"。
   放在 .on 之后 → 同时按下+已选中时按下态视觉占先。 */
.osk-key.pressed {
  border-color: #38bdf8;
  background: #0e3654;
  color: #dcf1ff;
  box-shadow: 0 0 11px rgba(56, 189, 248, 0.6);
  transition: none;
}

/* ── 配置档切换条 ───────────────────────────────────── */
.profile-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}
.profile-bar-label {
  font-size: 12.5px;
  color: var(--muted);
  flex-shrink: 0;
}
.profile-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.profile-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 9px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.12s;
}
.profile-chip:hover {
  color: var(--text);
  border-color: #33506a;
}
.profile-chip.active {
  background: #143b38;
  border-color: var(--accent);
  color: #d8fbf4;
}
.chip-name {
  font-weight: 500;
}
.chip-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 2px;
}
.chip-btn {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  border-radius: 5px;
}
.chip-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}
.profile-rename-input {
  width: 84px;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 5px;
  color: var(--text);
  font-size: 13px;
  padding: 2px 6px;
  outline: none;
}
.profile-add {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 9px;
  background: transparent;
  border: 1px dashed #3a4658;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.12s;
}
.profile-add:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* ── 摇杆编辑 ───────────────────────────────────────── */
.joy-editor {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 18px;
}
.joy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.joy-row.col {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.joy-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.joy-label {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}
.joy-val {
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
}
.joy-hint {
  font-size: 12px;
  color: var(--muted);
}
.seg {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
}
.seg-btn {
  padding: 7px 18px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s;
}
.seg-btn:hover {
  color: var(--text);
}
.seg-btn.on {
  background: #143b38;
  color: #d8fbf4;
  box-shadow: inset 0 0 0 1px var(--accent);
}
/* 降噪浓度七档（2026-07-14）：语音页选择器（窄按钮防挤爆设置行） */
.dnmix-seg {
  flex-wrap: wrap;
}
.dnmix-seg .seg-btn {
  padding: 6px 8px;
  font-size: 12px;
}
.dnmix-seg .seg-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
/* 癸刀（2026-07-13）：改键页·长按触发时长选择行 */
.longms-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.longms-label {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.longms-row .seg-btn {
  padding: 6px 10px;
  font-size: 12px;
}
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: var(--panel-2);
  outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(45, 212, 191, 0.4);
}
.joy-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 8px 12px;
  cursor: pointer;
  outline: none;
}
.joy-select:focus {
  border-color: var(--accent);
}
.joy-press {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── 灯光页 ─────────────────────────────────────────── */
.light-preview {
  width: 196px;
  height: 418px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lp-wand {
  width: 76px;
  height: 360px;
  border-radius: 38px;
  background: linear-gradient(180deg, #1a1f29, #0f131a);
  border: 1.5px solid #283040;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
  gap: 30px;
}
.lp-tip {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #171b24;
}
.lp-led {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #171b24;
}
.lp-led.off,
.lp-tip.off {
  background: #171b24 !important;
  box-shadow: none !important;
}
.lp-led.fx-breathe,
.lp-tip.fx-breathe {
  animation: lpBreathe 4.8s ease-in-out infinite;
}
@keyframes lpBreathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.lp-led.fx-blink,
.lp-tip.fx-blink {
  animation: lpBlink 1.1s steps(1, end) infinite;
}
@keyframes lpBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.12; }
}
.lp-led.fx-flow,
.lp-tip.fx-flow {
  animation: lpFlow 9s linear infinite;
}
@keyframes lpFlow {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(360deg); }
}

.light-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.toggle {
  width: 46px;
  height: 26px;
  border-radius: 13px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.toggle.on {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #cbd2dc;
  transition: transform 0.15s;
}
.toggle.on .toggle-knob {
  transform: translateX(20px);
  background: #04221d;
}
.light-controls {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 22px;
  transition: opacity 0.15s;
}
.light-controls.disabled {
  opacity: 0.4;
  pointer-events: none;
}
.light-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.swatch {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s;
  padding: 0;
}
.swatch:hover {
  transform: scale(1.08);
}
.swatch.on {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--bg), 0 0 10px rgba(255, 255, 255, 0.3);
}
.swatch.custom {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px dashed rgba(255, 255, 255, 0.45);
}
.swatch.custom input[type='color'] {
  position: absolute;
  inset: -6px;
  width: 140%;
  height: 140%;
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0;
}
.effect-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/* 按钮内图标对齐 */
.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* ── 设备页 ─────────────────────────────────────────── */
.device-card {
  margin-top: 28px;
  max-width: 720px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
}
.device-status {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.device-mark {
  flex-shrink: 0;
}
.device-meta {
  flex: 1;
  min-width: 0;
}
.device-name {
  font-size: 18px;
  font-weight: 700;
}
.device-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.device-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 24px;
}
.device-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.device-stat-icon {
  color: var(--muted);
  flex-shrink: 0;
}
.device-stat-label {
  font-size: 12px;
  color: var(--muted);
}
.device-stat-value {
  font-size: 16px;
  font-weight: 600;
  margin-top: 2px;
}
.device-note {
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(45, 212, 191, 0.05);
  border: 1px solid rgba(45, 212, 191, 0.15);
}

/* ── 设置页 ─────────────────────────────────────────── */
.settings-list {
  margin-top: 26px;
  max-width: 720px;      /* 与 .mic-card 对齐（原 680 比卡片窄 40px，右边缘不齐） */
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* 待机时长页：三个时长下拉统一定宽对齐（默认随选项文字自适应，长短不一——2026-07-10 用户点名） */
.standby-list .joy-select {
  width: 118px;
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
}
.settings-icon {
  color: var(--muted);
  flex-shrink: 0;
}
.settings-text {
  flex: 1;
  min-width: 0;
}
.settings-title {
  font-size: 15px;
  font-weight: 600;
}
.settings-sub {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
}
.settings-action {
  flex-shrink: 0;
}
.settings-val {
  font-size: 13px;
  color: var(--muted);
}
.settings-soon {
  font-size: 12px;
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.25);
}

/* ── 配置档管理页 ───────────────────────────────────── */
.profile-grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  max-width: 760px;
}
.profile-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  min-height: 132px;
}
.profile-card.active {
  border-color: var(--accent);
  background: #102b29;
}
.pc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pc-name {
  font-size: 16px;
  font-weight: 700;
}
.pc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: #04221d;
  background: var(--accent);
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
}
.pc-sub {
  font-size: 12.5px;
  color: var(--muted);
  flex: 1;
}
.pc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btn-ghost.sm {
  padding: 6px 11px;
  font-size: 12.5px;
}
/* 魔杖昵称（浅层版）：改名入口 + 行内输入框 */
.nick-edit {
  background: transparent;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;               /* 铅笔与"修改魔杖名称"文字组成一个整体（2026-07-11 用户定稿） */
}
.nick-edit:hover .nick-cta {
  text-decoration: underline;
}
.nick-edit:hover {
  color: var(--accent);
}
.nick-cta {
  font-size: 12px;
  color: var(--accent);
  opacity: 0.85;
}
.nick-input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 14px;
  padding: 4px 9px;
  outline: none;
  width: 180px;
}
.nick-input:focus {
  border-color: var(--accent);
}

/* ── 设备档案（2026-07-10）：寻找面板 + 搜索列表 + 我的魔杖名单 ── */
.wand-find-panel {
  margin-top: 14px;
  max-width: 720px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.wand-find-msg {
  font-size: 13px;
  color: var(--muted);
}
.wand-scan-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wand-scan-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s;
}
.wand-scan-item:hover {
  border-color: var(--accent);
}
.wand-scan-name {
  font-size: 13.5px;
  font-weight: 600;
}
.wand-scan-addr {
  flex: 1;
  font-size: 11px;
  color: var(--muted);
}
.wand-scan-go {
  font-size: 12px;
  color: var(--accent);
}
.wand-roster {
  margin-top: 16px;
  max-width: 720px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
}
.wand-roster-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
.wand-roster-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-top: 1px solid var(--border);
}
.wand-roster-icon {
  color: var(--muted);
}
.wand-roster-row.online .wand-roster-icon {
  color: var(--accent);
}
.wand-roster-name {
  font-size: 14px;
  font-weight: 600;
}
.wand-roster-sub {
  flex: 1;
  font-size: 11.5px;
  color: var(--muted);
}
.wand-roster-row.online .wand-roster-sub {
  color: var(--accent);
}
/* 电量标签（2026-07-15）：固定顺序[图标][%]、右侧对齐一列——充电绿⚡/正常🔋/上次灰 */
.wand-roster-bat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 58px;
  justify-content: flex-end;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
}
.wand-roster-bat.chg { color: #3ef0a0; }
.wand-roster-bat.stale { color: var(--muted); opacity: 0.75; }
.wand-roster-del {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
}
.wand-roster-del:hover {
  color: #ff6b6b;
}

/* 重启魔杖按钮的转圈图标（F5） */
.spin {
  animation: cw-spin 1s linear infinite;
}
@keyframes cw-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.btn-ghost.sm.danger {
  color: #e8a8a8;
  border-color: #5a3030;
}
.btn-ghost.sm.danger:hover {
  border-color: #b3433a;
  background: rgba(179, 67, 58, 0.12);
  color: #f0bcbc;
}
.profile-card.add {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  color: var(--muted);
  border-style: dashed;
  background: transparent;
  font-size: 14px;
  transition: all 0.12s;
}
.profile-card.add:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* ── 自绘暗色标题栏 ─────────────────────────────────── */
.titlebar {
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, #0c1813 0%, #07090c 100%);
  border-bottom: 1px solid rgba(45, 212, 191, 0.16);
  box-shadow: 0 1px 14px rgba(45, 212, 191, 0.05);
  -webkit-app-region: drag;
  user-select: none;
  animation: tbGlow 6s ease-in-out infinite;
}
@keyframes tbGlow {
  0%, 100% {
    border-bottom-color: rgba(45, 212, 191, 0.12);
    box-shadow: 0 1px 12px rgba(45, 212, 191, 0.04);
  }
  50% {
    border-bottom-color: rgba(45, 212, 191, 0.28);
    box-shadow: 0 2px 20px rgba(45, 212, 191, 0.1);
  }
}
.tb-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 13px;
}
.tb-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
  text-shadow: 0 0 10px rgba(45, 212, 191, 0.3);
}
.tb-spacer {
  flex: 1;
}
/* 标题栏常驻麦克风指示器：切到任何页面都能看到 引擎/连接/电平/电量 */
.tb-mic {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 100%;
  padding: 0 12px;
  -webkit-app-region: no-drag;
  cursor: default;
}
.tb-mic-icon.on   { color: var(--accent); }
.tb-mic-icon.scan { color: #e0b341; }
.tb-mic-icon.off  { color: #55606b; }
.tb-mic-meter {
  width: 34px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.tb-mic-meter > span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.1s linear;
}
.tb-mic-bat {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tb-controls {
  display: flex;
  height: 100%;
  -webkit-app-region: no-drag;
}
.tb-btn {
  width: 46px;
  height: 38px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.tb-btn:hover {
  background: rgba(45, 212, 191, 0.14);
  color: var(--accent);
}
.tb-btn.close:hover {
  background: #c0392b;
  color: #fff;
}

/* ── 暗色滚动条（幽绿微调） ─────────────────────────── */
::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #1c2430;
  border-radius: 6px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: #2c5249;
}
::-webkit-scrollbar-corner {
  background: transparent;
}

/* ── 色盘 ───────────────────────────────────────────── */
.color-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 4px;
}
.color-wheel {
  position: relative;
  border-radius: 50%;
  cursor: crosshair;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px var(--border), 0 6px 20px rgba(0, 0, 0, 0.4);
}
.cw-hue {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 90deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
}
.cw-sat {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  /* 白心收紧到 58%，让圆盘大部分都是饱满鲜色（不再大片发白） */
  background: radial-gradient(circle at center, #ffffff 0%, rgba(255, 255, 255, 0) 58%);
}
.cw-handle {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.color-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.color-current {
  display: flex;
  align-items: center;
  gap: 10px;
}
.color-chip {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}
.color-hex {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-family: 'Consolas', monospace;
  letter-spacing: 0.5px;
}

/* 摇杆四方向动作 */
.joy-dirs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.joy-dirs .joy-hint {
  margin-bottom: 4px;
}

/* 响应效果预览（偶尔闪一下示意"按键才亮"） */
.lp-led.fx-react,
.lp-tip.fx-react {
  animation: lpReact 2.6s ease-out infinite;
}
@keyframes lpReact {
  0% { opacity: 1; }
  14% { opacity: 0.16; }
  100% { opacity: 0.16; }
}
.effect-hint {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

/* 响应层预览：平时暗、触发时一闪（错开 = 波纹/整体流光） */
.lp-led.rx,
.lp-tip.rx {
  animation: lpRx 2.8s ease-out infinite;
}
@keyframes lpRx {
  0% { opacity: 0.14; }
  5% { opacity: 1; }
  24% { opacity: 0.14; }
  100% { opacity: 0.14; }
}

/* 预览叠层：自动层(底) + 响应层(上)同时跑，和实机一致（两层叠加） */
.lp-led-wrap { position: relative; width: 30px; height: 30px; flex-shrink: 0; }
.lp-tip-wrap { position: relative; width: 16px; height: 16px; flex-shrink: 0; }
.lp-led-wrap > span,
.lp-tip-wrap > span { position: absolute; inset: 0; width: 100%; height: 100%; }
.lp-rx-layer { mix-blend-mode: screen; } /* 响应闪光叠加在氛围灯之上 = 更亮的爆闪 */

/* 长按多档 */
.holds {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.holds-title {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}
.hold-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
}
.hold-dur {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 12.5px;
  padding: 5px 8px;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
}
.hold-dur:focus {
  border-color: var(--accent);
}
.hold-toggle {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  min-width: 0;
  padding: 4px 0;
}
.hold-remove {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}
.hold-remove:hover {
  color: #e8a8a8;
  background: rgba(179, 67, 58, 0.12);
}
.add-hold {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 8px 14px;
  border-radius: 9px;
  background: transparent;
  border: 1px dashed #3a4658;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.12s;
}
.add-hold:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* ── 麦克风页 ───────────────────────────────────────── */
.mic-card {
  margin-top: 28px;
  max-width: 720px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
}

/* 收音增强（增益）滑块 */
.mic-gain {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}
.mic-gain-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13.5px;
  font-weight: 600;
}
.mic-gain-val {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}
.mic-gain-slider {
  width: 100%;
  margin: 10px 0 6px;
  accent-color: var(--accent);
  cursor: pointer;
}
.mic-gain-slider:disabled { opacity: 0.4; cursor: not-allowed; }
.mic-gain-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* 三段状态流：魔杖 — 引擎 — 系统麦 */
.mic-flow {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 6px 0 4px;
}
.mic-seg {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}
.mic-seg-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #4b5563;
  transition: background 0.2s, box-shadow 0.2s;
}
.mic-seg-dot.green {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.mic-seg-dot.amber {
  background: #f0b429;
  box-shadow: 0 0 10px rgba(240, 180, 41, 0.7);
  animation: micPulse 1.1s ease-in-out infinite;
}
.mic-seg-dot.red {
  background: #e5533c;
  box-shadow: 0 0 10px rgba(229, 83, 60, 0.7);
}
@keyframes micPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.mic-seg-name {
  font-size: 13.5px;
  font-weight: 600;
}
.mic-seg-state {
  font-size: 12px;
  color: var(--muted);
}
.mic-flow-line {
  flex: 0 0 26px;
  height: 2px;
  margin-top: 6px;
  background: var(--border);
  border-radius: 1px;
}

/* 电平条 */
.mic-meter {
  margin-top: 26px;
  height: 14px;
  border-radius: 7px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.mic-meter-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), #6ee7b7 55%, #f0b429 85%, #e5533c);
  transition: width 0.08s linear;
}
.mic-meter-label {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

/* 主开关 */
.mic-main {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
/* 主开关独立卡片（蓝牙语音模式页顶）：.mic-main 的"区块分隔"间距在独立卡片里成了
   纯空白框（2026-07-10 用户点名）——卡内清零、卡片本身也上提贴顶。 */
.mic-main-card {
  margin-top: 0;
}
.mic-main-card .mic-main {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.mic-main-text {
  flex: 1;
  min-width: 0;
}
.mic-main-title {
  font-size: 16px;
  font-weight: 700;
}
.mic-main-sub {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
}
.mic-switch {
  width: 60px;
  height: 32px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.mic-switch.on {
  background: var(--accent);
  border-color: var(--accent);
}
.mic-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #cbd2dc;
  transition: transform 0.15s;
}
.mic-switch.on .mic-switch-knob {
  transform: translateX(28px);
  background: #04221d;
}
/* 小号开关（设置行内用，直连页芯片降噪开关） */
.mic-switch.sm { width: 46px; height: 26px; border-radius: 13px; }
.mic-switch.sm .mic-switch-knob { width: 20px; height: 20px; }
.mic-switch.sm.on .mic-switch-knob { transform: translateX(20px); }
.mic-switch:disabled { opacity: 0.45; cursor: not-allowed; }

/* 重启按钮的旋转图标 */
.spin { animation: cw-spin 1s linear infinite; }
@keyframes cw-spin { to { transform: rotate(360deg); } }
