:root {
  color-scheme: dark;
  --screen-w: min(100vw, 462px);
  --screen-h: min(100dvh, 820px);
  --smart-blue: #2089dd;
  --smart-blue-dark: #0f65ad;
  --smart-line: rgba(7, 72, 130, .42);
  --smart-line-light: rgba(255, 255, 255, .13);
  --smart-text: #f7fbff;
  --smart-muted: rgba(236, 248, 255, .72);
  --chrome: #17191d;
  --paper: #f2f0e9;
  --paper-text: #35322e;
  --radius-icon: 20px;
  font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  text-rendering: geometricPrecision;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 32%),
    linear-gradient(180deg, #cfd3d6 0%, #eceeef 42%, #d6d8da 100%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

.stage {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2.2vw, 26px);
}

.device {
  position: relative;
  width: var(--screen-w);
  height: var(--screen-h);
  min-height: 620px;
  border-radius: 34px;
  padding: clamp(7px, 1.2vw, 12px);
  background:
    linear-gradient(145deg, #303238, #040506 42%, #1d2024 100%);
  box-shadow:
    0 28px 68px rgba(0, 0, 0, .42),
    inset 0 2px 4px rgba(255, 255, 255, .18),
    inset 0 -3px 8px rgba(0, 0, 0, .9);
}

.device::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 50%;
  width: 70px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(#111, #2c2d30);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, .22);
  opacity: .72;
}

.launcher {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 25px;
  background:
    linear-gradient(rgba(31, 139, 219, .72), rgba(18, 118, 200, .78)),
    url("/assets/smartisan/noise.png"),
    linear-gradient(180deg, rgba(76, 178, 249, .85) 0%, rgba(35, 139, 218, .92) 39%, rgba(22, 126, 203, .95) 100%),
    var(--smart-blue);
  background-size: auto, 150px 150px, auto, auto;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .15),
    inset 0 22px 42px rgba(255, 255, 255, .08),
    inset 0 -48px 82px rgba(1, 52, 101, .18);
  isolation: isolate;
}

.launcher::before,
.launcher::after {
  content: "";
  position: absolute;
  inset: 34px 0 0;
  pointer-events: none;
  z-index: 0;
}

.launcher::before {
  background-image:
    linear-gradient(to right, transparent calc(33.333% - .5px), var(--smart-line) calc(33.333% - .5px), var(--smart-line) calc(33.333% + .5px), transparent calc(33.333% + .5px)),
    linear-gradient(to right, transparent calc(66.666% - .5px), var(--smart-line) calc(66.666% - .5px), var(--smart-line) calc(66.666% + .5px), transparent calc(66.666% + .5px)),
    linear-gradient(to bottom, transparent calc(33.333% - .5px), var(--smart-line) calc(33.333% - .5px), var(--smart-line) calc(33.333% + .5px), transparent calc(33.333% + .5px)),
    linear-gradient(to bottom, transparent calc(66.666% - .5px), var(--smart-line) calc(66.666% - .5px), var(--smart-line) calc(66.666% + .5px), transparent calc(66.666% + .5px));
  opacity: .55;
}

.launcher::after {
  background:
    linear-gradient(to right, var(--smart-line-light) 1px, transparent 1px),
    linear-gradient(to bottom, var(--smart-line-light) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: .5;
}

.statusbar {
  position: relative;
  z-index: 3;
  height: 34px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 11px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .32);
  background: linear-gradient(180deg, rgba(33, 139, 222, .96), rgba(12, 103, 184, .82));
  box-shadow: inset 0 -1px 0 rgba(0, 62, 119, .55);
}

.status-left,
.status-right {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.status-right {
  justify-content: flex-end;
}

.status-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 98px;
}

.signal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 0 0 1px rgba(18, 90, 159, .42);
}

.wifi {
  width: 14px;
  height: 10px;
  border: 2px solid #fff;
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: rotate(-45deg);
}

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

.bars i {
  display: block;
  width: 3px;
  background: #fff;
  border-radius: 1px 1px 0 0;
}

.bars i:nth-child(1) { height: 4px; }
.bars i:nth-child(2) { height: 8px; }
.bars i:nth-child(3) { height: 12px; }

.battery {
  position: relative;
  width: 19px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 2px;
}

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

.desktop {
  position: relative;
  z-index: 2;
  height: calc(100% - 166px);
  overflow: hidden;
  padding: clamp(12px, 3vh, 22px) 10px 8px;
}

.pages-track {
  height: 100%;
  display: flex;
  transform: translate3d(calc(var(--page, 0) * -100%), 0, 0);
  transition: transform .28s cubic-bezier(.2, .9, .23, 1);
}

.page {
  flex: 0 0 100%;
  min-width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  padding: 3px;
  transform-origin: center;
}

.cell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
}

.cell::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(5, 84, 151, .38);
  border-left-color: rgba(255, 255, 255, .12);
  border-top-color: rgba(255, 255, 255, .12);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .09),
    inset -1px -1px 0 rgba(0, 53, 106, .18);
}

.app-button {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 8px 4px 10px;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

.app-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .92);
  outline-offset: -8px;
}

.app-icon {
  width: clamp(54px, 16.5vw, 78px);
  height: clamp(54px, 16.5vw, 78px);
  display: grid;
  place-items: center;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .26));
  transition: transform .16s ease, filter .16s ease;
}

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

.app-button:active .app-icon {
  transform: scale(.88);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .36));
}

.generated-icon {
  border-radius: var(--radius-icon);
  color: #fff;
  background: linear-gradient(145deg, var(--icon-a), var(--icon-b));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .45),
    inset 0 -9px 18px rgba(0, 0, 0, .16),
    0 2px 3px rgba(0, 0, 0, .28);
  border: 1px solid rgba(0, 0, 0, .2);
  overflow: hidden;
}

.generated-icon::before {
  content: "";
  width: 48%;
  height: 48%;
  display: block;
  border: 4px solid currentColor;
  opacity: .94;
}

.glyph-music::before {
  width: 42%;
  height: 52%;
  border-radius: 50% 50% 48% 48%;
  border-width: 4px 4px 8px;
}

.glyph-video::before {
  width: 44%;
  height: 36%;
  border-radius: 4px;
  clip-path: polygon(0 0, 72% 0, 72% 30%, 100% 16%, 100% 84%, 72% 70%, 72% 100%, 0 100%);
  background: currentColor;
  border: 0;
}

.glyph-file::before {
  width: 42%;
  height: 50%;
  border-radius: 5px;
  border-width: 3px;
  border-top-right-radius: 14px;
}

.glyph-photo::before {
  width: 48%;
  height: 38%;
  border-radius: 5px;
  border-width: 3px;
  background:
    radial-gradient(circle at 72% 30%, currentColor 0 8%, transparent 9%),
    linear-gradient(135deg, transparent 47%, currentColor 48% 57%, transparent 58%);
}

.glyph-wallet::before {
  width: 52%;
  height: 38%;
  border-radius: 7px;
  border-width: 3px;
  box-shadow: inset -12px 0 0 rgba(255, 255, 255, .32);
}

.app-name {
  display: block;
  margin-top: 7px;
  color: var(--smart-text);
  font-size: clamp(11px, 3.2vw, 13px);
  font-weight: 650;
  line-height: 1.15;
  text-shadow:
    0 1px 1px rgba(0, 0, 0, .4),
    0 0 6px rgba(0, 52, 105, .2);
  max-width: 92%;
  overflow-wrap: anywhere;
}

.dock {
  position: relative;
  z-index: 3;
  height: 92px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 7px;
  padding: 9px 24px 14px;
  background: linear-gradient(180deg, rgba(24, 140, 221, .06), rgba(0, 73, 140, .28));
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.dock::after {
  content: "";
  position: absolute;
  left: 26%;
  right: 26%;
  bottom: 5px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .72), rgba(255, 255, 255, .1));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .12);
}

.dock .app-button {
  height: 72px;
  padding-bottom: 11px;
}

.dock .app-name {
  display: none;
}

.dock .app-icon {
  width: 54px;
  height: 54px;
}

.launcher-controls {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  display: grid;
  grid-template-columns: 58px 1fr 52px 58px;
  align-items: center;
  padding: 0 6px;
}

.edge-btn {
  width: 38px;
  height: 38px;
  margin: 0 auto;
  border-radius: 50%;
  background: rgba(0, 0, 0, .08);
  opacity: .75;
}

.edge-btn::before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  margin: 13px auto;
  border-top: 2px solid rgba(255, 255, 255, .78);
  border-left: 2px solid rgba(255, 255, 255, .78);
}

.prev::before {
  transform: rotate(-45deg);
}

.next::before {
  transform: rotate(135deg);
}

.edge-btn:disabled {
  opacity: .18;
  cursor: default;
}

.dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .42);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}

.dot.active {
  background: #fff;
}

.mode-btn {
  width: 32px;
  height: 32px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 3px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(6, 57, 108, .26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    0 1px 2px rgba(0, 0, 0, .18);
}

.mode-btn span {
  border-radius: 3px;
  background: rgba(255, 255, 255, .88);
}

.launcher[data-mode="overview"] .desktop {
  height: calc(100% - 128px);
  padding: 14px 12px 6px;
}

.launcher[data-mode="overview"] .pages-track {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 9px;
  transform: none;
}

.launcher[data-mode="overview"] .page {
  min-width: 0;
  width: 100%;
  height: 100%;
  flex: initial;
  padding: 2px;
  gap: 2px;
  border-radius: 7px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(71, 178, 248, .66), rgba(20, 124, 206, .76)),
    var(--smart-blue);
  border: 1px solid rgba(4, 67, 122, .62);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .19),
    inset -1px -1px 0 rgba(0, 45, 94, .34);
}

.launcher[data-mode="overview"] .page::before {
  content: "";
  position: absolute;
  inset: 0;
}

.launcher[data-mode="overview"] .cell::before {
  border-color: rgba(5, 77, 142, .42);
}

.launcher[data-mode="overview"] .app-button {
  padding: 2px;
}

.launcher[data-mode="overview"] .app-icon {
  width: clamp(24px, 8vw, 43px);
  height: clamp(24px, 8vw, 43px);
}

.launcher[data-mode="overview"] .app-name {
  display: none;
}

.launcher[data-mode="overview"] .dock {
  height: 58px;
  padding: 4px 68px 10px;
}

.launcher[data-mode="overview"] .dock .app-icon {
  width: 35px;
  height: 35px;
}

.launcher[data-mode="overview"] .mode-btn {
  background: rgba(255, 255, 255, .28);
}

.app-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

.app-layer.active {
  pointer-events: auto;
}

.app-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 12, 22, .34);
  backdrop-filter: blur(8px);
}

.app-window {
  width: min(92vw, 420px);
  max-height: min(82dvh, 720px);
  overflow: hidden;
  border-radius: 12px;
  background: var(--paper);
  color: var(--paper-text);
  box-shadow:
    0 28px 72px rgba(0, 0, 0, .38),
    inset 0 1px 0 rgba(255, 255, 255, .88);
  border: 1px solid rgba(44, 40, 34, .3);
  animation: windowIn .22s cubic-bezier(.17, .86, .3, 1);
}

@keyframes windowIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.window-titlebar {
  height: 45px;
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  align-items: center;
  background:
    linear-gradient(180deg, #faf8f2, #d8d1c5 55%, #b6aea1);
  border-bottom: 1px solid #8f877b;
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(255, 255, 255, .28);
  color: #36322d;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
}

.close-btn {
  width: 30px;
  height: 30px;
  margin-left: 9px;
  border-radius: 50%;
  background: linear-gradient(#f6f1e9, #b6ada0);
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0, 0, 0, .24);
  color: #3d3832;
}

.close-btn::before,
.close-btn::after {
  content: "";
  position: absolute;
}

.close-btn {
  position: relative;
}

.close-btn::before,
.close-btn::after {
  left: 9px;
  top: 14px;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.close-btn::before {
  transform: rotate(45deg);
}

.close-btn::after {
  transform: rotate(-45deg);
}

.window-body {
  max-height: calc(min(82dvh, 720px) - 45px);
  overflow: auto;
  padding: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, 0) 34%),
    var(--paper);
}

.search-form {
  display: grid;
  grid-template-columns: 1fr 74px;
  gap: 8px;
  margin-bottom: 12px;
}

.search-form input {
  min-width: 0;
  height: 38px;
  border-radius: 5px;
  border: 1px solid #a69d91;
  background: #fffdf8;
  padding: 0 11px;
  color: #2f2b26;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, .13);
}

.smart-btn {
  height: 38px;
  border-radius: 5px;
  background: linear-gradient(#f9f5eb, #c9beb0);
  border: 1px solid #93887c;
  box-shadow: inset 0 1px 0 #fff, 0 1px 1px rgba(0, 0, 0, .18);
  color: #332f2a;
  font-size: 13px;
  font-weight: 700;
}

.list {
  display: grid;
  gap: 8px;
}

.row {
  min-height: 48px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .58);
  border: 1px solid rgba(141, 128, 112, .42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

.row-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(145deg, #47b5f4, #1671bb);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .44), 0 1px 2px rgba(0, 0, 0, .18);
}

.row-title {
  font-size: 14px;
  font-weight: 700;
}

.row-sub {
  margin-top: 3px;
  color: #766d63;
  font-size: 12px;
  line-height: 1.35;
}

.meta-grid {
  display: grid;
  gap: 8px;
}

.meta-item {
  display: grid;
  grid-template-columns: 98px 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .56);
  border: 1px solid rgba(141, 128, 112, .38);
  font-size: 13px;
}

.meta-item b {
  color: #544c42;
}

.empty {
  color: #756d62;
  text-align: center;
  padding: 24px 10px;
  font-size: 13px;
}

.about-logo {
  width: 76px;
  height: 76px;
  display: block;
  margin: 5px auto 14px;
}

.about-title {
  text-align: center;
  font-size: 23px;
  font-weight: 300;
  letter-spacing: 2px;
  margin-bottom: 7px;
}

.about-sub {
  text-align: center;
  color: #7f7770;
  font-size: 13px;
  margin-bottom: 15px;
}

@media (max-width: 520px) {
  :root {
    --screen-w: 100vw;
    --screen-h: 100dvh;
  }

  body {
    background: #111;
  }

  .stage {
    padding: 0;
  }

  .device {
    min-height: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }

  .device::before {
    display: none;
  }

  .launcher {
    border-radius: 0;
  }

  .desktop {
    height: calc(100% - 156px);
    padding-inline: 0;
  }

  .page {
    padding-inline: 0;
    gap: 0;
  }

  .app-icon {
    width: clamp(48px, 14.5vw, 66px);
    height: clamp(48px, 14.5vw, 66px);
  }

  .dock {
    height: 86px;
    padding-inline: 22px;
  }

  .app-overlay {
    padding: 0;
  }

  .app-window {
    width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
  }

  .window-body {
    max-height: calc(100dvh - 45px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
