:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  --mini-primary: #3264f5;
  --mini-text: #101a33;
  --mini-muted: #6f7a91;
  --mini-line: #e5eaf2;
  --mini-bg: #f4f8ff;
  --mini-surface: #ffffff;
  --mini-safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  display: grid;
  place-items: center;
  background: #e9eef6;
  color: var(--mini-text);
  font-family: inherit;
}

button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--mini-primary);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.mini-svg-definitions {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.mini-app {
  position: relative;
  display: grid;
  width: min(100%, 430px);
  height: 100vh;
  height: 100dvh;
  grid-template-rows: 26px 62px minmax(0, 1fr) calc(66px + var(--mini-safe-bottom));
  overflow: hidden;
  background: var(--mini-bg);
  box-shadow: 0 16px 50px rgb(19 40 76 / 16%);
}

.device-status {
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 22px;
  background: #fff;
  color: #111a2d;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.device-indicators {
  display: flex;
  align-items: center;
  gap: 8px;
}

.signal-bars {
  display: flex;
  height: 14px;
  align-items: flex-end;
  gap: 2px;
}

.signal-bars i {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: #10192c;
}

.signal-bars i:nth-child(1) { height: 5px; }
.signal-bars i:nth-child(2) { height: 8px; }
.signal-bars i:nth-child(3) { height: 11px; }
.signal-bars i:nth-child(4) { height: 14px; }

.status-wifi {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #10192c;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.battery {
  position: relative;
  display: block;
  width: 24px;
  height: 12px;
  padding: 2px;
  border: 1.5px solid #596174;
  border-radius: 3px;
}

.battery::after {
  position: absolute;
  top: 3px;
  right: -4px;
  width: 2px;
  height: 5px;
  border-radius: 0 2px 2px 0;
  background: #8b92a0;
  content: "";
}

.battery i {
  display: block;
  width: 88%;
  height: 100%;
  border-radius: 1px;
  background: #172035;
}

.mini-header {
  z-index: 5;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 0 12px 0 14px;
  background: #fff;
}

.mini-brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  color: var(--mini-text);
  text-decoration: none;
}

.mini-brand img {
  width: 31px;
  height: 27px;
  object-fit: contain;
}

.mini-brand span {
  font-size: 19px;
  font-weight: 760;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.header-spacer {
  min-width: 0;
  flex: 1;
}

.header-icon {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
}

.header-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #111b34;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-button i {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #f0444d;
}

.mini-capsule {
  display: flex;
  width: 84px;
  height: 36px;
  flex: 0 0 84px;
  align-items: center;
  border: 1px solid #e0e5ec;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(21 35 60 / 4%);
}

.mini-capsule button {
  display: grid;
  height: 100%;
  flex: 1;
  place-items: center;
}

.capsule-divider {
  width: 1px;
  height: 20px;
  background: #e4e8ee;
}

.more-dots {
  display: flex;
  gap: 3px;
}

.more-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #111b34;
}

.capsule-close {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 3px solid #111b34;
  border-radius: 50%;
}

.capsule-close i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #111b34;
}

.mini-content {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--mini-bg);
}

.mini-page-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--mini-bg);
}

.mini-tabbar {
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 5px 5px var(--mini-safe-bottom);
  border-top: 1px solid var(--mini-line);
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 -5px 20px rgb(28 48 85 / 5%);
  backdrop-filter: blur(14px);
}

.mini-tab {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  color: #737d90;
  font-size: 12px;
}

.mini-tab svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini-tab.active {
  color: var(--mini-primary);
  font-weight: 600;
}

.mini-tab.active svg {
  fill: var(--mini-primary);
  stroke: var(--mini-primary);
}

.mini-toast {
  position: absolute;
  z-index: 20;
  bottom: calc(78px + var(--mini-safe-bottom));
  left: 50%;
  max-width: calc(100% - 40px);
  padding: 9px 14px;
  transform: translateX(-50%);
  border-radius: 8px;
  background: rgb(20 28 44 / 88%);
  color: #fff;
  font-size: 13px;
  text-align: center;
}

@media (max-width: 370px) {
  .mini-brand span {
    font-size: 17px;
  }

  .mini-brand img {
    width: 29px;
  }

  .mini-capsule {
    width: 78px;
    flex-basis: 78px;
  }
}

@media (min-width: 431px) {
  .mini-app {
    max-height: 900px;
    border-radius: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
