:root {
  --ink: #171b20;
  --ink-soft: #242a31;
  --paper: #f1efe9;
  --surface: #fbfaf7;
  --line: rgba(23, 27, 32, 0.14);
  --line-light: rgba(255, 255, 255, 0.14);
  --muted: #73766f;
  --red: #ff5f45;
  --blue: #3d9bff;
  --green: #37c892;
  --yellow: #f7bb39;
  --launcher-size: 330px;
  --launcher-list-width: 1026px;
  --launcher-list-height: 684px;
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  height: 100%;
  min-width: 280px;
  overflow: hidden;
  background: var(--paper);
}

body {
  margin: 0;
  height: 100%;
  min-width: 280px;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 88, 113, 0.34), transparent 33%),
    radial-gradient(circle at 92% 12%, rgba(47, 171, 255, 0.3), transparent 36%),
    radial-gradient(circle at 84% 88%, rgba(171, 103, 255, 0.24), transparent 39%),
    radial-gradient(circle at 12% 86%, rgba(52, 218, 169, 0.24), transparent 37%),
    linear-gradient(135deg, #f8eee4 0%, #e9edff 53%, #f8e9ef 100%);
  background-size: auto;
  background-attachment: fixed;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body.overlay-open {
  overflow: hidden;
  overscroll-behavior: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

button:not(:disabled),
a {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.launch-home {
  position: relative;
  width: 100%;
  height: 100vh;
  height: var(--app-height, 100vh);
  min-height: 0;
  overflow: hidden;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.site-title {
  position: absolute;
  top: 14px;
  left: 50%;
  width: calc(100% - 28px);
  margin: 0;
  color: #171b20;
  font-family: "Arial Black", "Segoe UI Black", "PingFang SC", sans-serif;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  white-space: nowrap;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
}

.title-mark {
  position: relative;
  display: block;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  margin-right: 9px;
  border-radius: 8px;
  background: var(--ink);
}

.title-mark i {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: #f7f5ef;
}

.title-mark i:nth-child(1) {
  top: 5px;
  left: 5px;
  background: var(--red);
}

.title-mark i:nth-child(2) {
  top: 5px;
  right: 5px;
}

.title-mark i:nth-child(3) {
  bottom: 5px;
  left: 5px;
}

.title-mark i:nth-child(4) {
  right: 5px;
  bottom: 5px;
  background: var(--blue);
}

.title-brand {
  color: #2864df;
  background-image: linear-gradient(100deg, #ff5f45, #315ee7 55%, #00a8c9);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.title-divider {
  margin: 0 7px;
  color: #8f918b;
}

.title-name {
  color: #1d2328;
}

.launcher-list {
  display: flex;
  flex-wrap: wrap;
  align-content: stretch;
  align-items: stretch;
  justify-content: center;
  width: var(--launcher-list-width);
  height: var(--launcher-list-height);
  min-height: 0;
  max-width: none;
  max-height: none;
  flex: 0 0 auto;
  margin: auto;
}

.page-version {
  position: absolute;
  bottom: 4px;
  bottom: max(4px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 2;
  display: flex;
  padding: 3px 9px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(23, 27, 32, 0.08);
  border-radius: 999px;
  color: rgba(23, 27, 32, 0.5);
  background: rgba(255, 255, 255, 0.34);
  font: 10px / 1.2 var(--mono);
  letter-spacing: 0.015em;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
}

.page-version-divider {
  margin: 0 6px;
  color: rgba(23, 27, 32, 0.3);
}

.launcher {
  position: relative;
  width: var(--launcher-size);
  height: var(--launcher-size);
  min-height: 0;
  margin: 6px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  flex: 0 0 var(--launcher-size);
  border: 1px solid var(--line);
  border-radius: 27px;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.launcher:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 50px rgba(29, 28, 24, 0.1);
}

.launcher:active {
  transform: translateY(0);
}

.launcher-screen {
  color: #0c1520;
  border-color: rgba(25, 28, 36, 0.12);
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 86, 91, 0.9), transparent 38%),
    radial-gradient(circle at 84% 16%, rgba(76, 224, 255, 0.92), transparent 38%),
    radial-gradient(circle at 65% 88%, rgba(85, 88, 255, 0.82), transparent 45%),
    radial-gradient(circle at 18% 88%, rgba(255, 226, 72, 0.82), transparent 42%),
    linear-gradient(135deg, #ffe2d6 0%, #dfd4ff 50%, #c8f4ff 100%);
  box-shadow: 0 20px 54px rgba(64, 71, 112, 0.15);
}

.launcher-touch {
  color: #fff;
  border-color: #242a31;
  background:
    radial-gradient(circle at 94% 12%, rgba(61, 155, 255, 0.2), transparent 11rem),
    linear-gradient(145deg, #252b32, #14181d);
  box-shadow: 0 20px 52px rgba(23, 27, 32, 0.14);
}

.launcher-camera {
  color: #fff;
  border-color: #3c3e88;
  background:
    radial-gradient(circle at 84% 16%, rgba(87, 231, 255, 0.72), transparent 34%),
    radial-gradient(circle at 14% 86%, rgba(131, 103, 255, 0.9), transparent 44%),
    linear-gradient(145deg, #25337e, #285fb6 55%, #61cadd);
  box-shadow: 0 18px 45px rgba(55, 67, 151, 0.24);
}

.launcher-speed {
  color: #fff;
  border-color: #3d2f69;
  background:
    radial-gradient(circle at 82% 16%, rgba(255, 187, 94, 0.75), transparent 31%),
    radial-gradient(circle at 8% 82%, rgba(255, 75, 133, 0.65), transparent 42%),
    linear-gradient(145deg, #34265f, #5e3d89 52%, #a85c8e);
  box-shadow: 0 18px 45px rgba(76, 52, 118, 0.24);
}

.launcher-scanner {
  color: #102321;
  border-color: rgba(21, 85, 75, 0.18);
  background:
    radial-gradient(circle at 84% 16%, rgba(255, 255, 255, 0.84), transparent 30%),
    radial-gradient(circle at 12% 84%, rgba(62, 221, 183, 0.72), transparent 45%),
    linear-gradient(145deg, #bff7dd, #77d8cf 54%, #9cc6ff);
  box-shadow: 0 18px 45px rgba(48, 126, 119, 0.2);
}

.launcher-sound {
  color: #172426;
  border-color: rgba(89, 61, 42, 0.14);
  background:
    radial-gradient(circle at 84% 14%, rgba(255, 255, 255, 0.86), transparent 32%),
    radial-gradient(circle at 14% 84%, rgba(255, 169, 145, 0.84), transparent 47%),
    linear-gradient(145deg, #ffe28f, #ffb980 52%, #ef9fbe);
  box-shadow: 0 18px 45px rgba(163, 99, 82, 0.18);
}

.launcher-icon {
  display: flex;
  width: 58px;
  height: 58px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
}

.launcher-screen .launcher-icon,
.launcher-touch .launcher-icon,
.launcher-camera .launcher-icon,
.launcher-speed .launcher-icon,
.launcher-scanner .launcher-icon,
.launcher-sound .launcher-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--card-icon-size, 92px);
  height: var(--card-icon-size, 92px);
  border-radius: 25px;
  box-shadow: 0 0 0 18px rgba(255, 255, 255, 0.025);
  transform: translate(-50%, -50%);
}

.launcher-touch .launcher-icon {
  width: var(--card-icon-size, 92px);
  height: var(--card-icon-size, 92px);
  border-color: var(--line-light);
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.06);
}

.launcher-screen .launcher-icon svg,
.launcher-camera .launcher-icon svg,
.launcher-speed .launcher-icon svg,
.launcher-scanner .launcher-icon svg,
.launcher-sound .launcher-icon svg {
  width: var(--card-icon-svg, 50px);
  height: var(--card-icon-svg, 50px);
}

.launcher-touch .launcher-icon svg {
  width: var(--touch-icon-svg, 66px);
  height: var(--touch-icon-svg, 66px);
}

.launcher-icon svg {
  width: 35px;
  height: 35px;
}

.launcher-icon .icon-fill {
  fill: var(--red);
  stroke: none;
}

.touch-pointer-image {
  display: block;
  object-fit: contain;
}

.launcher-touch .touch-pointer-image {
  width: 62%;
  height: 62%;
  filter: brightness(0) invert(1);
}

.tap-hand .touch-pointer-image {
  width: 68%;
  height: 68%;
  filter: brightness(0) invert(1);
}

.touch-empty .touch-pointer-image {
  width: 54%;
  height: 54%;
  filter: brightness(0) invert(1);
}

.launcher-copy {
  display: block;
  max-width: 100%;
  margin-top: auto;
  overflow: hidden;
  font-family: "Arial Black", "Segoe UI Black", "PingFang SC", sans-serif;
  font-size: var(--card-title-size, 38px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.06em;
  white-space: nowrap;
}

.launcher-action {
  position: absolute;
  right: 24px;
  bottom: 24px;
  display: flex;
  width: 54px;
  height: 54px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.launcher-touch .launcher-action {
  color: var(--ink);
  background: #fff;
}

.launcher-camera .launcher-action {
  color: #16243b;
  background: #f5feff;
}

.launcher-speed .launcher-action {
  color: #2a1b45;
  background: #fff6e8;
}

.launcher-scanner .launcher-action {
  color: #f3fffb;
  background: #153f39;
}

.launcher-camera .launcher-icon {
  color: #f3feff;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 18px rgba(255, 255, 255, 0.035);
}

.launcher-speed .launcher-icon {
  color: #fff8ef;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 18px rgba(255, 255, 255, 0.03);
}

.launcher-scanner .launcher-icon {
  color: #123e37;
  border-color: rgba(16, 72, 61, 0.15);
  background: rgba(255, 255, 255, 0.44);
  box-shadow: 0 0 0 18px rgba(255, 255, 255, 0.045);
}

.launcher-sound .launcher-icon {
  color: #14322d;
  border-color: rgba(42, 53, 47, 0.15);
  background: rgba(255, 255, 255, 0.48);
  box-shadow: 0 0 0 18px rgba(255, 255, 255, 0.055);
}

.launcher-action svg {
  width: 20px;
  height: 20px;
  margin: 0;
}

.feature-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  padding: 12px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(14, 18, 22, 0.84);
}

.camera-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  overflow: hidden;
  color: #fff;
  background: #05080a;
}

#cameraVideo {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

#cameraVideo.is-front {
  transform: scaleX(-1);
}

.camera-message {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: flex;
  width: calc(100% - 32px);
  max-width: 320px;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: translate(-50%, -50%);
  transition: opacity 160ms ease;
}

.camera-message.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.camera-message-icon {
  display: flex;
  width: 76px;
  height: 76px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
}

.camera-message-icon svg {
  width: 42px;
  height: 42px;
}

.camera-message strong {
  margin-top: 15px;
  font-size: 17px;
}

.camera-message small {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 9px;
}

.camera-close {
  position: absolute;
  right: auto;
  bottom: 14px;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 5;
  display: flex;
  width: 168px;
  height: 50px;
  padding: 0 14px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 12px;
  color: #fff;
  background: #171b20;
  opacity: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(9px);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transform: translateX(-50%);
  white-space: nowrap;
}

.camera-close span {
  margin-right: 10px;
}

.camera-close svg {
  width: 21px;
  height: 21px;
}

.camera-dock {
  position: absolute;
  right: 14px;
  bottom: 76px;
  bottom: max(76px, calc(env(safe-area-inset-bottom) + 62px));
  left: 14px;
  z-index: 5;
  display: flex;
  min-height: 58px;
  padding: 7px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  background: rgba(8, 12, 16, 0.6);
  backdrop-filter: blur(10px);
}

.camera-info {
  min-width: 92px;
  padding: 0 13px;
}

.camera-info strong {
  display: block;
  font: 700 13px var(--mono);
}

.camera-info span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 8px;
}

.camera-action {
  min-height: 44px;
  margin-left: 6px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  font-size: 10px;
}

.camera-zoom {
  display: flex;
  min-width: 135px;
  margin-left: 8px;
  align-items: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 9px;
}

.camera-zoom input {
  width: 92px;
  margin-left: 7px;
  accent-color: #fff;
}

.feature-panel {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 24px);
  padding: 22px 22px 84px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 26px;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 7%, rgba(61, 155, 255, 0.09), transparent 12rem),
    #f8f7f2;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.28);
}

.feature-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.feature-head span {
  color: #9b9d97;
  font: 700 10px var(--mono);
  letter-spacing: 0.14em;
}

.feature-head h2 {
  margin: 4px 0 0;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.feature-close {
  position: absolute;
  bottom: 16px;
  left: 50%;
  z-index: 3;
  display: flex;
  width: 196px;
  height: 54px;
  padding: 0 14px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  transform: translateX(-50%);
  white-space: nowrap;
}

#closeSound,
#closeScanner {
  bottom: 14px;
  width: 168px;
  height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 12px;
  color: #fff;
  background: #171b20;
  box-shadow: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  font-size: 17px;
}

.camera-close,
#closeSound,
#closeScanner {
  font-family: var(--font);
  font-weight: 700;
  line-height: 1;
}

#closeSound:hover,
#closeScanner:hover {
  background: #000;
}

#closeSound span,
#closeScanner span {
  margin-right: 10px;
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
}

#closeSound svg,
#closeScanner svg {
  width: 21px;
  height: 21px;
}

.feature-close span {
  margin-right: 9px;
}

.feature-close svg {
  width: 20px;
  height: 20px;
}

.signal-display {
  display: flex;
  min-height: 260px;
  margin-top: 18px;
  padding: 12px;
  flex-direction: column;
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(circle at 82% 15%, rgba(55, 200, 146, 0.4), transparent 10rem),
    linear-gradient(145deg, #183343, #101b26);
  overflow: hidden;
}

.signal-summary {
  display: flex;
  min-height: 78px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.signal-bars {
  display: flex;
  height: 35px;
  align-items: flex-end;
}

.signal-bars i {
  width: 12px;
  margin: 0 3px;
  border-radius: 4px 4px 2px 2px;
  background: rgba(255, 255, 255, 0.14);
  transition: background 160ms ease, height 160ms ease;
}

.signal-bars i:nth-child(1) {
  height: 14px;
}

.signal-bars i:nth-child(2) {
  height: 19px;
}

.signal-bars i:nth-child(3) {
  height: 27px;
}

.signal-bars i:nth-child(4) {
  height: 35px;
}

.signal-bars i.is-on {
  background: var(--green);
  box-shadow: 0 0 13px rgba(55, 200, 146, 0.34);
}

.signal-summary > strong {
  position: relative;
  z-index: 1;
  margin-top: 5px;
  font-size: 15px;
}

.signal-summary > span {
  position: relative;
  z-index: 1;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 9px;
}

.signal-chart-wrap {
  position: relative;
  min-height: 126px;
  flex: 1 1 auto;
  margin-top: 7px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(5, 20, 26, 0.32);
}

.signal-chart {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

.signal-chart-meta {
  position: absolute;
  right: 13px;
  bottom: 6px;
  left: 11px;
  right: 11px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.signal-chart-meta span {
  color: rgba(255, 255, 255, 0.36);
  font-size: 8px;
}

.signal-chart-meta strong {
  color: #d9fff0;
  font: 700 13px var(--mono);
}

.feature-primary {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: var(--ink);
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
}

.feature-primary:disabled {
  opacity: 0.55;
  cursor: wait;
}

.feature-hint {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.sound-panel {
  max-width: 640px;
}

.sound-display {
  display: flex;
  min-height: 220px;
  margin-top: 16px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(circle at 50% 50%, rgba(55, 200, 146, 0.17), transparent 10rem),
    #12191c;
}

.speaker-symbol {
  display: flex;
  width: 70px;
  height: 70px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: #d8fff0;
}

.speaker-symbol svg {
  width: 38px;
  height: 38px;
}

.sound-wave {
  display: flex;
  height: 30px;
  margin-top: 11px;
  align-items: center;
}

.sound-wave i {
  width: 4px;
  height: 5px;
  margin: 0 3px;
  border-radius: 9px;
  background: var(--green);
  opacity: 0.35;
  transform-origin: center;
}

.sound-display.is-playing .sound-wave i {
  animation: soundBar 0.58s ease-in-out infinite alternate;
}

.sound-wave i:nth-child(2),
.sound-wave i:nth-child(6) {
  animation-delay: -0.17s;
}

.sound-wave i:nth-child(3),
.sound-wave i:nth-child(5) {
  animation-delay: -0.32s;
}

.sound-wave i:nth-child(4) {
  animation-delay: -0.44s;
}

@keyframes soundBar {
  from {
    height: 5px;
    opacity: 0.4;
  }
  to {
    height: 27px;
    opacity: 1;
  }
}

.sound-display > strong {
  margin-top: 9px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.volume-control {
  display: flex;
  margin-top: 15px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}

.volume-control output {
  color: var(--ink);
  font: 700 16px var(--mono);
}

.volume-slider {
  width: 100%;
  height: 40px;
  margin: 4px 0 0;
  accent-color: var(--ink);
  cursor: pointer;
}

.scanner-panel {
  display: flex;
  height: calc(100vh - 24px);
  height: calc(var(--app-height, 100vh) - 24px);
  max-width: 1080px;
  max-height: 720px;
  flex-direction: column;
}

.scanner-panel > .feature-head,
.scanner-panel > .scanner-clear,
.scanner-panel > .feature-hint {
  flex: 0 0 auto;
}

.scanner-status {
  display: flex;
  min-height: 470px;
  margin-top: 16px;
  padding: 15px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(circle at 50% 30%, rgba(55, 200, 146, 0.17), transparent 10rem),
    #121a1d;
}

.scanner-panel .scanner-status {
  min-height: 0;
  flex: 1 1 auto;
}

.scanner-symbol {
  display: flex;
  width: 50px;
  height: 50px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
}

.scanner-symbol svg {
  width: 30px;
  height: 30px;
}

.scanner-status > strong {
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 16px;
}

.scanner-log-head {
  display: flex;
  width: 100%;
  margin-top: 12px;
  padding: 7px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
  border-radius: 8px 8px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font: 700 14px var(--mono);
}

.scanner-log-head span:first-child {
  width: 128px;
  flex: 0 0 128px;
}

.scanner-log-head span:last-child {
  padding-left: 9px;
}

.scanner-log {
  height: 320px;
  min-height: 320px;
  max-height: 320px;
  width: 100%;
  margin-top: 2px;
  overflow-y: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.scanner-panel .scanner-log {
  height: auto;
  min-height: 96px;
  max-height: 320px;
  flex: 1 1 auto;
}

.scanner-empty {
  padding: 35px 8px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  text-align: center;
}

.scanner-log-row {
  display: flex;
  padding: 12px 5px;
  min-height: 54px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  align-items: flex-start;
}

.scanner-log-row:last-child {
  border-bottom: 0;
}

.scanner-log-row time {
  width: 128px;
  flex: 0 0 128px;
  color: rgba(180, 255, 230, 0.82);
  font: 14px / 1.65 var(--mono);
  white-space: nowrap;
}

.scanner-log-row code {
  min-width: 0;
  flex: 1 1 auto;
  padding-left: 9px;
  color: rgba(255, 255, 255, 0.96);
  font: 700 19px / 1.55 var(--mono);
  word-break: break-all;
  white-space: pre-wrap;
}

.scanner-clear {
  min-height: 40px;
  margin-top: 10px;
  padding: 0 13px;
  align-self: flex-end;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  font-size: 13px;
}

.screen-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  overflow: hidden;
  color: #16191d;
  background: #fff;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.screen-pattern {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: #fff;
}

.screen-tap-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: flex;
  padding: 10px 15px 10px 12px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 15px;
  color: #fff;
  background: rgba(16, 19, 23, 0.8);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  backdrop-filter: blur(8px);
  transform: translate(-50%, -50%);
  transition: opacity 160ms ease, transform 160ms ease;
}

.screen-tap-hint.is-hidden {
  opacity: 0;
  transform: translate(-50%, -44%);
}

.tap-hand {
  position: relative;
  display: flex;
  width: 44px;
  height: 46px;
  margin-right: 10px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  animation: tapHand 1.6s ease-in-out infinite;
}

.tap-hand svg {
  width: 34px;
  height: 38px;
  stroke-width: 2.2;
}

.screen-tap-hint strong {
  font-size: 15px;
  white-space: nowrap;
}

@keyframes tapHand {
  0% {
    transform: translateY(2px);
  }
  50% {
    transform: translateY(-3px);
  }
  100% {
    transform: translateY(2px);
  }
}

.screen-dock {
  position: absolute;
  bottom: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 4;
  display: flex;
  padding: 7px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 15px;
  color: #fff;
  background: rgba(12, 16, 20, 0.28);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(9px) saturate(1.2);
  transform: translateX(-50%);
  transition: opacity 180ms ease, transform 180ms ease;
}

.screen-overlay.dock-hidden .screen-dock {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
}

.screen-dock .exit-button {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.07);
}

.screen-dock .dock-action,
.screen-dock .exit-button {
  width: 112px;
  min-width: 112px;
  height: 48px;
  min-height: 48px;
  padding: 0 12px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.screen-dock .dock-action {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.screen-dock .exit-button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.exit-button {
  display: flex;
  min-height: 46px;
  padding: 0 15px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.exit-button svg {
  width: 17px;
  height: 17px;
  margin-left: 10px;
}

.exit-button:hover {
  background: rgba(255, 255, 255, 0.13);
}


.touch-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  overflow: hidden;
  color: #fff;
  background: #171b20;
}

.touch-hud {
  position: absolute;
  top: 12px;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  z-index: 6;
  display: flex;
  padding: 7px 8px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 13px;
  background: rgba(23, 27, 32, 0.86);
  backdrop-filter: blur(8px);
  transform: translateX(-50%);
  transition: opacity 180ms ease, transform 180ms ease;
}

.touch-hud > div {
  min-width: 66px;
  padding: 0 11px;
  text-align: center;
}

.touch-hud > div + div {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.touch-hud strong {
  display: block;
  color: #fff;
  font: 700 17px var(--mono);
}

.touch-hud span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 8px;
  white-space: nowrap;
}

.touch-dock {
  position: absolute;
  bottom: 14px;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 7;
  display: flex;
  max-width: calc(100% - 20px);
  padding: 7px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 15px;
  background: rgba(29, 34, 40, 0.94);
  box-shadow: 0 9px 30px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(10px);
  transform: translateX(-50%);
  transition: opacity 180ms ease, transform 180ms ease;
}

.touch-modes {
  display: flex;
  padding: 3px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.touch-modes button {
  min-width: 74px;
  min-height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.6);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.touch-modes button svg {
  width: 15px;
  height: 15px;
  margin-right: 6px;
}

.touch-modes button + button {
  margin-left: 2px;
}

.touch-modes button.is-active {
  color: #171b20;
  background: #fff;
}

.grid-size-control {
  display: flex;
  min-height: 44px;
  margin-left: 7px;
  padding: 3px;
  align-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  touch-action: none;
}

.grid-size-control button {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  color: #fff;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  touch-action: none;
}

.grid-size-control span {
  min-width: 49px;
  color: rgba(255, 255, 255, 0.68);
  font: 11px var(--mono);
  text-align: center;
}

.dock-action {
  min-height: 44px;
  margin-left: 7px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.68);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.touch-dock .exit-button {
  width: 76px;
  min-width: 76px;
  height: 46px;
  min-height: 46px;
  margin-left: 7px;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.touch-dock .dock-action {
  width: 76px;
  min-width: 76px;
  height: 46px;
  min-height: 46px;
  padding: 0 8px;
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.08);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.touch-dock .exit-button svg {
  width: 15px;
  height: 15px;
  margin-left: 6px;
}

.touch-overlay.controls-hidden .touch-hud {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -10px);
}

.touch-overlay.controls-hidden .touch-dock {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
}

.touch-stage {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 0;
  overflow: hidden;
  background: #101419;
  outline: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.screen-overlay:fullscreen,
.screen-overlay:-webkit-full-screen,
.screen-overlay:-moz-full-screen {
  width: 100%;
  height: 100%;
}

.touch-stage:focus-visible {
  box-shadow: none;
}

#touchCanvas {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.touch-markers {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  pointer-events: none;
}

.touch-marker {
  position: absolute;
  width: 48px;
  height: 48px;
  border: 1px solid var(--marker, #fff);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.13);
  transform: translate(-50%, -50%);
}

.touch-marker::before,
.touch-marker::after {
  position: absolute;
  top: 50%;
  left: 50%;
  content: "";
  background: var(--marker, #fff);
  transform: translate(-50%, -50%);
}

.touch-marker::before {
  width: 9px;
  height: 1px;
}

.touch-marker::after {
  width: 1px;
  height: 9px;
}

.touch-marker b {
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  padding: 4px 6px;
  border-radius: 4px;
  color: var(--marker, #fff);
  background: rgba(0, 0, 0, 0.38);
  font: 700 9px var(--mono);
  white-space: nowrap;
  transform: translateX(-50%);
}

.touch-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: rgba(255, 255, 255, 0.28);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 140ms ease;
}

.touch-empty.is-hidden {
  opacity: 0;
}

.touch-empty > span {
  display: flex;
  width: 82px;
  height: 92px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.025);
  animation: touchGuide 1.8s ease-in-out infinite;
}

.touch-empty svg {
  width: 44px;
  height: 44px;
}

.touch-empty strong {
  margin-top: 13px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
}

.touch-empty small {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.26);
  font-size: 9px;
}

@keyframes touchGuide {
  0%,
  100% {
    transform: translateY(2px);
  }
  50% {
    transform: translateY(-5px);
  }
}

.toast {
  position: fixed;
  bottom: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 1200;
  max-width: calc(100% - 36px);
  padding: 10px 15px;
  border-radius: 999px;
  color: #fff;
  background: rgba(16, 19, 23, 0.92);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.2);
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 700px) {
  .screen-dock,
  .touch-hud,
  .touch-dock,
  .camera-dock,
  .camera-close {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .launch-home {
    height: 100vh;
    height: var(--app-height, 100vh);
    min-height: 0;
    padding: 10px;
    padding-top: 10px;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .launcher-list {
    width: var(--launcher-list-width);
    height: var(--launcher-list-height);
    max-height: none;
  }

  .site-title {
    margin-bottom: 6px;
    font-size: 18px;
    white-space: normal;
  }

  .page-version {
    bottom: 3px;
    bottom: max(3px, env(safe-area-inset-bottom));
    padding: 2px 7px;
    font-size: 9px;
  }

  .page-version-divider {
    margin: 0 4px;
  }

  .launcher {
    width: var(--launcher-size);
    height: var(--launcher-size);
    min-height: 0;
    padding: 14px;
    border-radius: 18px;
  }

  .launcher-action {
    display: none;
  }

  .screen-dock {
    bottom: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  .exit-button {
    min-height: 48px;
  }

  .touch-hud {
    top: 9px;
    top: max(9px, env(safe-area-inset-top));
  }

  .touch-hud > div {
    min-width: 57px;
    padding: 0 7px;
  }

  .touch-hud strong {
    font-size: 15px;
  }

  .touch-dock {
    right: 8px;
    bottom: 9px;
    bottom: max(9px, env(safe-area-inset-bottom));
    left: 8px;
    max-width: none;
    flex-wrap: wrap;
    transform: none;
  }

  .touch-overlay.controls-hidden .touch-dock {
    transform: translateY(14px);
  }

  .touch-modes {
    width: 100%;
  }

  .touch-modes button {
    flex: 1 1 50%;
    min-width: 0;
    min-height: 48px;
  }

  .touch-dock .grid-size-control,
  .touch-dock .dock-action,
  .touch-dock .exit-button {
    margin-top: 6px;
  }

  .grid-size-control {
    margin-left: 0;
  }

  .grid-size-control button {
    width: 34px;
    height: 40px;
  }

  .grid-size-control span {
    min-width: 42px;
  }

  .touch-dock .dock-action {
    margin-left: 6px;
  }

  .touch-dock .dock-action,
  .touch-dock .exit-button {
    width: 64px;
    min-width: 64px;
    height: 48px;
    min-height: 48px;
    margin-left: 6px;
  }

  .touch-dock .exit-button {
    padding: 0 4px;
  }

  .touch-dock .exit-button svg {
    width: 14px;
    height: 14px;
    margin-left: 4px;
  }

  .camera-close {
    right: auto;
    bottom: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 50%;
  }

  #closeSound,
  #closeScanner {
    bottom: 10px;
  }

  .camera-dock {
    right: 8px;
    bottom: 72px;
    bottom: max(72px, calc(env(safe-area-inset-bottom) + 62px));
    left: 8px;
    flex-wrap: wrap;
  }

  .camera-info {
    min-width: 82px;
    padding: 0 8px;
  }

  .camera-action {
    padding: 0 10px;
  }

  .camera-zoom {
    width: 100%;
    min-width: 0;
    margin: 6px 0 0 6px;
    justify-content: center;
  }

  .camera-zoom input {
    width: 60%;
  }
}

@media (max-height: 650px) {
  .site-title {
    margin-bottom: 4px;
    font-size: 15px;
  }

  .launcher {
    padding: 12px;
  }

  .launcher-action {
    display: none;
  }
}

@media (max-height: 620px) {
  .feature-panel {
    padding: 14px 14px 72px;
    border-radius: 20px;
  }

  .feature-head h2 {
    font-size: 22px;
  }

  .feature-close {
    width: 176px;
    height: 46px;
    font-size: 16px;
  }

  #closeSound,
  #closeScanner {
    width: 168px;
    height: 50px;
    font-size: 17px;
  }

  .signal-display {
    min-height: 190px;
    margin-top: 9px;
    padding: 8px;
  }

  .signal-summary {
    min-height: 55px;
  }

  .signal-chart-wrap {
    min-height: 92px;
    margin-top: 5px;
  }

  .signal-bars {
    height: 30px;
  }

  .signal-bars i:nth-child(1) {
    height: 9px;
  }

  .signal-bars i:nth-child(2) {
    height: 16px;
  }

  .signal-bars i:nth-child(3) {
    height: 23px;
  }

  .signal-bars i:nth-child(4) {
    height: 30px;
  }

  .signal-summary > strong {
    margin-top: 4px;
    font-size: 14px;
  }

  .feature-primary {
    min-height: 42px;
    margin-top: 9px;
  }

  .feature-hint {
    margin-top: 7px;
    font-size: 11px;
    line-height: 1.45;
  }

  .sound-display {
    min-height: 112px;
    margin-top: 8px;
  }

  .speaker-symbol {
    width: 48px;
    height: 48px;
  }

  .speaker-symbol svg {
    width: 28px;
    height: 28px;
  }

  .sound-wave {
    height: 18px;
    margin-top: 5px;
  }

  .sound-display > strong {
    margin-top: 4px;
  }

  .volume-control {
    margin-top: 8px;
  }

  .volume-slider {
    height: 24px;
    margin-top: 0;
  }

  .scanner-status {
    min-height: 0;
    margin-top: 8px;
    padding: 8px;
  }

  .scanner-symbol {
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }

  .scanner-symbol svg {
    width: 27px;
    height: 27px;
  }

  .scanner-status > strong {
    margin-top: 5px;
  }

  .scanner-log {
    height: auto;
    min-height: 72px;
    max-height: none;
    margin-top: 2px;
  }

  .scanner-panel {
    height: calc(100vh - 24px);
    height: calc(var(--app-height, 100vh) - 24px);
    padding-bottom: 72px;
  }

  .scanner-clear {
    min-height: 36px;
    margin-top: 5px;
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  .touch-dock {
    right: auto;
    left: 50%;
    flex-wrap: nowrap;
    transform: translateX(-50%);
  }

  .touch-overlay.controls-hidden .touch-dock {
    transform: translate(-50%, 14px);
  }

  .touch-modes {
    width: auto;
  }

  .touch-modes button {
    min-width: 70px;
  }

  .grid-size-control,
  .dock-action,
  .touch-dock .exit-button {
    margin-top: 0;
  }

  .scanner-panel {
    padding: 14px 14px 64px;
  }

  .scanner-panel .feature-head h2 {
    margin-top: 2px;
    font-size: 20px;
  }

  .scanner-status {
    min-height: 0;
    margin-top: 5px;
    padding: 7px;
  }

  .scanner-symbol {
    display: none;
  }

  .scanner-status > strong {
    margin-top: 0;
    font-size: 14px;
  }

  .scanner-panel .scanner-log-head {
    margin-top: 4px;
    padding: 4px;
    font-size: 12px;
  }

  .scanner-panel .scanner-log {
    height: auto;
    min-height: 32px;
    max-height: none;
  }

  .scanner-panel .scanner-empty {
    padding: 8px 4px;
    line-height: 1.35;
  }

  .scanner-panel .scanner-clear {
    min-height: 32px;
    margin-top: 4px;
  }

  .scanner-panel > .feature-hint {
    margin-top: 3px;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.25;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .scanner-log-row {
    min-height: 42px;
    padding: 7px 4px;
  }

  .scanner-log-row code {
    font-size: 14px;
  }

  .feature-close {
    bottom: 10px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
