/* 文件快递柜 · Storage 版 —— 前台样式 */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #eef3f8 0%, #f6f8fb 240px, #f6f8fb 100%);
  color: #1f2937;
  line-height: 1.5;
}

.wrap { max-width: 560px; margin: 0 auto; padding: 40px 16px 60px; }
@media (max-width: 480px) { .wrap { padding-top: 24px; } }
.hidden { display: none !important; }

/* ---------- 品牌 ---------- */
.brand { text-align: center; margin-bottom: 22px; }
.brand-logo { font-size: 42px; line-height: 1; }
.brand-title { font-size: 21px; font-weight: 600; margin-top: 8px; letter-spacing: 1px; }
.brand-sub { font-size: 12px; color: #8a94a6; margin-top: 4px; }

/* ---------- 卡片 ---------- */
.card {
  background: #fff; border-radius: 16px; padding: 26px 22px;
  box-shadow: 0 4px 24px rgba(31, 41, 55, .06), 0 1px 3px rgba(31, 41, 55, .05);
}
@media (max-width: 480px) { .card { padding: 20px 16px; } }

/* ---------- 取件页 ---------- */
.take-card { text-align: center; }
.field-label { display: block; font-size: 14px; color: #4b5563; margin-bottom: 10px; }
.take-row { display: flex; gap: 10px; }
.take-input {
  flex: 1; min-width: 0; height: 52px; border: 2px solid #e5e9f2; border-radius: 12px;
  font-size: 20px; letter-spacing: 6px; text-align: center; outline: none; transition: border .15s;
}
.take-input:focus { border-color: #3b82f6; }
.btn-take { height: 52px; padding: 0 22px; font-size: 16px; white-space: nowrap; }
.btn-take:disabled { opacity: .45; cursor: not-allowed; }
.arrow { margin-left: 2px; }
.switch-link { display: inline-block; margin-top: 16px; color: #3b82f6; font-size: 13px; text-decoration: none; }
.switch-link:hover { text-decoration: underline; }

/* ---------- 页脚 ---------- */
.page-foot { margin-top: 24px; text-align: center; font-size: 12px; color: #8a94a6; }
.page-foot .dot { margin: 0 8px; }
.lock { margin-right: 4px; }
.foot-link { color: #8a94a6; text-decoration: none; }
.foot-link:hover { color: #3b82f6; }

/* ---------- 发送页 ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 18px; background: #f1f4f9; padding: 4px; border-radius: 10px; }
.tab {
  flex: 1; border: 0; background: transparent; padding: 9px 0; font-size: 14px;
  color: #6b7280; border-radius: 8px; cursor: pointer; transition: all .15s;
}
.tab.active { background: #fff; color: #1f2937; font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.dropzone {
  border: 2px dashed #c9d4e5; border-radius: 14px; padding: 34px 14px; text-align: center;
  cursor: pointer; transition: all .15s; background: #fafbfd;
}
.dropzone:hover, .dropzone.drag { border-color: #3b82f6; background: #f0f6ff; }
.dz-icon { font-size: 30px; color: #3b82f6; }
.dz-main { font-size: 15px; color: #374151; margin-top: 8px; font-weight: 500; }
.dz-sub { font-size: 12px; color: #8a94a6; margin-top: 6px; }
#file-input { display: none; }

.file-list { list-style: none; margin-top: 12px; }
.file-list li {
  display: flex; align-items: center; gap: 10px; font-size: 13px; color: #4b5563;
  background: #f7f9fc; border-radius: 8px; padding: 8px 12px; margin-top: 6px;
}
.file-list .f-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .f-size { color: #8a94a6; white-space: nowrap; }
.file-list .f-del { border: 0; background: none; color: #c04040; cursor: pointer; font-size: 15px; padding: 0 4px; }

.text-input {
  width: 100%; border: 2px solid #e5e9f2; border-radius: 12px; padding: 12px; font-size: 14px;
  font-family: inherit; resize: vertical; outline: none;
}
.text-input:focus { border-color: #3b82f6; }
.text-counter { text-align: right; font-size: 11px; color: #a0a8b8; margin-top: 4px; }

/* 选项行 */
.opt-row {
  display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 14px; flex-wrap: wrap;
}
.opt-key { color: #4b5563; white-space: nowrap; }
.opt-days input, .opt-row input[type="number"], .opt-row input[type="text"], .opt-row input[type="password"], .opt-row select {
  border: 1.5px solid #e0e5ef; border-radius: 8px; padding: 7px 10px; font-size: 14px; outline: none;
  background: #fff; color: #1f2937; font-family: inherit;
}
.opt-row input:focus, .opt-row select:focus { border-color: #3b82f6; }
.opt-days input { width: 58px; text-align: center; }
.chips { display: flex; gap: 6px; }
.chip {
  border: 1.5px solid #e0e5ef; background: #fff; color: #3b82f6; border-radius: 999px;
  padding: 5px 12px; font-size: 12px; cursor: pointer;
}
.chip.active, .chip:hover { background: #3b82f6; color: #fff; border-color: #3b82f6; }

.adv { margin-top: 14px; }
.adv summary { font-size: 13px; color: #6b7280; cursor: pointer; user-select: none; }
.adv-body { padding: 4px 0 0; }
.adv-body .opt-row { margin-top: 12px; }
.opt-note { font-size: 12px; color: #a0a8b8; margin-top: 12px; }

/* 按钮 */
.btn {
  border: 0; cursor: pointer; border-radius: 10px; font-size: 15px; font-family: inherit;
  transition: all .15s; display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary { background: #3b82f6; color: #fff; padding: 10px 18px; }
.btn-primary:hover:not(:disabled) { background: #2f6fe0; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost {
  background: #f2f5fa; color: #3b82f6; padding: 9px 14px; font-size: 13px; border: 1px solid #e0e8f5;
}
.btn-ghost:hover { background: #e7eefb; }
.btn-send { width: 100%; margin-top: 20px; height: 46px; font-size: 16px; font-weight: 600; letter-spacing: 2px; }

/* 进度 */
.progress-box { margin-top: 18px; }
.prog-title { display: flex; justify-content: space-between; font-size: 13px; color: #4b5563; }
.prog-stats { color: #8a94a6; }
.prog-bar { height: 10px; background: #eef1f7; border-radius: 999px; overflow: hidden; margin-top: 8px; }
.prog-fill { height: 100%; width: 0; background: linear-gradient(90deg, #3b82f6, #60a5fa); border-radius: 999px; transition: width .2s; }
.prog-per-file { margin-top: 8px; font-size: 12px; color: #8a94a6; max-height: 96px; overflow: auto; }
.btn-cancel { margin-top: 10px; }

/* 配额条 */
.quota-bar-wrap { margin-top: 16px; font-size: 12px; color: #8a94a6; }
.quota-line { display: flex; justify-content: space-between; margin-bottom: 5px; }
.quota-bar { height: 6px; background: #e6eaf2; border-radius: 999px; overflow: hidden; }
.quota-fill { height: 100%; width: 0; background: #22c55e; border-radius: 999px; transition: width .4s; }
.quota-fill.warn { background: #f59e0b; }
.quota-fill.danger { background: #ef4444; }

/* ---------- 弹层 ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(17, 24, 39, .5); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-card {
  background: #fff; border-radius: 18px; padding: 26px 22px; width: 100%; max-width: 420px;
  position: relative; max-height: 90vh; overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
@media (max-width: 480px) { .modal { padding: 10px; } .modal-card { padding: 20px 14px; } }
.modal-x {
  position: absolute; top: 12px; right: 12px; border: 0; background: #f2f5fa; color: #6b7280;
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 14px; }

/* 发送结果弹层 */
.sf-name { font-size: 15px; font-weight: 500; word-break: break-all; }
.sf-meta { font-size: 12px; color: #8a94a6; margin-top: 4px; }
.sf-exp { font-size: 12px; color: #c07a1f; margin-top: 2px; }
.sf-crypto { font-size: 12px; color: #16a34a; margin-top: 6px; }
.code-box { text-align: center; margin: 18px 0 6px; }
.code-cap { font-size: 12px; color: #8a94a6; margin-bottom: 10px; }
.code-digits { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; cursor: pointer; }
.code-digits span {
  min-width: 46px; height: 54px; line-height: 54px; text-align: center;
  font-size: 28px; font-weight: 700; letter-spacing: 1px;
  background: #f4f7fc; border: 1.5px solid #e2e9f5; border-radius: 10px; color: #1d4ed8;
}
@media (max-width: 480px) { .code-digits span { min-width: 40px; height: 48px; line-height: 48px; font-size: 24px; } }
.copy-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.qr-box { text-align: center; margin-top: 18px; }
#sf-qr { display: inline-block; padding: 8px; background: #fff; border: 1px solid #eef1f6; border-radius: 10px; }
.qr-cap { font-size: 12px; color: #8a94a6; margin-top: 8px; }
.sf-files { margin-top: 16px; border-top: 1px dashed #e5e9f2; padding-top: 12px; }
.sf-files-cap { font-size: 13px; color: #4b5563; margin-bottom: 8px; }
.sf-files { list-style: none; max-height: 150px; overflow: auto; }
.sf-files li { font-size: 12px; color: #6b7280; display: flex; gap: 8px; padding: 3px 0; }
.sf-files .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 取件结果弹层 */
.tk-row { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 10px; flex-wrap: wrap; }
.tk-key { color: #6b7280; white-space: nowrap; }
.tk-val { color: #1f2937; word-break: break-all; font-weight: 500; }
.btn-dl { padding: 8px 20px; font-size: 14px; }
.tk-note { font-size: 11px; color: #a0a8b8; margin-top: 8px; }
.tk-files { margin-top: 12px; border-top: 1px dashed #e5e9f2; padding-top: 10px; max-height: 220px; overflow: auto; }
.tk-file-item {
  display: flex; align-items: center; gap: 10px; padding: 10px; background: #f7f9fc;
  border-radius: 10px; margin-bottom: 8px;
}
.tk-file-item .n { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-file-item .s { font-size: 12px; color: #8a94a6; white-space: nowrap; }
.tk-text {
  margin-top: 12px; background: #f7f9fc; border-radius: 10px; padding: 14px;
  font-size: 14px; white-space: pre-wrap; word-break: break-all; color: #1f2937;
  max-height: 240px; overflow: auto; border: 1px solid #e8edf5;
}
.pwd-input {
  flex: 1; min-width: 120px; border: 1.5px solid #e0e5ef; border-radius: 8px; padding: 8px 10px; font-size: 14px;
}
.btn-close2 { width: 100%; margin-top: 18px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: #111827; color: #fff; padding: 10px 22px; border-radius: 999px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 200; max-width: 86vw;
}
.toast.show { opacity: .95; transform: translateX(-50%) translateY(0); }
.toast.err { background: #b91c1c; }

/* 旋转加载 */
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
