@font-face {
  font-family: "absuifont";
  src: url("/fonts/ui/Genos-Medium.ttf");
}

@font-face {
  font-family: "absnamefont";
  src: url("/fonts/generic/FiraSansCondensed-Medium.ttf");
  font-display: swap;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Fira Sans Condensed", "Open Sans SemiCondensed", "absnamefont", sans-serif;
  background-color: #fff;
  color: #333;
}

#Control {
  background-color: #fff;
  border: 5px solid #5e8dcf;
  padding: 6px;
  position: sticky;
  inset: 0px;
}

.ctlbtn, .uibtn {
  display: inline-block;
  background-color: transparent;
  border: 3px solid #5e8dcf;
  border-radius: 6px;
  padding-left: 0.85em;
  padding-right: 0.85em;
  cursor: pointer;
  font-size: 120%;
  font-weight: bold;
  margin: 2px auto;
  font-family: "Genos", "absuifont", sans-serif;
}

.ctlbtn img {
  height: 1em;
  vertical-align: text-top;
}

#CurrentPath {
  display: block;
  border: 3px solid #5e8dcf;
  border-radius: 6px;
  padding-left: 0.25em;
  padding-right: 0.25em;
  font-family: monospace;
  font-size: 120%;
  margin-bottom: 8px;
  width: 100%;
  box-sizing: border-box;
}

#FileList {
  display: flex;
  flex-flow: row wrap;
}

#FileList .file_item {
  flex: 0 1 200px;
  text-align: center;
  cursor: pointer;
}

.file_item img {
  height: 120px;
  width: 120px;
}

#Player video {
  max-width: 100%;
  max-height: 70vh;
  width: 100%;
  margin: auto;
}

#Player audio {
  width: 100%;
}

#PlayListControl {
  margin: 10px 10px 0px 10px;
}

#PlayListControl img {
  height: 1.8em;
  margin: auto 0.25em;
  cursor: pointer;
}

#PlayList {
  margin: 3px 10px 10px 10px;
  padding: 3px;
  border: 3px solid #5e8dcf;
  border-radius: 6px;
  max-height: 150px;
  overflow: auto;
  overflow-x: hidden;
}

#PlayList > div {
  border-bottom: 1px solid #5e8dcf;
}

#PlayList .current_playitem {
  background-color: #b1cff9;
}

#PlayList .current_playitem, #PlayList .noncurrent_playitem {
  cursor: pointer;
}

#MsgBox {
  position: fixed;
  bottom: 10px;
  right: 10px;
  padding: 0.55em;
  border-radius: 4px;
}

.msgshow_err {
  opacity: 1;
  background-color: #f7d8ea;
}

.msgshow_info {
  opacity: 1;
  background-color: #d8f0f7;
}

.msgtrans {
  opacity: 0;
  transition: opacity 3s ease-in;
}

.msghide {
  display: none;
}

.filename, #MsgBox div {
  word-break: break-all;
}

#CoverImage {
  text-align: center;
}

#CoverImage img {
  height: 400px;
  max-width: 100%;
  max-height: 40vh;
}

#TextViewerBox {
  display: none;
  position: fixed;
  top: 0px;
  left: 0px;
  z-index: 15000;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  grid-template-rows: 42px 1fr;
}

#TextViewerCloseBox {
  background-color: #fff;
  text-align: center;
  padding-top: 2px;
}

#TextViewerCloseBtn {
  font-size: 24px;
  background-color: #fff;
  border: 3px solid #5e8dcf;
  border-radius: 6px;
  cursor: pointer;
}

#TextViewerCloseBtn img {
  height: 24px;
}

#TextViewer {
  height: 100%;
  width: 100%;
  font-family: "Cascadia Code", "Cascadia Mono", "Consolas", "Meslo", monospace, sans-serif;
  overflow: auto;
  resize: none;
  font-size: 1rem;
}

#ImgViewer {
  display: none;
  position: fixed;
  top: 0px;
  left: 0px;
  z-index: 15000;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #fffffff0;
}

#ImgViewerFigure {
  margin: 0 auto;
  padding: 0;
}

#ImgViewerFigure img {
  height: 100%;
  width: 100%;
  max-height: 100vh;
  max-width: 100vw;
  object-fit: contain;
}

#BookReaderBox {
  position: fixed;
  top: 0px;
  left: 0px;
  width: 100vw;
  height: 100vh;
  z-index: 20000;
  background-color: #f8f8f4;
  display: none;
}

#BookReaderOptionModalBox {
  position: fixed;
  top: 0px;
  left: 0px;
  width: 100vw;
  height: 100vh;
  z-index: 21000;
  background-color: transparent;
  display: none;
}

#BookReaderOptionModal {
  position: fixed;
  top: 0px;
  left: 0px;
  width: 100vw;
  height: 33vh;
  z-index: 21500;
  background-color: #00000099;
  overflow: auto;
  box-sizing: border-box;
  padding: 15px;
}

#BookReaderCanvas {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.fade-out {
  opacity: 0;
}

#ProgressWrapper {
  position: fixed;
  top: 0px;
  left: 0px;
  width: 100vw;
  height: 100vh;
  background-color: #000000f0;
}

#NowLoading {
  font-size: min(250%, 7vw);
  position: absolute;
  right: 30px;
  bottom: 30px;
  color: #fff;
  opacity: 0;
  animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.loading_text::after {
  content: "...";
  animation: blink 0.5s infinite ease-in-out;
}

@keyframes blink {
  0% {opacity: 0.2;}
  100% {opacity: 1;}
}

@media screen and (max-width: 600px) {
  #FileList .file_item {
    flex: 1 1 120px;
    text-align: center;
    cursor: pointer;
  }
  
  .file_item img {
    height: 100px;
    width: 100px;
  }

  .filename {
    font-size: 90%;
  }

  .ctlbtnlabel {
    display: none;
  }
}

#LoginScreen {
  z-index: 30000;
  background-color: #fffffffa;
  position: fixed;
  width: 100dvw;
  height: 100dvh;
  top: 0;
  left: 0;
  display: none;
}

#LoginBasicForm {
  margin: auto;
  width: max-content;
  line-height: 2.2;
}

.formerrmsg {
  border: 0px none;
  outline: 0px none;
  color: #ff3648;
  font-weight: bold;
}

@media screen and (prefers-color-scheme: dark) {
  body {
    background-color: #1f1f24;
    color: #ffffff;
  }

  #Control {
    background-color: #1f1f24;
  }

  .svgicon {
    filter: invert(93%) sepia(7%) saturate(461%) hue-rotate(183deg) brightness(95%) contrast(95%);
  }

  input {
    background-color: transparent;
    color: #ffffff;
  }

  #PlayList .current_playitem {
    background-color: #09244a;
  }

  #LoginScreen {
    background-color: #000000ec;
    color: #fff;
  }

  .form_input_text {
    border: 0px none;
    outline: 0px none;
    border-bottom: #5e8dcf 2px solid;
  }

  .ctlbtn, .uibtn {
    color: #fff;
  }
}