:root {
  --ink: #1d1d1f;
  --ink-2: #3a3a3c;
  --sub: #6e6e73;
  --muted: #98989d;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.13);
  --glass: rgba(252, 252, 253, 0.66);
  --blue: #007aff;
  --blue-deep: #0066d6;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.65;
  letter-spacing: 0.01em;
  color: var(--ink);
  background: #eef2f8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}
button, input, textarea { font-family: inherit; letter-spacing: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
::selection { background: rgba(0, 122, 255, 0.18); }

/* ---------------- 背景 ---------------- */
.wallpaper {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(158deg, #eaf0f9 0%, #eef1f7 45%, #f6eeeb 100%);
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
}
.b1 {
  width: 54vw;
  height: 54vw;
  left: -12vw;
  top: -20vw;
  background: radial-gradient(circle, #b9d4f2, rgba(185, 212, 242, 0));
}
.b2 {
  width: 46vw;
  height: 46vw;
  right: -10vw;
  top: 0;
  background: radial-gradient(circle, #f3d9c8, rgba(243, 217, 200, 0));
}
.b3 {
  width: 44vw;
  height: 44vw;
  left: 30vw;
  bottom: -26vw;
  background: radial-gradient(circle, #cfe4da, rgba(207, 228, 218, 0));
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
}
.topbar-inner {
  max-width: 1020px;
  margin: 0 auto;
  height: 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: inline-flex; align-items: center; }
.brand img {
  display: block;
  width: 172px;
  height: auto;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.my-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 500;
  color: var(--sub);
  cursor: pointer;
  transition: 0.16s ease;
}
.my-link svg { width: 14px; height: 14px; }
.my-link em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--muted);
  background: rgba(120, 120, 128, 0.12);
  border-radius: 20px;
  min-width: 18px;
  padding: 0 5px;
  text-align: center;
  line-height: 16px;
}
.my-link:hover {
  color: var(--blue);
  background: rgba(0, 122, 255, 0.07);
}
.box-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--sub);
  cursor: pointer;
  transition: 0.16s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.box-link svg { width: 14px; height: 14px; }
.box-link em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--muted);
  background: rgba(120, 120, 128, 0.12);
  border-radius: 20px;
  min-width: 18px;
  padding: 0 5px;
  text-align: center;
  line-height: 16px;
}
.box-link:hover {
  color: var(--blue);
  border-color: rgba(0, 122, 255, 0.35);
  background: #fff;
}

/* ---------------- 主区域 ---------------- */
.page {
  width: 100%;
  max-width: 1020px;
  margin: 0 auto;
  padding: 56px 28px 64px;
}

.intro h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.intro p {
  margin: 13px 0 0;
  max-width: 560px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--sub);
}

form {
  margin-top: 38px;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 30px 40px;
  align-items: start;
}

.form-foot { grid-column: 1 / -1; }

.group { margin-bottom: 26px; }
.group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}
.group-head label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.group-head span { font-size: 11px; color: var(--muted); }
.optional { font-weight: 400; color: var(--muted); }

textarea,
.name-input,
.box-password {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 13px 15px;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}
textarea { min-height: 228px; resize: vertical; }
textarea::placeholder,
.name-input::placeholder,
.box-password::placeholder { color: #a8a8ad; }
textarea:focus,
.name-input:focus,
.box-password:focus {
  outline: none;
  background: #fff;
  border-color: rgba(0, 122, 255, 0.6);
  box-shadow: 0 0 0 3.5px rgba(0, 122, 255, 0.14);
}

/* ---------------- 附件 ---------------- */
.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 26px 18px;
  min-height: 200px;
  border: 1.5px dashed rgba(0, 122, 255, 0.38);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(0, 122, 255, 0.06), rgba(0, 122, 255, 0.025));
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.drop-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--blue);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 40, 90, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}
.drop-icon svg { width: 22px; height: 22px; }
.drop-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.drop-text b { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.drop-text span { font-size: 11.5px; color: var(--sub); }
.drop-action {
  margin-top: 4px;
  flex: none;
  padding: 6px 14px;
  border-radius: 7px;
  border: 1px solid rgba(0, 122, 255, 0.32);
  background: #fff;
  color: var(--blue);
  font-size: 11.5px;
  font-weight: 600;
  transition: 0.18s ease;
}
.drop:hover,
.drop.dragover {
  border-color: rgba(0, 122, 255, 0.75);
  background: linear-gradient(180deg, rgba(0, 122, 255, 0.1), rgba(0, 122, 255, 0.05));
  box-shadow: 0 4px 14px -6px rgba(0, 122, 255, 0.35);
}
.drop:hover .drop-action,
.drop.dragover .drop-action {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.drop:focus-visible {
  outline: none;
  border-color: rgba(0, 122, 255, 0.75);
  box-shadow: 0 0 0 3.5px rgba(0, 122, 255, 0.14);
}

.hint { margin: 8px 0 0; font-size: 11px; color: var(--muted); }

.file-list { list-style: none; margin: 0; padding: 0; }
.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
}
.file-item:last-child { border-bottom: none; }
.file-thumb {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.06);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08);
}
.file-ico {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--sub);
  flex: none;
}
.file-ico.image { color: var(--blue); }
.file-ico svg { width: 14px; height: 14px; }
.file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
}
.file-size { flex: none; font-size: 11px; color: var(--muted); }
.file-del {
  flex: none;
  border: none;
  background: none;
  padding: 2px;
  width: 22px;
  height: 22px;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 5px;
}
.file-del:hover { color: #d70015; background: rgba(215, 0, 21, 0.06); }
.file-del svg { width: 12px; height: 12px; }

/* ---------------- 身份 ---------------- */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
  background: rgba(120, 120, 128, 0.14);
  border-radius: 9px;
}
.seg {
  border: none;
  background: transparent;
  border-radius: 7px;
  padding: 7px 4px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: 0.15s ease;
}
.seg:hover { color: var(--ink); }
.seg.active {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}
.name-input { margin-top: 10px; }

/* ---------------- 身份弹窗 ---------------- */
.identity-panel { max-width: 356px; padding: 26px 24px 22px; }
.identity-panel h3 { margin: 0 0 6px; font-size: 16px; }
.identity-panel > p { margin: 0; font-size: 12px; color: var(--sub); }
.identity-panel .segmented { margin-top: 16px; }
.identity-panel .name-input { margin-top: 12px; text-align: center; }
.identity-panel .box-err { min-height: 18px; margin: 8px 0 0; }
.identity-panel .actions { margin-top: 14px; }

/* ---------------- 提交 ---------------- */
.submit {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, #2a91ff, #0071e3);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 2px 6px -1px rgba(0, 80, 180, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: filter 0.15s ease, transform 0.1s ease;
}
.submit:hover { filter: brightness(1.06); }
.submit:active { transform: translateY(0.5px); }
.submit:disabled { filter: grayscale(0.5) brightness(0.95); cursor: default; }
.privacy {
  margin: 10px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

/* ---------------- 弹窗 ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 28, 36, 0.24);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.panel {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: rgba(251, 251, 253, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 30px 80px -20px rgba(16, 24, 36, 0.35);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  overflow: hidden;
  animation: sheetIn 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.panel-sm { max-width: 330px; padding: 28px 24px 22px; text-align: center; }
.check {
  width: 38px;
  height: 38px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(180deg, #2a91ff, #0071e3);
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.check svg { width: 18px; height: 18px; }
.panel-sm h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 600; }
.panel-sm p { margin: 0 0 18px; font-size: 12px; color: var(--sub); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.btn-dark,
.btn-plain {
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
}
.btn-dark {
  border: 1px solid transparent;
  background: linear-gradient(180deg, #2a91ff, #0071e3);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 80, 180, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-dark:hover { filter: brightness(1.06); }
.btn-dark:disabled { opacity: 0.6; cursor: default; }
.btn-plain {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
}
.btn-plain:hover { background: #fff; }
.btn-mini { padding: 4px 9px; font-size: 11px; display: inline-flex; align-items: center; gap: 4px; }
.btn-mini svg { width: 11px; height: 11px; }

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px 13px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.panel-head h3 { margin: 0 0 2px; font-size: 14.5px; font-weight: 600; }
.panel-head p { margin: 0; font-size: 11px; color: var(--muted); }
.icon {
  border: none;
  background: none;
  padding: 4px;
  width: 26px;
  height: 26px;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 6px;
}
.icon:hover { color: var(--ink); background: rgba(0, 0, 0, 0.05); }
.icon svg { width: 13px; height: 13px; }

.box-login { padding: 32px 24px 28px; }
.box-login form { display: flex; gap: 8px; margin: 0; }
.box-password { flex: 1; min-width: 0; }
.box-login .btn-dark { flex: none; padding: 9px 20px; }
.box-err { margin: 9px 0 0; min-height: 15px; font-size: 11px; color: #d70015; }

.box-list-wrap { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.box-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  flex: none;
}
.letters { padding: 0 20px 16px; overflow-y: auto; }
.letter { padding: 15px 0; border-bottom: 1px solid var(--line); }
.letter:last-child { border-bottom: none; }
.letter-meta { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.letter-who { font-size: 12px; font-weight: 600; }
.letter-time { margin-left: auto; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.letter-del {
  border: none;
  background: none;
  padding: 2px 5px;
  margin-left: 8px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.letter-del:hover { color: #d70015; background: rgba(215, 0, 21, 0.06); }
.letter-del.confirm { color: #d70015; font-weight: 600; }
.letter-content {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}
.letter-content.empty { color: var(--muted); }
.letter-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.letter-files:empty { display: none; }
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  border-radius: 5px;
  background: rgba(120, 120, 128, 0.11);
  padding: 3px 8px;
  font-size: 11px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.file-chip:hover { background: rgba(0, 122, 255, 0.12); color: var(--blue); }
.file-chip svg { width: 11px; height: 11px; }
.file-chip span { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip i { font-style: normal; font-size: 10px; color: var(--muted); }
.file-chip.with-thumb {
  padding: 3px 9px 3px 3px;
  border-radius: 8px;
  gap: 7px;
}
.chip-thumb {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 6px;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.06);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.07);
}

.letters-empty { padding: 40px 0; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------------- 图片预览 / 提示 ---------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(12, 14, 18, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; }
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.lightbox-close svg { width: 15px; height: 15px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 90;
  max-width: calc(100vw - 32px);
  padding: 9px 15px;
  border-radius: 9px;
  background: rgba(29, 29, 31, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.toast.err { background: rgba(180, 20, 30, 0.94); }

.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;
}

@keyframes sheetIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 手机 ---------------- */
@media (max-width: 900px) {
  .topbar-inner { height: 62px; padding: 0 18px; }
  .brand img { width: 132px; }
  .page { padding: 34px 18px 44px; }
  .intro h1 { font-size: 26px; }
  .intro p { font-size: 13.5px; }
  form { grid-template-columns: 1fr; gap: 0; margin-top: 30px; }
  .col-left .group { margin-bottom: 22px; }
  .drop { min-height: 156px; padding: 20px 16px; }
  textarea { min-height: 170px; font-size: 16px; }
  .name-input, .box-password { font-size: 16px; }
  .form-foot { margin-top: 4px; }

  .modal { padding: 14px; }
  .panel { max-height: 90vh; }
  .panel-sm { max-width: 100%; }
  .letters { padding: 0 16px 14px; }
  .box-toolbar { padding: 8px 16px; }
  .panel-head { padding: 14px 16px 11px; }
  .box-login { padding: 26px 16px 22px; }
}

@media (max-width: 420px) {
  .brand img { width: 112px; }
  .box-link span, .my-link span { display: none; }
  .page { padding: 26px 14px 36px; }
  .intro h1 { font-size: 24px; }
  .file-chip span { max-width: 150px; }
  .drop { min-height: 148px; padding: 18px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
