*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  color: #1c2434;
  background:
    radial-gradient(900px 420px at 50% 12%, rgba(90, 150, 255, 0.18), transparent 70%),
    #eef2f7;
  font: 15px/1.5 "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: 0.6; cursor: not-allowed; }
button:focus-visible, a:focus-visible {
  outline: 2px solid #8eb0ff;
  outline-offset: 2px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
}

header {
  position: relative;
  z-index: 20;
  flex: none;
  padding: 0;
  background: #fff;
  box-shadow: 0 1px 0 rgba(32, 56, 100, 0.08);
}

.topbar {
  width: 100%;
  min-height: 56px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 4px;
  font-weight: 700;
}
.brand img { width: 28px; height: 28px; display: block; }

.notice {
  margin: 0;
  justify-self: center;
  background: #fff4f2;
  color: #c24134;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  white-space: nowrap;
}

.nav { justify-self: end; display: flex; align-items: center; gap: 4px; }
.menu-wrap { position: relative; }

.ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: #4191f5;
  border-radius: 10px;
  padding: 8px 10px;
}
.ghost:hover, .close:hover, .back:hover, .text-btn:hover, .icon-btn:hover { background: #f3f6fb; }
.icon-only { padding: 8px; }

.menu-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(32, 56, 100, 0.14);
  padding: 6px;
}
.menu-pop button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
}
.menu-pop button:hover { background: #f3f6fb; color: #4191f5; }

main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 12px 16px;
}
main.top {
  align-items: flex-start;
  overflow: auto;
}

#view-home { text-align: center; }

.logo-mark {
  width: 76px;
  height: 76px;
  margin: 0 auto 10px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #8ec4ff 0%, #4191f5 72%);
  box-shadow: 0 10px 24px rgba(65, 145, 245, 0.28);
}
.logo-mark svg { width: 40px; height: 40px; }
.wordmark {
  margin: 0 0 4px;
  color: #4191f5;
  font-size: 32px;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.tagline { margin: 0 0 18px; color: #8b97a8; }

.home-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  width: 225px;
  margin: 0 auto;
}
.send-wrap { position: relative; width: 100%; }
.home-actions > .secondary,
.send-wrap > .primary { width: 100%; }

.primary, .secondary, .wide-btn {
  height: 50px;
  border-radius: 10px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 500;
}
.primary {
  border: 0;
  background: #4191f5;
  color: #fff;
  box-shadow: 0 5px 20px rgba(65, 145, 245, 0.3);
}
.primary:hover { background: #3486ee; }
.secondary {
  border: 0;
  background: #fff;
  color: #4191f5;
  box-shadow: 0 5px 20px rgba(65, 145, 245, 0.2);
}
.secondary:hover { background: #f7fbff; }
a.primary, a.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0 18px;
}
.wide-btn { width: 100%; margin-top: 8px; }

.popover {
  position: absolute;
  left: 100%;
  top: 50%;
  z-index: 6;
  padding-left: 12px;
  transform: translateY(-50%);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.send-wrap:hover .popover,
.send-wrap:focus-within .popover {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.popover-card {
  width: 336px;
  padding: 14px 16px 12px;
  text-align: left;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(32, 56, 100, 0.12);
}
.popover-card ul {
  margin: 0 0 12px;
  padding-left: 18px;
  color: #8b97a8;
  font-size: 13px;
  line-height: 1.7;
}
.popover-card li + li { margin-top: 2px; }
.pop-actions { display: flex; gap: 8px; }
.pop-actions button {
  flex: 1;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  background: #f4f6f8;
  color: #3d4d63;
  font-size: 14px;
  font-weight: 500;
}
.pop-actions svg { flex: none; color: #7d8da3; }
.pop-actions button:hover { background: #eef3f8; color: #4191f5; }
.pop-actions button:hover svg { color: #4191f5; }

.sheet, .card, .modal-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 16px 50px rgba(32, 56, 100, 0.08);
}
.sheet { width: min(720px, 100%); padding: 22px; }
#view-result { width: min(480px, 100%); text-align: center; }
.wide { width: min(760px, 100%); }
.sheet-head h2, .help-card h2, #pass-form h2 { margin: 0 0 4px; font-size: 22px; }
.sheet-head { margin-bottom: 14px; }

.back, .text-btn, .icon-btn, .danger-text {
  border: 0;
  background: transparent;
  border-radius: 8px;
}
.back { color: #5c6b82; padding: 0 0 8px; }
.text-btn { color: #4191f5; padding: 6px 8px; }
.icon-btn { width: 32px; height: 32px; color: #8b97a8; font-size: 20px; }
.danger-text { color: #d4382c; padding: 6px 8px; }

.muted, .hint, .subhint { color: #7d8ba0; }
.hint, .subhint, .muted { font-size: 13px; }
.home-hint { text-align: center; margin: 8px 0 0; }
.alt-send { display: none; justify-content: center; gap: 4px; margin: 8px 0 0; }
.tabs, .auth-switch { display: flex; gap: 16px; }
.tabs { margin-bottom: 6px; }
.tabs button, .auth-switch button {
  border: 0;
  background: transparent;
  padding: 4px 0 8px;
  color: #7d8ba0;
  border-bottom: 2px solid transparent;
}
.tabs button.on, .auth-switch button.on { color: #1c2434; border-bottom-color: #4191f5; font-weight: 700; }
.auth-switch { justify-content: center; margin-bottom: 14px; }
#auth-form .field + .field { margin-top: 12px; }
.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #eef3fb;
  color: #5c6b82;
  font-size: 12px;
  letter-spacing: 0;
  text-indent: 0;
  font-weight: 650;
}
.badge.live { background: #e7f6ee; color: #1d7a45; }
.badge.gone { background: #fdecec; color: #c24134; }
#menu-account { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-filters { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; width: 100%; }
.quick-label {
  flex: none;
  font-size: 15px;
  font-weight: 700;
  color: #1c2434;
  line-height: 1.2;
}
.admin-filters input,
.admin-filters select {
  height: 42px;
  border: 1px solid #e1e7f0;
  background: #fff;
  border-radius: 10px;
  padding: 0 12px;
  color: #1c2434;
}
.admin-filters input { flex: 1; min-width: 0; }
.admin-filters select { flex: none; width: 148px; }
.pager { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.pager button:disabled { opacity: 0.4; cursor: default; }
.hint { margin: 8px 0 0; }
.subhint { margin: 0 0 8px; text-align: center; }
.eyebrow { margin: 0; color: #4191f5; font-weight: 650; }
.error { color: #d4382c; font-size: 13px; margin: 8px 0 0; }
.warn {
  margin: 10px 0;
  color: #9a6412;
  background: #fff8eb;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
}
.empty { color: #7d8ba0; background: #fff; border-radius: 16px; padding: 28px 18px; text-align: center; }

.settings {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.8fr;
  gap: 12px;
  margin-top: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; color: #66758c; font-size: 13px; text-align: left; }
.field input, .field select, .field textarea, .pass-input {
  width: 100%;
  border: 1px solid #e1e7f0;
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
  color: #1c2434;
}
.field input:focus, .field select:focus, .field textarea:focus,
.pass-input:focus,
.admin-filters input:focus,
.admin-filters select:focus {
  border-color: #4191f5;
}
.pw-wrap {
  position: relative;
  display: block;
}
.pw-wrap input, .pass-wrap .pass-input {
  padding-right: 42px;
}
.pw-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #8b97a8;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.pw-eye:hover, .pw-eye.on { color: #4191f5; }
.pw-eye svg { display: block; }
.pw-eye .eye-on { display: none; }
.pw-eye .eye-off { display: block; }
.pw-eye.on .eye-off { display: none; }
.pw-eye.on .eye-on { display: block; }
.sms-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 12px;
}
.sms-row .field { flex: 1; min-width: 0; }
.sms-row .secondary { flex: none; white-space: nowrap; }
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fff;
  border-radius: 16px;
  padding: 16px 18px;
}
.switch-row strong { color: #1c2434; font-size: 15px; }
.switch {
  width: 44px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: #d5deea;
  position: relative;
  cursor: pointer;
  flex: none;
  padding: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(28, 36, 52, 0.16);
  transition: transform 0.16s ease;
}
.switch.on { background: #4191f5; }
.switch.on::after { transform: translateX(18px); }
.field textarea { min-height: 180px; resize: vertical; line-height: 1.6; }
#text-wrap { margin-top: 8px; }

.file-row, .mine-top, .mine-actions, .share-row, .row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.file-row {
  padding: 10px 12px;
  margin-top: 8px;
  background: #f6f8fc;
  border-radius: 12px;
}
.admin-reset input { flex: 1; min-width: 0; }
.file-meta { flex: 1; min-width: 0; text-align: left; }
.file-name, .share-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-size { color: #8b97a8; font-size: 12px; }
.glyph {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #e8f3ff;
  color: #4191f5;
  font-size: 12px;
  font-weight: 700;
}
.row-actions { justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
#view-compose .row-actions,
#view-result .row-actions,
#view-pickup .row-actions { justify-content: center; }

.progress-wrap { margin-top: 14px; }
.progress { height: 8px; background: #e7eefb; border-radius: 99px; overflow: hidden; }
.progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #8ec4ff, #4191f5);
}

.code-big, .code-mid, .mine-code {
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
}
.code-big { margin: 8px 0; font-size: 52px; cursor: pointer; user-select: all; }
.code-mid { margin: 4px 0 8px; font-size: 32px; text-align: center; }
.mine-code { font-size: 22px; letter-spacing: 0.14em; }
.qr {
  width: 180px;
  height: 180px;
  margin: 8px auto;
  display: block;
  border-radius: 12px;
  border: 1px solid #eef2f7;
}
#share-box { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; text-align: left; }
.share-row {
  background: #f6f8fc;
  border-radius: 12px;
  padding: 8px 8px 8px 12px;
}
.share-meta { flex: 1; min-width: 0; }
.share-url { font-size: 13px; }
.mine-link { margin-top: 10px; }
.mine-link .share-url {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #5b6b82;
}
#view-pickup .eyebrow,
#view-pickup .code-mid,
#view-pickup #pickup-meta,
#view-pickup #pickup-pass { text-align: center; }
#pass-form h2,
#pass-form .subhint,
#pass-form .error { text-align: left; }
#pass-form .subhint { margin: 0 0 4px; }
#pass-form #pass-submit { min-width: 112px; }
#recv-form .error { text-align: center; }
.share-row button, .mine-actions button, .dl {
  border: 0;
  background: #eef6ff;
  color: #4191f5;
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.payload {
  margin: 12px 0 0;
  padding: 14px;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f6f8fc;
  border-radius: 12px;
  line-height: 1.65;
  text-align: left;
}

.card { padding: 16px 18px; margin-bottom: 12px; }
.mine-top, .mine-actions { justify-content: space-between; }
.mine-actions { margin-top: 10px; }
.preview { margin: 8px 0 0; color: #526178; white-space: pre-wrap; word-break: break-word; }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(238, 242, 247, 0.78);
  backdrop-filter: blur(6px);
}
.modal-card { position: relative; width: min(440px, 100%); padding: 28px 24px 24px; }
.help-card { width: min(560px, 100%); }
.help-card ol { margin: 12px 0 0; padding-left: 20px; color: #3a4a66; }
.help-card li + li { margin-top: 8px; }
.close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8b97a8;
  font-size: 22px;
}
.code-field { margin: 18px 0 4px; }
.code-caption {
  margin: 0 0 14px;
  min-height: 22px;
  text-align: center;
  color: #8b97a8;
  font-size: 15px;
  line-height: 22px;
}
.code-entry { position: relative; }
.code-slots {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.code-slots span {
  display: grid;
  place-items: center;
  height: 58px;
  border-radius: 12px;
  background: #f4f7fb;
  border: 1.5px solid #e4edf6;
  color: #1c2434;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.code-slots span.filled {
  background: #fff;
  border-color: #d7e6f6;
}
.code-slots span.on {
  border-color: #4191f5;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(65, 145, 245, 0.16);
}
.code-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  caret-color: transparent;
  font-size: 16px;
}
.code-input:focus-visible { outline: none; }
#recv-form .subhint { margin-top: 14px; }
#recv-form .error { min-height: 20px; }
#recv-form .wide-btn { margin-top: 8px; }
.pass-wrap { margin-top: 8px; }
.pass-input { margin-top: 0; }

.dropmask {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(65, 145, 245, 0.14);
  color: #2b78d6;
  font-size: 22px;
  font-weight: 700;
}
.dropmask::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 3px dashed #4191f5;
  border-radius: 20px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 50;
  transform: translateX(-50%);
  background: #1c2434;
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
}

footer {
  flex: none;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 8px 16px 12px;
  text-align: center;
  color: #98a4b6;
  font-size: 12px;
}
footer a {
  color: inherit;
  text-decoration: none;
}
footer a:hover { color: #4191f5; }

@media (max-height: 760px) {
  header { padding-top: 0; }
  .topbar { min-height: 48px; padding: 0 16px; }
  main { padding: 8px 16px; }
  .logo-mark { width: 60px; height: 60px; margin-bottom: 6px; border-radius: 16px; }
  .logo-mark svg { width: 32px; height: 32px; }
  .wordmark { font-size: 26px; }
  .tagline { margin-bottom: 12px; }
  .home-actions { gap: 12px; }
  .primary, .secondary, .wide-btn { height: 44px; }
  .alt-send, .home-hint { margin-top: 4px; }
  footer { padding-bottom: 8px; }
}

@media (max-width: 980px), (hover: none), (pointer: coarse) {
  .popover { display: none; }
  .alt-send { display: flex; }
}

@media (max-width: 980px) {
  .home-actions { width: min(280px, calc(100vw - 48px)); }
}

@media (max-width: 720px) {
  .topbar { grid-template-columns: 1fr auto; }
  .notice { display: none; }
  .settings { grid-template-columns: 1fr; }
  .code-big { font-size: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
