:root {
  --bg-dark: #06070c;
  --panel-bg: rgba(14, 17, 29, 0.72);
  --panel-border: rgba(255, 255, 255, 0.11);
  --panel-highlight: rgba(0, 240, 255, 0.25);
  --cyan: #00f0ff;
  --magenta: #ff2a85;
  --violet: #8a2be2;
  --emerald: #00ff9d;
  --amber: #ffb800;
  --text-main: #f0f4fc;
  --text-muted: #8b95b0;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
}

/* 主全螢幕視覺畫布 */
#fx-canvas {
  position: fixed;
   inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  cursor: crosshair;
  touch-action: none;
}

/* 毛玻璃面板通用樣式 */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--panel-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

/* 頂部導覽列 */
.topbar {
  position: fixed;
  top: 12px;
  left: 16px;
  right: 16px;
  height: 54px;
  border-radius: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  text-decoration: none;
}

.brand:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.brand-text-col {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-affiliation {
  font-size: 9.5px;
  color: var(--cyan);
  opacity: 0.85;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.official-ilab-logo-wrap {
  background: #ffffff;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 10px rgba(0, 243, 255, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  flex-shrink: 0;
}

.official-ilab-logo-wrap:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 16px rgba(0, 243, 255, 0.4);
}

.official-ilab-logo-img {
  height: 24px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  display: block;
}

.official-ilab-logo-wrap.large {
  height: 44px;
  padding: 4px 12px;
  border-radius: 8px;
}

.official-ilab-logo-img.large {
  height: 34px;
  max-width: 160px;
}

.official-banner-box {
  background: #ffffff;
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0 14px 0;
  border: 1px solid rgba(0, 243, 255, 0.3);
}

.official-banner-box.in-modal {
  margin: 12px 0 16px 0;
}

.official-banner-img {
  width: 100%;
  max-height: 120px;
  object-fit: contain;
  display: block;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.25); opacity: 1; box-shadow: 0 0 20px var(--cyan); }
}

.brand-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #fff, var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge {
  background: rgba(0, 240, 255, 0.14);
  color: var(--cyan);
  border: 1px solid rgba(0, 240, 255, 0.35);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
}

/* 音源模式切換器 */
.source-selector {
  display: flex;
  background: rgba(0, 0, 0, 0.45);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 4px;
}

.source-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 7px 14px;
  border-radius: 7px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.source-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.source-btn.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.22), rgba(138, 43, 226, 0.28));
  color: #fff;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
  border: 1px solid rgba(0, 240, 255, 0.4);
}

/* 右上角工具按鈕 */
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
}

.action-btn.icon-only {
  padding: 7px 9px;
}

.action-btn.primary-glow {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan);
  color: var(--cyan);
}

.action-btn.primary-glow.running {
  background: rgba(0, 255, 157, 0.18);
  border-color: var(--emerald);
  color: var(--emerald);
  box-shadow: 0 0 18px rgba(0, 255, 157, 0.28);
}

#btn-hold.active {
  background: rgba(255, 184, 0, 0.2);
  border-color: var(--amber);
  color: var(--amber);
  box-shadow: 0 0 14px rgba(255, 184, 0, 0.3);
}

.qrcode-btn {
  background: rgba(0, 243, 255, 0.08);
  border-color: rgba(0, 243, 255, 0.35);
  color: var(--cyan);
}

.qrcode-btn:hover {
  background: rgba(0, 243, 255, 0.2);
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(0, 243, 255, 0.35);
}

.record-btn .rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--magenta);
}

.record-btn .rec-dot.audio-dot {
  background: var(--amber);
}

.record-btn.recording {
  background: rgba(255, 42, 133, 0.22);
  border-color: var(--magenta);
  color: #fff;
  animation: recBlink 1s infinite alternate;
}

.record-btn.audio-rec-btn.recording {
  background: rgba(255, 184, 0, 0.24);
  border-color: var(--amber);
}

/* 自動演化控制子區塊 (REplay Mode) */
.automation-subbox {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0, 240, 255, 0.22);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.subbox-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.6px;
}

.ramp-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-top: 2px;
}

/* 自動演化範圍設定列 */
.range-grid {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  align-items: center;
  gap: 6px 8px;
}

.range-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.range-sep {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.range-input {
  width: 100%;
  min-width: 0;
  background: rgba(8, 11, 20, 0.92);
  color: var(--cyan);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 4px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.range-input:focus {
  border-color: var(--cyan);
}

.range-reset {
  grid-column: 3 / 5;
}

@keyframes recBlink {
  from { box-shadow: 0 0 6px rgba(255, 42, 133, 0.3); }
  to { box-shadow: 0 0 18px rgba(255, 42, 133, 0.8); }
}

/* 中央 HUD 讀數與提示 */
.xy-hud {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.hud-Readout {
  display: flex;
  gap: 16px;
  background: rgba(8, 10, 18, 0.78);
  backdrop-filter: blur(10px);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.hud-Readout strong {
  color: var(--cyan);
}

.hud-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(0, 0, 0, 0.45);
  padding: 4px 12px;
  border-radius: 12px;
  transition: opacity 0.4s ease;
}

/* 左右工作區面板容器 */
.workspace {
  position: fixed;
  top: 78px;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.workspace.ui-hidden,
.workspace.ui-hidden * {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.98);
  pointer-events: none !important;
}

.side-panel {
  width: 365px;
  max-height: 100%;
  overflow-y: auto;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  pointer-events: auto;
}

.side-panel::-webkit-scrollbar {
  width: 5px;
}

.side-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 4px;
}

.panel-section {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding-bottom: 7px;
}

.section-header h2 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--cyan);
}

.status-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 255, 157, 0.14);
  color: var(--emerald);
  border: 1px solid rgba(0, 255, 157, 0.3);
}

.mini-btn {
  background: rgba(0, 240, 255, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.18s;
}

.mini-btn:hover {
  background: rgba(0, 240, 255, 0.25);
}

/* 訊號源子面板 */
.source-pane {
  display: none;
  flex-direction: column;
  gap: 8px;
}

.source-pane.active {
  display: flex;
}

.preset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.preset-row label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.cyber-select {
  width: 100%;
  background: rgba(10, 14, 24, 0.9);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: var(--font-sans);
  outline: none;
  cursor: pointer;
}

.cyber-select:focus {
  border-color: var(--cyan);
}

.file-drop-zone {
  border: 1px dashed rgba(0, 240, 255, 0.4);
  background: rgba(0, 240, 255, 0.04);
  border-radius: 9px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  color: var(--cyan);
  font-size: 12px;
  transition: all 0.2s;
}

.file-drop-zone:hover, .file-drop-zone.dragover {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--cyan);
}

/* 麥克風控制 */
.mic-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cyber-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.16), rgba(138, 43, 226, 0.22));
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.cyber-btn:hover {
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
}

.cyber-btn.active {
  background: linear-gradient(135deg, rgba(255, 42, 133, 0.3), rgba(255, 184, 0, 0.25));
  border-color: var(--magenta);
}

.mic-meter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.mic-meter-bar {
  flex: 1;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.mic-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--emerald), var(--cyan), var(--magenta));
  transition: width 0.06s linear;
}

.helper-text {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
}

/* 波形顯示器 */
.waveform-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#waveform-canvas {
  width: 100%;
  height: 82px;
  background: rgba(4, 6, 12, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: ew-resize;
}

.waveform-caption {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
}

/* 雙欄控制項網格 */
.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.control-item.full-width {
  grid-column: 1 / -1;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}

.header-btn-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.label-right-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.param-auto-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 5;
  transition: all 0.15s ease;
}

.param-auto-btn:hover {
  background: rgba(0, 240, 255, 0.18);
  border-color: var(--cyan);
  color: #fff;
}

.param-auto-btn.active {
  background: rgba(255, 184, 0, 0.28);
  color: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 0 10px rgba(255, 184, 0, 0.45);
}

.control-item label {
  font-size: 11px;
  color: var(--text-muted);
}

.val-readout {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
}

/* 自訂滑桿樣式 */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  border: 2px solid #fff;
  transition: transform 0.12s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* 視覺特效模式四宮格 */
.visual-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.vmode-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}

.vmode-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.09);
}

.vmode-btn.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan);
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.vmode-icon {
  color: var(--cyan);
  font-size: 14px;
}

/* 頻譜儀與場景快選 */
.scope-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scope-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

#spectrum-canvas {
  width: 100%;
  height: 78px;
  background: rgba(4, 6, 12, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.scene-presets {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preset-label {
  font-size: 11px;
  color: var(--text-muted);
}

.preset-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.pill-btn {
  padding: 6px 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.18s;
}

.pill-btn:hover, .pill-btn.active {
  background: rgba(138, 43, 226, 0.28);
  border-color: #b469ff;
  color: #fff;
}

/* 底部懸浮展開/收合參數面板按鈕 (FAB) */
.mobile-ui-fab {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 35;
  display: none;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 24px;
  border: 1px solid rgba(0, 240, 255, 0.55);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.65), 0 0 15px rgba(0, 240, 255, 0.25);
  transition: all 0.2s ease;
}

.mobile-ui-fab:hover, .mobile-ui-fab:active {
  background: rgba(0, 240, 255, 0.22);
  transform: scale(1.04);
}

/* ==========================================
   04 關於 Ilab 實驗室與雙 QR Code 展演樣式
   ========================================== */
.ilab-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(10, 14, 26, 0.75);
  border: 1px solid rgba(0, 243, 255, 0.2);
  border-radius: 12px;
  padding: 14px;
}

.ilab-card-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.ilab-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ilab-emblem-large {
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(0, 243, 255, 0.5));
}

.ilab-title-lg {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.ilab-subtitle-en {
  font-size: 10px;
  color: var(--cyan);
  opacity: 0.85;
}

.ilab-author-tag {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 10px;
}

.affiliation-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 4px;
}

.prof-badge {
  background: rgba(0, 243, 255, 0.1);
  border: 1px solid rgba(0, 243, 255, 0.3);
  color: var(--cyan);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.ilab-desc {
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}

.ilab-desc strong {
  color: #ffffff;
}

/* 雙 QR Code 展演網格 */
.qr-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.qr-card {
  background: rgba(7, 10, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.qr-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 243, 255, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(0, 243, 255, 0.15);
}

.qr-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.qr-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.studio-badge {
  background: rgba(0, 243, 255, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(0, 243, 255, 0.4);
}

.blog-badge {
  background: rgba(255, 42, 133, 0.15);
  color: var(--pink);
  border: 1px solid rgba(255, 42, 133, 0.4);
}

.app-badge {
  background: rgba(0, 255, 157, 0.15);
  color: #00ff9d;
  border: 1px solid rgba(0, 255, 157, 0.4);
}

.qr-img-box {
  background: #ffffff;
  padding: 8px;
  border-radius: 8px;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.qr-code-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.qr-url-text {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--cyan);
  word-break: break-all;
  line-height: 1.35;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
}

.qr-actions {
  display: flex;
  gap: 6px;
  width: 100%;
  justify-content: center;
}

.qr-link-btn {
  text-decoration: none;
  background: rgba(0, 243, 255, 0.12);
  border: 1px solid rgba(0, 243, 255, 0.35);
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qr-link-btn:hover {
  background: rgba(0, 243, 255, 0.25);
  border-color: var(--cyan);
}

.btn-copy-url {
  cursor: pointer;
}

.qr-hint {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ==========================================
   雙 QR Code 彈跳視窗 (Modal)
   ========================================== */
.about-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 14, 0.82);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  padding: 18px;
  animation: modalFadeIn 0.22s ease-out;
}

.about-modal-dialog {
  width: 100%;
  max-width: 760px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 16px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(11, 15, 27, 0.96);
  border: 1px solid rgba(0, 243, 255, 0.35);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 243, 255, 0.2);
  animation: modalZoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 14px;
}

.about-modal-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.about-modal-heading {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
}

.about-modal-subheading {
  font-size: 11px;
  color: var(--cyan);
  opacity: 0.9;
  margin-top: 2px;
}

.close-modal-btn {
  font-size: 14px;
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.close-modal-btn:hover {
  border-color: var(--pink);
  color: var(--pink);
}

.about-modal-intro {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

.about-modal-intro strong {
  color: var(--cyan);
}

.about-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 14px;
  flex-wrap: wrap;
}

.footer-tip {
  font-size: 11px;
  color: var(--text-muted);
}

.footer-tip kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--font-mono);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalZoomIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* 響應式行動裝置支援 */
@media (max-width: 960px) {
  .brand-subtitle { display: none; }
  .topbar {
    top: 8px;
    left: 8px;
    right: 8px;
    height: auto;
    min-height: 48px;
    flex-wrap: wrap;
    padding: 8px 10px;
    gap: 8px;
  }
  .source-selector {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }
  .source-btn {
    flex: 1;
    justify-content: center;
    padding: 6px 6px;
    font-size: 11px;
  }
  .toolbar-actions {
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .action-btn {
    padding: 6px 9px;
    font-size: 11px;
  }
  /* 手機版將參數面板置於下半部抽屜區 (46vh ~ 底部)，保留上半部全開畫布供隨時單指觸控拖曳改變聲音位置點 */
  .workspace {
    top: 46vh;
    bottom: 64px;
    left: 8px;
    right: 8px;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto;
    gap: 10px;
  }
  .side-panel {
    width: 100%;
    max-height: none;
    overflow-y: visible;
  }
  .xy-hud {
    top: 106px;
    bottom: auto;
    width: 94vw;
  }
  .hud-Readout {
    gap: 10px;
    padding: 4px 12px;
    font-size: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .hud-hint {
    font-size: 11px;
    text-align: center;
  }
  .mobile-ui-fab {
    display: flex;
  }
}
