:root {
  --theme-color: #83a01c;
  --theme-color-text: #688216;
  --theme-color-logo: #6b8518;
  --theme-color-tint: #93a82824;
  --alert-color: #eb003c;
  --main-background-color: #fafaf6;
  --pure-white-background-color: #ffffff;
  --pure-black-text-color: #000000;
  --overlay-background-color: #0000001a;
  --black-alpha-3: #00000008;
  --black-alpha-5: #0000000d;
  --black-alpha-7: #00000012;
  --black-alpha-10: #0000001a;
  --black-alpha-15: #00000026;
  --black-alpha-20: #0003;
  --black-alpha-30: #0000004d;
  --black-alpha-35: #00000059;
  --black-alpha-50: #00000080;
  --black-alpha-60: #0009;
  --black-alpha-70: #000000b3;
  --black-alpha-80: #000c;
  --white-alpha-60: #fff9;
  --white-alpha-80: #fffc;
  --font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  --regular-font-size: 16px;
  --cubic-bezier: cubic-bezier(0.65, 0.05, 0.1, 1);
}

* {
  box-sizing: border-box;
}

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

html {
  background: var(--main-background-color);
  font-family: var(--font-family);
  color: var(--pure-black-text-color);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: hidden;
  background: var(--main-background-color);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--theme-color);
  outline-offset: 3px;
}

.site-shell {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.home {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.home-logo {
  width: 160px;
  height: 160px;
  flex: 0 0 160px;
}

.home-actions {
  display: flex;
  width: 225px;
  flex-direction: column;
  gap: 20px;
  margin-top: 84px;
}

.action-button {
  width: 225px;
  height: 50px;
  padding: 0 15px;
  border: 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 180ms var(--cubic-bezier),
    box-shadow 180ms var(--cubic-bezier);
}

.action-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.send-action {
  background: var(--theme-color);
  box-shadow: rgba(139, 155, 36, 0.32) 0 5px 20px 0;
  color: #ffffff;
}

.send-action:hover {
  background: #718c17;
}

.receive-action {
  background: #ffffff;
  box-shadow: rgba(139, 155, 36, 0.2) 0 5px 20px 0;
  color: var(--theme-color-text);
}

.receive-action:hover {
  background: #f7f9ed;
}

.home-files {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 8px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--theme-color-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 180ms var(--cubic-bezier);
}

.home-files svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.home-files:hover {
  background: var(--theme-color-tint);
}

.overlay {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--overlay-background-color);
  animation: overlay-in 160ms ease-out both;
}

.dialog {
  position: relative;
  z-index: 81;
  width: min(500px, calc(100% - 40px));
  border: 0;
  border-radius: 16px;
  background: var(--pure-white-background-color);
  box-shadow: rgba(0, 0, 0, 0.12) 0 14px 32px 0;
}

.receive-dialog {
  height: 396px;
}

.dialog-close {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--black-alpha-80);
  font-family: Arial, sans-serif;
  font-size: 29px;
  font-weight: 300;
  line-height: 1;
}

.dialog-close:hover {
  background: var(--black-alpha-5);
}

.receive-content {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  padding: 88px 30px 24px;
}

.receive-content h2,
.dialog-title {
  margin: 0;
  color: var(--pure-black-text-color);
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

.receive-content .receive-hint {
  margin: 14px 0 0;
  color: var(--black-alpha-80);
  font-size: 14px;
  line-height: 22px;
  text-align: center;
}

.code-input {
  width: 278px;
  max-width: 100%;
  height: 75px;
  margin-top: 24px;
  padding: 0 15px;
  border: 2px solid var(--theme-color);
  border-radius: 8px;
  background: #ffffff;
  color: var(--black-alpha-80);
  font-size: 20px;
  letter-spacing: 4px;
  line-height: 1;
  text-align: center;
}

.code-input::placeholder {
  color: var(--black-alpha-20);
  letter-spacing: 0;
}

.code-input:focus,
.code-input:focus-visible {
  outline: 0;
}

.dialog-primary {
  width: 200px;
  height: 41px;
  margin-top: 28px;
  padding: 0 20px;
  border: 0;
  border-radius: 5px;
  background: var(--theme-color);
  color: #ffffff;
  font-size: 14px;
  line-height: 20px;
}

.dialog-primary:hover {
  background: #718c17;
}

.dialog-primary:disabled {
  cursor: default;
  opacity: 0.55;
}

.warning-dialog {
  width: min(400px, calc(100% - 50px));
  padding: 18px 22px 22px;
  outline: 0;
  text-align: center;
}

.warning-icon {
  display: grid;
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  place-items: center;
  border-radius: 50%;
  background: var(--theme-color-tint);
  color: var(--theme-color);
}

.warning-icon svg {
  width: 21px;
  height: 21px;
}

.warning-icon path {
  fill: currentColor;
}

.warning-dialog h2 {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 22px;
}

.warning-copy {
  margin: 0 auto;
  color: var(--pure-black-text-color);
  font-size: 14px;
  line-height: 22px;
}

.warning-contact {
  margin: 14px 0 16px;
  color: var(--pure-black-text-color);
  font-size: 14px;
  line-height: 22px;
}

.warning-contact a {
  color: var(--theme-color);
  text-decoration: none;
}

.warning-confirm {
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 5px;
  background: var(--theme-color);
  color: #ffffff;
  font-size: 14px;
  line-height: 20px;
}

.warning-confirm:hover {
  background: #718c17;
}

.form-error {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--alert-color);
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.menu-overlay {
  z-index: 90;
}

.menu-panel {
  position: fixed;
  z-index: 91;
  top: 62px;
  right: 10px;
  width: 227px;
  overflow: hidden;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: rgba(0, 0, 0, 0.12) 0 8px 22px 0;
  animation: menu-in 170ms var(--cubic-bezier) both;
}

.menu-panel:focus {
  outline: 0;
}

.menu-section {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}

.menu-section + .menu-section {
  border-top: 1px solid var(--black-alpha-7);
}

.menu-section:last-child {
  padding: 6px 0;
}

.menu-item {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 12px;
  padding: 8px 15px;
  border: 0;
  background: transparent;
  color: var(--black-alpha-80);
  font-size: 14px;
  line-height: 20px;
  text-align: left;
}

.menu-item:hover {
  background: #f7f9fc;
}

.menu-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--black-alpha-70);
}

.menu-item path {
  fill: currentColor;
}

.menu-item.promo {
  align-items: flex-start;
  min-height: 56px;
  padding-top: 7px;
  padding-bottom: 7px;
  color: var(--black-alpha-80);
}

.menu-item.promo svg {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.promo-copy strong,
.promo-copy small {
  display: block;
}

.promo-copy strong {
  font-weight: 400;
  line-height: 18px;
}

.promo-copy small {
  color: var(--black-alpha-50);
  font-size: 12px;
  line-height: 16px;
}

.wide-dialog {
  width: min(560px, calc(100% - 40px));
  max-height: min(620px, calc(100vh - 48px));
  padding: 34px;
  overflow: auto;
}

.wide-dialog h2 {
  margin: 0 30px 12px 0;
}

.dialog-subtitle {
  margin: 0 0 20px;
  color: var(--black-alpha-60);
  font-size: 14px;
  line-height: 21px;
}

.dialog-field {
  width: 100%;
}

.text-area {
  width: 100%;
  min-height: 150px;
  padding: 14px;
  resize: vertical;
  border: 2px solid var(--theme-color);
  border-radius: 8px;
  outline: 0;
  color: var(--black-alpha-80);
  font-size: 14px;
  line-height: 22px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.dialog-action {
  height: 40px;
  padding: 0 20px;
  border: 1px solid var(--black-alpha-10);
  border-radius: 5px;
  background: #ffffff;
  color: var(--black-alpha-80);
}

.dialog-action.primary {
  border-color: var(--theme-color);
  background: var(--theme-color);
  color: #ffffff;
}

.transfer-result {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
}

.result-code {
  color: var(--theme-color);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 8px;
  line-height: 44px;
}

.result-help {
  margin: -8px 0 0;
  color: var(--black-alpha-60);
  font-size: 14px;
  line-height: 21px;
}

.result-files,
.file-list {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #f7f8f0;
  text-align: left;
}

.file-type {
  display: grid;
  width: 32px;
  height: 38px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 5px;
  background: var(--theme-color-tint);
  color: var(--theme-color);
  font-size: 11px;
}

.file-meta {
  min-width: 0;
  flex: 1;
}

.file-name {
  display: block;
  overflow: hidden;
  color: var(--black-alpha-80);
  font-size: 14px;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  display: block;
  color: var(--black-alpha-50);
  font-size: 12px;
  line-height: 18px;
}

.file-download {
  padding: 4px 10px;
  border: 0;
  border-radius: 5px;
  background: var(--theme-color-tint);
  color: var(--theme-color);
  text-decoration: none;
}

.copy-code {
  height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 5px;
  background: var(--theme-color);
  color: #ffffff;
}

.empty-state {
  padding: 28px 12px;
  border-radius: 10px;
  background: #f7f9fc;
  color: var(--black-alpha-50);
  font-size: 14px;
  line-height: 22px;
  text-align: center;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--black-alpha-7);
  color: var(--black-alpha-80);
  font-size: 14px;
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--black-alpha-10);
  border-radius: 5px;
  background: #ffffff;
}

.toast {
  position: fixed;
  z-index: 120;
  right: 20px;
  bottom: 20px;
  max-width: calc(100% - 40px);
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--black-alpha-80);
  color: #ffffff;
  font-size: 14px;
  line-height: 20px;
  animation: toast-in 180ms ease-out both;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .menu-panel {
    right: 10px;
    width: 270px;
  }

  .warning-dialog {
    padding: 27px 22px 21px;
  }
  .wide-dialog {
    width: calc(100% - 40px);
    padding: 28px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
