html,
body,
input,
dialog,
p,
div {
  margin: 0;
  padding: 0;
  border: none;
  box-sizing: border-box;
}

@font-face {
  font-family: 'icon';
  font-style: normal;
  font-weight: 100 700;
  src: url(./fonts/font.woff2) format('woff2');
}

.ic {
  font-family: 'icon';
  font-weight: normal;
  font-style: normal;
  font-size: var(--i-size, 24px);
  line-height: 1;
  letter-spacing: normal;
  display: inline-block;
  white-space: nowrap;
  pointer-events: none;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 22;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

:root {
  --main-color: #568cff;
  overflow-y: hidden;
}

@property --r {
  syntax: '<length>';
  inherits: false;
  initial-value: 300px;
}

body {
  font-family: system-ui;
  scroll-timeline: --page block;
  /* overscroll-behavior-y: contain; */
  background: var(--surfaceContainer);
  color: var(--onSurface);
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
}

.main {
  --scale: calc(1 / var(--bi-wallpaper-scale));
  --aspect-ratio: var(--bi-SP-aspect-ratio, 1);
  position: relative;
  z-index: 1;
  height: calc(100vw / (var(--aspect-ratio)));
  transition: all ease-in-out .3s;
  overflow: hidden;
  background: var(--bd-bg-color);

  &.prev {
    --scale: 1
  }
}

#box {
  position: relative;
  margin: 0 auto;
  width: 100%;
  aspect-ratio: var(--aspect-ratio);
  user-select: none;
  transition: all .3s ease-in-out;
  overflow: hidden;
  transform-origin: bottom center;
}

.unlock {
  transform: scale(.9);

  #bg {
    z-index: 10;
  }

  .img {
    touch-action: none;
  }
}

.ani {
  animation: zoom 1 both linear;
  animation-timeline: --page;
}

@keyframes zoom {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(.44);
  }
}

.br {
  filter: brightness(calc(1 / var(--bi-lockscreen-drim)));
}

.disabled {
  filter: brightness(.8);
  pointer-events: none;
}

.hide {
  opacity: 0;
}

#container,
#mock,
#preview {
  --r: var(--bi-radius);
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: var(--aspect-ratio);
  transform: scale(var(--scale));
  transition: all ease-in-out .3s;
}

#preview {
  --sb-height: var(--bi-sb-height);
  --sb-top: var(--bi-sb-top);
  --sb-offset-x: var(--bi-sb-offset-x);
  --sc-size: var(--bi-sc-size);
  --sc-bottom: var(--bi-sc-bottom);
  --sc-offset-x: var(--bi-sc-offset-x);
  --sc-bg-color: var(--bi-sc-bg-color);
  --fp-size: var(--bi-fp-size);
  --fp-bottom: var(--bi-fp-bottom);
  --fp-offset-x: var(--bi-fp-offset-x);
  --fp-bg-color: var(--bi-fp-bg-color);
  z-index: 10;
  color: #fff;
  pointer-events: none;
  backdrop-filter: brightness(var(--bi-lockscreen-drim));

  .ptime {
    --t-top: 0px;
    --t-height: 200px;
    --t-x: 281 / 120;
    --t-size: 120px;
    --t-left: 61px;
    margin-top: calc(var(--sb-top) * 2 + var(--sb-height));
    margin-left: var(--t-left);
    padding-top: var(--t-top);
    color: var(--main-color);
    line-height: var(--t-height);
    height: var(--t-height);
    font-size: var(--t-size);
    width: calc(var(--t-x) * var(--t-size));
    overflow: hidden;
  }

  .pdata {
    margin-left: 64px;
  }

  .hole {
    top: var(--bi-hole-top);
    left: calc(50vw - var(--bi-hole-size) / 2);
    width: var(--bi-hole-size);
    aspect-ratio: 1;
    background: #000;
  }

  .psb {
    --gap: 4px;
    --i-size: 20px;
    font-size: 14px;
    background: transparent;
    opacity: 1;
  }

  .batt {
    --i-size: 29px;
  }

  .psc,
  .pfp {
    --i-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    color: #000;
  }

  .pfp {
    --i-size: 36px;
    line-height: var(--fp-size);
  }
}

#container {
  pointer-events: all;
  background: var(--bd-bg-color);
  z-index: 10;
}

#bd {
  --r: var(--bi-radius);
  width: 100%;
  height: 100%;
  z-index: var(--bd-z-index);
  border: var(--bd-width) solid var(--bd-color);
}

#hm {
  --r: var(--hm-radius);
  z-index: calc(var(--sb-z-index) + 1);
  top: calc(var(--bi-hole-size) / 2 + var(--bi-hole-top) - var(--hm-hight) / 2);
  left: calc(50% - var(--hm-width) / 2);
  width: var(--hm-width);
  height: var(--hm-hight);
  background: var(--hm-bg-color);
}

#bg {
  --r: var(--bg-radius);
  opacity: var(--bg-opacity);
  height: var(--bg-height);
  left: var(--bg-offset-x);
  right: var(--bg-offset-x);
  top: var(--bg-top);
  background: var(--bg-color);
  filter: blur(var(--bg-blur));
  overflow: hidden;
}

.img {
  height: 100%;
  transform-origin: 0 0;
  background: url('../w.png') center/contain no-repeat;
  transform: var(--bg-SP-trans);
}

#cd {
  --r: var(--cd-radius);
  opacity: var(--cd-opacity);
  height: var(--cd-height);
  left: var(--cd-offset-x);
  right: var(--cd-offset-x);
  top: var(--cd-top);
  background: var(--cd-bg-color);
  backdrop-filter: blur(var(--cd-blur));
}

#sb,
.psb {
  --r: var(--sb-radius);
  opacity: var(--sb-opacity);
  height: var(--sb-height);
  left: var(--sb-offset-x);
  right: var(--sb-offset-x);
  top: var(--sb-top);
  background: var(--sb-bg-color);
  backdrop-filter: blur(var(--sb-blur));
  z-index: var(--sb-z-index);
}

.pfp,
#fp {
  opacity: var(--fp-opacity);
  height: var(--fp-size);
  aspect-ratio: 1;
  bottom: var(--fp-bottom);
  left: var(--fp-offset-x);
  background: var(--fp-bg-color);
  backdrop-filter: blur(var(--fp-blur));
}

.psc,
.shortcuts {
  opacity: var(--sc-opacity);
  bottom: var(--sc-bottom);
  width: var(--sc-size);
  aspect-ratio: 1;
  background: var(--sc-bg-color);
  backdrop-filter: blur(var(--sc-blur));
  left: var(--sc-offset-x);

  &.other {
    left: unset;
    right: var(--sc-offset-x);
  }
}

#console {
  --trans-y: -30vh;
  --r: 16px;
  display: flex;
  flex-direction: column;
  position: absolute;
  z-index: 10;
  bottom: var(--trans-y);
  width: 100%;
  height: calc(-1 * var(--trans-y));
  padding: 16px;
  background: rgb(from var(--surfaceContainerHighest) r g b /.8);
  transition: transform ease-in-out 0.3s;

  &.swap {
    --trans-y: 40vh;
    bottom: unset;
    top: calc(-1 * var(--trans-y));
    height: var(--trans-y);

    #swapBtn {
      --h: 8vh;
    }
  }
}

#swapBtn {
  --h: 32px;
  height: var(--h);
  line-height: var(--h);
}

#form {
  --btn-h: 100%;
  padding: 8px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;

  .items {
    display: flex;
    align-items: center;
    gap: 6px;

    span {
      min-width: 120px;
    }

    input {
      --r: 12px;
      height: 32px;
      width: 100px;
      flex: 5;
      text-indent: 8px;
      background: #0000;
    }
  }
}

.pack {
  --trans-y: -68px;
  transition: transform ease-in-out 0.3s;
  padding: 8px 0;
}

.test {
  border-radius: var(--bi-radius);
  outline: 99px solid green;
}

#list {
  --r: 24px;
  height: 60px;
  padding: 8px;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  margin: 0 8px 8px;
  background: var(--secondaryContainer);
  /* mask-image: linear-gradient(to right, #0001 0, #000 20px, #000 calc(100% - 20px), #0001 100%); */
  /* mask-repeat: no-repeat; */
  /* mask-size: 100% 100%; */

  .label {
    --btn-h: 100%;
    --btn-bg: #0000;
    --btn-color: var(--onSecondaryContainer);
    --b-color: var(--btn-color);
    border: 1px solid var(--b-color);

    &.actived {
      --r: 100px;
      --btn-bg: var(--secondary);
      --b-color: var(--btn-bg);
      color: var(--onSecondary);
    }
  }
}

.pages {
  display: flex;
  align-items: flex-start;
  overflow-x: hidden;
  /* scroll-snap-type: x mandatory; */

  .page {
    --btn-bg: var(--secondaryContainer);
    --btn-color: var(--onSecondaryContainer);
    padding: 0 16px;
    flex: 0 0 100%;
    /* scroll-snap-align: start; */
  }
}

.combine {
  --gap: 4px;

  :nth-child(2) {
    --r: 100px;
    --btn-bg: var(--secondary);
    --btn-color: var(--onSecondary);
  }
}

.upload {
  input {
    display: none;
  }
}

.btn {
  --r: 16px;
  display: flex;
  flex: auto;
  white-space: nowrap;
  user-select: none;
  padding: 12px;
  background: var(--btn-bg);
  color: var(--btn-color);
  transition: all ease .3s;
  height: var(--btn-h);
  align-items: center;
  justify-content: center;

  &:active {
    --r: var(--btn-active-r, 8px);
  }
}

.actived {
  font-weight: 500;
  color: var(--main-color);

  i {
    font-variation-settings: 'FILL' 1;
  }
}

#saves {
  height: 160px;
  overflow-y: auto;
  margin: 8px 0;

  &:empty::before {
    display: block;
    text-align: center;
    content: 'No record';
  }
}

.record {
  padding: 8px;

  p {
    &:active {
      color: var(--main-color);
    }
  }
}

.board {
  --trans-y: -168px;
  position: relative;
  transition: transform ease-in-out 0.3s;
}

.cover {
  transform: translateY(var(--cover-y));
}

.toolbar {
  --offset: 8px;
  display: flex;
  top: var(--offset);
  right: var(--offset);
}

.g {
  display: flex;
  flex-wrap: wrap;
}

.end {
  border-bottom: .5px solid var(--outline);
}

.a {
  position: absolute;
}

.b {
  font-weight: 500;
}

.c {
  text-align: center;
}

.cc {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.r,
.btn {
  border-radius: var(--r);
}

._s {
  --r: 12px;
  --btn-active-r: 4px;
  padding: 4px 8px;
  border: 1px solid currentColor;
}

.gap {
  gap: var(--gap, 8px);
}

.hs {
  &::-webkit-scrollbar {
    display: none;
  }
}

#codeBox {
  --btn-bg: var(--secondary);
  --btn-color: var(--onSecondary);
  display: block;
  min-height: 160px;
  white-space: break-spaces;
}

#tab,
#notif {
  --offset: max((var(--bi-radius) - 16px) / 2, 12px);
  --dr: max(var(--bi-radius) - var(--offset), 14px);
  --h: max(var(--dr) * 2, 64px);
  position: fixed;
  display: flex;
  align-items: center;
}

#tab {
  --i-size: calc(var(--h) / 2.5);
  inset: auto var(--offset) var(--offset);
  z-index: 20;
  animation: scroll 1 both linear;
  animation-timeline: --page;
  animation-range: 0% 30%;

  .btn {
    padding: 0;
  }

  #tabList {
    --gap: 8px;
    --r: var(--dr);
    --btn-color: var(--onPrimaryContainer);
    background: var(--primaryContainer);
    height: var(--h);
    padding: var(--gap);
    flex: 1;

    .actived {
      --r: calc(var(--dr) - var(--gap));
      --btn-bg: var(--primary);
      color: var(--onPrimary);
    }
  }

  .fab {
    box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 1px -1px, rgba(0, 0, 0, 0.14) 0px 1px 1px 0px, rgba(0, 0, 0, 0.12) 0px 1px 3px 0px;
  }

  #edit {
    --r: var(--dr);
    --btn-bg: var(--tertiary);
    --btn-color: var(--onTertiary);
    --offset: 10px;
    height: var(--h);
    aspect-ratio: 1;
    bottom: calc(var(--h) + var(--offset));
    right: var(--offset);
  }
}

@keyframes scroll {
  from {
    transform: translateY(180px);
  }

  to {
    transform: translateY(0px);
  }
}

#notif {
  --r: var(--dr);
  --top: -100px;
  --trans-y: calc(var(--top) - var(--offset));
  justify-content: center;
  inset: auto var(--offset) var(--top);
  z-index: 30;
  min-height: var(--h);
  padding: 16px 24px;
  color: var(--noti-color, var(--onSurface));
  background: rgb(from var(--noti-bg, var(--surfaceContainerHigh)) r g b/0.8);
  backdrop-filter: blur(8px);
  transition: transform ease-in-out 0.3s;
}

.tip {
  --noti-bg: var(--tertiary);
  --noti-color: var(--onTertiary);
}

.err {
  --noti-color: var(--onError);
  --noti-bg: var(--error);
}

.slide {
  transform: translateY(var(--trans-y));
}