:root {
  color-scheme: dark;
  --page: rgb(32, 33, 36);
  --surface: #2f3640;
  --surface-active: #242a32;
  --text: rgb(189, 193, 198);
  --text-muted: #91979e;
  --link: rgb(138, 180, 248);
  --line: rgba(255, 255, 255, .2);
}

@font-face {
  font-family: 'Qiafan Font';
  src: url('./assets/1.woff2') format('woff2');
  font-display: swap;
}

* { box-sizing: border-box; }

html {
  background: var(--page);
  font-size: 100%;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--page);
  color: var(--text);
  font: 0.9375rem/1.6 'Qiafan Font', Arial, sans-serif;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover { color: #adbff0; }

button, textarea, input { font: inherit; }

button { color: inherit; }

.main-box {
  display: flex;
  flex-direction: column;
  width: 960px;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 3px;
  margin-bottom: 30px;
}

.nav-bar h1 {
  margin: 0;
  padding: 0;
  font-size: 2rem;
  line-height: normal;
}

.nav-bar h1 a,
.nav-bar span a {
  color: var(--text);
}

.nav-bar span a,
.nav-bar span button {
  display: inline-block;
  margin: 0 2px;
  padding: 5px 10px;
  border-radius: 4px;
  background: var(--surface);
  color: #f5f6fa;
  font-size: 1rem;
  text-align: center;
}

.nav-bar span button {
  border: 0;
  cursor: pointer;
}

.nav-bar span a:hover,
.nav-bar span button:hover { background: #3a424d; }
.nav-bar span a:active,
.nav-bar span button:active { background: var(--surface-active); }

.info {
  flex: 1;
  padding-top: 16px;
  font-size: 1.125rem;
}
body.file-manager-active .info {
  flex: 0 0 auto;
}

.file-manager {
  flex: 1;
  padding-top: 16px;
}
.file-manager h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
  color: #e1e1e1;
  font-size: 1.5rem;
}
.file-manager h2 > span {
  font-family: inherit;
  color: #aaa;
}
.file-manager-title-icon {
  width: 2rem;
  height: 2rem;
  filter: invert(70%);
}
.file-manager-title-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.file-manager-title-button:hover .file-manager-title-icon { filter: invert(85%); }
.current-path {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: .875rem;
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}
.path-item {
  display: inline-flex;
  align-items: center;
  gap: .25em;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--link);
  cursor: pointer;
  font: inherit;
  overflow-wrap: anywhere;
}
.path-home-icon {
  display: inline-block;
  flex: 0 0 1.2em;
  width: 1.2em;
  height: 1.2em;
  background-color: currentColor;
  -webkit-mask: url('./assets/icons/house-regular-full.svg') center / contain no-repeat;
  mask: url('./assets/icons/house-regular-full.svg') center / contain no-repeat;
}
.path-item:hover { color: #adbff0; }
.path-separator { color: #666; }
.file-list {
  display: grid;
  gap: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}
.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.file-item:hover { background: #3a424d; }
.file-item-folder { cursor: pointer; }
.file-icon {
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  object-fit: contain;
}
.folder-icon { position: relative; }
.folder-icon img { position: absolute; inset: 0; width: 88px; height: 88px; object-fit: contain; }
.folder-icon .folder-back { z-index: 1; }
.folder-icon .folder-empty { z-index: 2; width: 58px; height: 58px; margin: 15px; }
.folder-icon .folder-front { z-index: 3; }
.file-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.file-size {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-family: Consolas, monospace;
  font-size: .875rem;
}
.file-list-empty {
  color: var(--text-muted);
  text-align: center;
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}
.file-list-pagination {
  display: flex;
  justify-content: center;
  margin-top: 18px;
  font-family: inherit;
}
.file-list-no-more { color: var(--text-muted); }
.file-manager-extra-content {
  width: 100%;
  min-height: 250px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 6px;
  height: 250px;
  transition: height .24s ease, margin-top .24s ease;
}
.file-manager-extra-content.is-collapsing {
  height: 0;
  min-height: 0;
  margin-top: 0;
}
.file-manager-extra-content iframe {
  display: block;
  width: 100%;
  height: 250px;
  border: 0;
  transition: height .24s ease;
}
.file-manager-extra-content.is-collapsing iframe {
  height: 0;
}
.file-operation-dialog {
  width: min(480px, calc(100vw - 32px));
  padding: 24px;
}
.file-operation-dialog > strong {
  display: block;
  padding: 0 2.5rem 20px 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-weight: 600;
  line-height: 1.6;
}
.file-operation-dialog > strong > span {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}
.file-operation-content {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.file-operation-preview {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}
.file-operation-preview img {
  display: block;
  width: min(180px, 100%);
  height: 180px;
  object-fit: contain;
  border-radius: 4px;
}
.file-operation-actions {
  display: flex;
  flex: 0 0 120px;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 10px;
}
.file-operation-actions .primary-button { width: 100%; }
.file-operation-actions .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.file-operation-actions .primary-button[hidden],
.file-operation-tip[hidden] {
  display: none !important;
}
.file-operation-action-icon {
  width: 1em;
  height: 1em;
  filter: invert(50%);
}
.download-box {
  position: absolute;
  left: -100px;
  top: -100px;
  width: 1px;
  height: 1px;
}
.image-dialog {
  width: calc(100vw - 32px);
  height: calc(100vh - 32px);
  max-width: none;
  max-height: none;
  padding: 24px;
  border: 1px solid #2f3437;
  border-radius: 6px;
}
.image-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: image-dialog-zoom .2s ease-out both;
}
.image-dialog::backdrop { background: rgba(0, 0, 0, .9); }
.image-dialog-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
  margin-bottom: 48px;
}
.image-dialog-header h2 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 16px 0 0;
  padding: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: #e1e1e1;
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 1.375rem;
  line-height: 1.6;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.image-dialog-header .dialog-close {
  position: static;
  flex: 0 0 auto;
  padding: 0;
}
.image-dialog-content {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
  height: auto;
  overflow: auto;
}
.image-dialog-content img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.video-dialog {
  width: 60vw;
  max-width: 60vw;
  min-height: 0;
}
.video-dialog[open] {
  display: flex;
  flex-direction: column;
}
.video-dialog-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
  margin-bottom: 24px;
}
.video-dialog-header h2 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 16px 0 0;
  padding: 0;
  overflow: hidden;
  color: #e1e1e1;
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 1.375rem;
  line-height: 1.6;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-dialog-header .dialog-close {
  position: static;
  flex: 0 0 auto;
  padding: 0;
}
.video-dialog-content {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  background: #000;
}
.video-dialog-content .plyr {
  width: 100%;
}
.video-dialog-content video {
  display: block;
  width: 100%;
  max-width: 100%;
}
.file-operation-tip { display: block; }
.file-operation-tip p {
  margin: 12px 0 0;
  padding: 4px;
  color: orange;
  font-size: .9em;
}
.button-spinner {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  border: .16em solid #666;
  border-top-color: #f5f6fa;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  vertical-align: -.18em;
}
.primary-button.is-loading { cursor: wait; }

.info h2 {
  display: inline-block;
  margin: 0 0 10px;
  padding: 0;
  color: #e1e1e1;
  font-size: 1.375rem;
}

.notice-list {
  margin: 10px 0 20px;
  padding-left: 24px;
}

.notice-list li { padding: 2px 0; }

.download-form { margin-top: 18px; }

textarea {
  display: block;
  width: 100%;
  min-height: 210px;
  padding: 10px;
  border: 1px solid #2f3437;
  border-radius: 4px;
  outline: none;
  background: #202020;
  color: var(--text);
  resize: vertical;
}

#download-uri {
  min-height: 210px;
  font-size: 2.0rem;
  overflow-wrap: anywhere;
  word-break: break-all;
}

textarea::placeholder { color: #666; }
textarea:focus { border-color: #3f4447; }

.drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  margin: 10px 0;
  border: 1px dotted #555;
  border-radius: 4px;
  color: #9b9b9b;
  cursor: pointer;
}

.drop-zone:hover {
  background: rgba(255, 255, 255, .06);
  color: var(--text);
}

.drop-zone input { display: none; }
.drop-icon { width: 16px; height: 16px; filter: invert(50%); }

.button-line {
  display: flex;
  justify-content: center;
}

.primary-button {
  min-width: 78px;
  padding: 7px 16px;
  border: 1px solid #333;
  border-radius: 4px;
  background: var(--surface);
  color: #f5f6fa;
  cursor: pointer;
}

.primary-button:hover { background: linear-gradient(rgba(255, 255, 255, .06), rgba(255, 255, 255, .06)), var(--surface); }
.primary-button:active { background: var(--surface-active); }

dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: fit-content;
  min-width: min(360px, calc(100vw - 32px));
  min-height: 160px;
  max-width: calc(100vw - 32px);
  padding: 24px;
  border: 1px solid #2f3437;
  border-radius: 6px;
  background: #222;
  color: var(--text);
  font-size: 1rem;
  transform-origin: center;
}

dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog[open] { animation: dialog-pop .18s cubic-bezier(.34, 1.56, .64, 1) both; }
dialog h2 {
  margin: 0 0 12px;
  padding: 0;
  color: #e1e1e1;
  font-size: 1.375rem;
  line-height: 1;
}
dialog p { color: #9b9b9b; }
dialog input { width: 100%; margin: 10px 0 16px; padding: 8px 10px; border: 1px solid #2f3437; border-radius: 4px; background: #202020; color: var(--text); }
.dialog-close { position: absolute; top: 24px; right: 14px; border: 0; background: transparent; color: #7f7f7f; cursor: pointer; font-size: 1.5rem; line-height: 1; }
.dialog-close:hover { color: var(--text); }
#purchase-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: fit-content;
  min-width: min(360px, calc(100vw - 32px));
  min-height: 160px;
  max-width: calc(100vw - 32px);
  padding: 24px;
  border: 1px solid #2f3437;
  border-radius: 6px;
  background: #222;
  color: var(--text);
  transform-origin: center;
}
#purchase-dialog::backdrop { background: rgba(0, 0, 0, .6); }
#purchase-dialog[open] { animation: dialog-pop .18s cubic-bezier(.34, 1.56, .64, 1) both; }
#purchase-dialog h2 { color: #e1e1e1; font-size: 1.375rem; }
#purchase-dialog p { color: #9b9b9b; }
#purchase-dialog input {
  width: 100%;
  margin: 10px 0 16px;
  padding: 8px 10px;
  border: 1px solid #2f3437;
  border-radius: 4px;
  background: #202020;
  color: var(--text);
}
#purchase-dialog .dialog-close {
  position: absolute;
  top: 24px;
  right: 14px;
  border: 0;
  background: transparent;
  color: #7f7f7f;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}
#purchase-dialog .code-qr-trigger { display: flex; justify-content: center; margin: 12px 0 16px; }
#purchase-dialog .show-qr-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid #333;
  border-radius: 4px;
  background: var(--surface);
  color: #f5f6fa;
  cursor: pointer;
}
#purchase-dialog .code-tips { margin: 16px 0; padding-left: 22px; color: var(--text); font-size: 1rem; }
#purchase-dialog .code-tips li { padding: 3px 0; }
#purchase-dialog .pay-tips { margin: 8px 0 14px; text-align: center; font-size: .875rem; }
#purchase-dialog .code-form { display: flex; align-items: flex-start; gap: 10px; }
#purchase-dialog .code-form .primary-button { flex: 0 0 auto; margin-left: auto; }
.code-qr-trigger { display: flex; justify-content: center; margin: 12px 0 16px; }
.show-qr-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid #333;
  border-radius: 4px;
  background: var(--surface);
  color: #f5f6fa;
  cursor: pointer;
}
.show-qr-button:hover { background: linear-gradient(rgba(255, 255, 255, .06), rgba(255, 255, 255, .06)), var(--surface); }
.show-qr-button:active { background: var(--surface-active); }
.show-qr-button img { width: 1em; height: 1em; filter: invert(50%); }
.qr-dialog {
  flex-direction: column;
  width: min(480px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 32px));
  padding: 24px;
}
.qr-dialog:not([open]) { display: none; }
.qr-dialog[open] { display: flex; }
.qr-dialog::backdrop { background: rgba(0, 0, 0, .82); }
.qr-dialog h2 { text-align: left; }
.qr-dialog-image {
  display: grid;
  width: 200px;
  height: 200px;
  margin: auto auto 0;
  place-items: center;
  background: #fff;
}
.qr-dialog-image img { display: block; width: 200px; height: 200px; object-fit: cover; }
.qr-dialog-tip { margin: 20px 0 auto; text-align: center; font-size: 1.2rem; }
.qr-dialog-tip-name { color: #e0bf5a; font-weight: 600; }
.code-tips { margin: 16px 0; padding-left: 22px; color: var(--text); font-size: 1rem; }
.code-tips li { padding: 3px 0; }
.code-tips b { margin: 0 1px; }
.code-tips #mobile-first-rule { display: none; }
#purchase-dialog .code-tips #purchase-mobile-first-rule { display: none; }
.wx-icon {
  display: inline-block;
  width: 1.6em;
  height: 1.6em;
  margin: 0 .12em;
  object-fit: contain;
  vertical-align: -.42em;
}
.pay-tips { margin: 8px 0 14px; text-align: center; font-size: .875rem; }
.purchase-button,
.community-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}
.purchase-button { color: var(--link); }
.community-button { color: var(--link); }
.purchase-button:hover,
.community-button:hover { color: #adbff0; }
.code-form { display: flex; align-items: flex-start; gap: 10px; }
.code-input { position: relative; flex: 0 0 auto; }
.code-input img { position: absolute; top: 50%; left: 10px; z-index: 1; width: 16px; height: 16px; filter: invert(50%); transform: translateY(-50%); pointer-events: none; }
.code-form input { width: 100%; margin: 0; padding-left: 34px; }
.code-form input:focus { border-color: #3f4447; outline: none; }
.code-form .primary-button { flex: 0 0 auto; margin-left: auto; }
#code-dialog #download-code,
#purchase-dialog #purchase-download-code {
  width: calc(5ch + 62px);
  margin: 0;
  padding: 1px 10px 1px 34px;
  font-size: 1.5rem;
}

.spinner {
  display: block;
  width: 42px;
  height: 42px;
  margin: 4px auto 16px;
  border: 5px solid #2f3437;
  border-top-color: #2383e2;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
#loading-dialog {
  text-align: center;
  outline: none;
}
#loading-dialog[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
#loading-dialog .spinner { margin: 0; }
#loading-dialog p { margin: 0; }
.error-dialog {
  min-height: 12rem;
}
.error-dialog[open] {
  display: grid;
  place-items: center;
}
.error-dialog p {
  margin: 0;
  padding: .8em 0;
  color: #f2c94c;
  font-size: 1.4rem;
  line-height: 1.6;
  text-align: center;
}
.confirm-dialog p { margin: 0 0 20px; }
.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes dialog-pop {
  from { opacity: 0; transform: scale(.88); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes image-dialog-zoom {
  from { transform: scale(.92); }
  to { transform: scale(1); }
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 60px 0 3px;
  color: var(--text-muted);
  font-size: .875rem;
}

.footer a { color: var(--text-muted); }
.footer a:hover { color: #adb3bb; }
.copyright-mark { margin-right: -16px; font-size: 1.0625rem; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1000px) {
  .main-box { width: 100%; margin: 0; }
}

@media (max-width: 560px) {
  .nav-bar h1 { font-size: 2rem; }
  .nav-bar span a,
  .nav-bar span button { font-size: .875rem; }
  .footer { gap: 14px; font-size: .8125rem; }
}

@media (max-width: 768px) {
  body { padding: 0 3px; }
  .file-operation-dialog { width: calc(100vw - 32px); }
  .file-operation-preview img { width: min(140px, 100%); height: 140px; }
  .video-dialog { width: 100vw; max-width: 100vw; }
  .code-qr-trigger { display: none; }
  #purchase-dialog .code-qr-trigger { display: none; }
  .code-tips #pc-first-rule { display: none; }
  .code-tips #mobile-first-rule { display: list-item; }
  #purchase-dialog .code-tips #purchase-pc-first-rule { display: none; }
  #purchase-dialog .code-tips #purchase-mobile-first-rule { display: list-item; }
}

@media (min-width: 769px) {
  #code-dialog { font-size: 1.125rem; }
  #code-dialog h2 { font-size: 1.5rem; }
  #code-dialog .code-tips { font-size: 1.125rem; }
  #code-dialog .pay-tips { font-size: 1rem; }
  #code-dialog .code-form input,
  #code-dialog .code-form button { font-size: 1rem; }
  #code-dialog .show-qr-button { font-size: 1rem; }

  #purchase-dialog { font-size: 1.125rem; }
  #purchase-dialog h2 { font-size: 1.5rem; }
  #purchase-dialog .code-tips { font-size: 1.125rem; }
  #purchase-dialog .pay-tips { font-size: 1rem; }
  #purchase-dialog .code-form input,
  #purchase-dialog .code-form button { font-size: 1rem; }
  #purchase-dialog .show-qr-button { font-size: 1rem; }
  .code-tips li { white-space: nowrap; }
}
