/* ============================================================
   伊甸来信 —— 绿色系 · 青苹果 · 备忘录信纸
   ============================================================ */
:root {
  --ink: #2f5d3a;
  --ink-soft: #4c7a55;
  --ink-mute: #7fa287;
  --apple: #8cc152;
  --apple-deep: #5a9b3e;
  --green-a: #3c7245;
  --green-b: #77ad4e;
  --paper: #fafdf6;
  --line: rgba(139, 181, 127, 0.32);
  --warn-bg: #fdf1ec;
  --warn-bd: #f2c7b8;
  --warn-ink: #c05b45;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", "Source Han Serif SC", serif;
  --apple-uri: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 26 C44 18 32 16 24 22 C14 29 12 44 16 58 C20 72 32 86 43 88 C46 88.6 48 88 50 86.5 C52 88 54 88.6 57 88 C68 86 80 72 84 58 C88 44 86 29 76 22 C68 16 56 18 50 26 Z' fill='%238cc152'/%3E%3Cpath d='M50 24 C50 17 53 11 59 8' stroke='%238a5a3b' stroke-width='4.5' fill='none' stroke-linecap='round'/%3E%3Cpath d='M56 14 C60 5 72 2 80 4 C79 13 70 20 58 19 Z' fill='%236cb64a'/%3E%3C/svg%3E");
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(160deg, #e6f4de 0%, #d3ebc8 45%, #bfe0b0 100%);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- 背景漂浮青苹果 ---------------- */
.float-apples { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.fa {
  position: absolute; bottom: -80px;
  background: var(--apple-uri) center / contain no-repeat;
  opacity: 0; animation: fa-rise linear infinite;
}
.fa1 { left: 6%;  width: 42px; height: 42px; animation-duration: 17s; animation-delay: 0s; }
.fa2 { left: 76%; width: 58px; height: 58px; animation-duration: 22s; animation-delay: 5s; }
.fa3 { left: 32%; width: 30px; height: 30px; animation-duration: 19s; animation-delay: 10s; }
.fa4 { left: 88%; width: 36px; height: 36px; animation-duration: 26s; animation-delay: 2s; }
@keyframes fa-rise {
  0%   { transform: translateY(0) rotate(-8deg); opacity: 0; }
  8%   { opacity: 0.16; }
  92%  { opacity: 0.16; }
  100% { transform: translateY(-116vh) rotate(10deg); opacity: 0; }
}

#app { position: relative; z-index: 1; }

/* ---------------- 屏幕切换 ---------------- */
.screen { display: none; min-height: 100dvh; align-items: center; justify-content: center; padding: 26px 18px; }
.screen.active { display: flex; animation: fade-in 0.35s ease; }
.screen-page { align-items: center; justify-content: flex-start; padding: 0 16px calc(34px + env(safe-area-inset-bottom)); }
.screen-page.active { flex-direction: column; }
.screen-page > * { width: min(560px, 100%); }

/* ---------------- 卡片 ---------------- */
.card {
  position: relative; display: flex; flex-direction: column; align-items: center;
  width: 100%; max-width: 400px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 26px; padding: 34px 28px 26px;
  box-shadow: 0 20px 44px rgba(56, 110, 60, 0.16);
}
.shake { animation: shake 0.5s; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

/* ---------------- 屏一：邀请码 ---------------- */
.logo-apple { width: 86px; margin-bottom: 10px; filter: drop-shadow(0 6px 14px rgba(90, 155, 62, 0.35)); }
.logo-apple svg { width: 100%; height: auto; display: block; }

.brand {
  font-family: var(--serif); font-size: 34px; font-weight: 700;
  letter-spacing: 10px; text-indent: 10px; color: var(--ink);
  text-shadow: 0 2px 12px rgba(80, 140, 80, 0.28);
}
.brand-sub { font-size: 13px; color: var(--ink-mute); margin-top: 9px; letter-spacing: 1px; text-align: center; line-height: 1.9; padding: 0 4px; }

.field-label { align-self: stretch; font-size: 14px; color: var(--ink-soft); margin: 22px 0 10px; letter-spacing: 1px; }

#invite-input {
  width: 100%; padding: 14px 16px; border-radius: 16px;
  border: 2px solid #c9dfc0; background: rgba(255, 255, 255, 0.88);
  font-size: 16px; color: var(--ink); text-align: center; letter-spacing: 1px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#invite-input::placeholder { color: #a9c3ad; letter-spacing: 2px; }
#invite-input:focus { border-color: #7dbb6a; box-shadow: 0 0 0 4px rgba(125, 187, 106, 0.18); }

.error { min-height: 20px; margin-top: 8px; font-size: 13px; color: var(--warn-ink); text-align: center; }

.card-foot { margin-top: 16px; font-size: 11.5px; color: #9ab69e; letter-spacing: 1.5px; text-align: center; }

/* ---------------- 按钮 ---------------- */
.btn-primary {
  width: 100%; padding: 14px; border: none; border-radius: 999px;
  background: linear-gradient(135deg, #86c45f 0%, #4e9150 100%);
  color: #fff; font-size: 16px; font-weight: 600; letter-spacing: 3px; text-indent: 3px;
  cursor: pointer; box-shadow: 0 10px 22px rgba(78, 145, 80, 0.35);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { transform: scale(0.97); }

.btn-ghost {
  border: 1.5px solid #b9d6ae; background: rgba(255, 255, 255, 0.5);
  color: var(--ink-soft); border-radius: 999px; padding: 8px 15px;
  font-size: 13px; cursor: pointer; transition: background 0.15s, transform 0.15s;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.85); }
.btn-ghost:active { transform: scale(0.96); }

/* ---------------- 屏二：密码 ---------------- */
.mini-head { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.mini-apple svg { width: 22px; height: 22px; display: block; }
.mini-title { font-family: var(--serif); font-size: 17px; letter-spacing: 3px; color: var(--ink); font-weight: 600; }

.tabs {
  display: flex; width: 100%; background: rgba(46, 93, 58, 0.09);
  border-radius: 999px; padding: 4px; margin-bottom: 12px;
}
.tab {
  flex: 1; padding: 10px; border: none; border-radius: 999px; background: transparent;
  color: var(--ink-soft); font-size: 15px; cursor: pointer; transition: all 0.2s;
}
.tab.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 4px 12px rgba(46, 93, 58, 0.13); }

.tab-desc { font-size: 12.5px; color: var(--ink-mute); line-height: 1.8; text-align: center; margin-bottom: 18px; min-height: 44px; }

.otp-boxes { display: flex; gap: 10px; justify-content: center; width: 100%; }
.otp {
  width: 58px; height: 64px; text-align: center; font-size: 26px; font-weight: 700;
  color: var(--ink); background: rgba(255, 255, 255, 0.88);
  border: 2px solid #c4dcbc; border-radius: 16px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.otp:focus { border-color: #7dbb6a; box-shadow: 0 0 0 4px rgba(125, 187, 106, 0.18); }
.otp.filled { background: #f1f9ea; border-color: #a3cf95; }

.warning {
  position: relative; width: 100%; margin-top: 16px;
  background: var(--warn-bg); border: 1px solid var(--warn-bd);
  color: var(--warn-ink); border-radius: 14px; padding: 11px 14px 11px 38px;
  font-size: 13px; line-height: 1.75; animation: fade-in 0.25s ease;
}
.warning::before {
  content: "!"; position: absolute; left: 13px; top: 13px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--warn-ink); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 17px; text-align: center;
}
.warning b { font-weight: 700; }

#pw-btn { margin-top: 16px; }
.pw-card .card-foot { margin-top: 14px; }

.hidden { display: none !important; }

/* ---------------- 屏三：信箱 ---------------- */
.mail-head {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 2px 10px;
  background: linear-gradient(to bottom, rgba(219, 239, 208, 0.95), rgba(219, 239, 208, 0.75));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.head-left { display: flex; align-items: center; gap: 8px; }
.head-title { font-family: var(--serif); font-size: 17px; letter-spacing: 3px; color: var(--ink); font-weight: 600; }
.head-right { display: flex; align-items: center; gap: 10px; }

.sync { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-mute); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #67b36a; display: inline-block; }
/* 同步指示：只换个颜色，不做缩放动画 —— 免得每 4 秒在顶上闪一下 */
.syncing .sync-dot { background: #b7e27f; transition: background 0.2s; }

.btn-write {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.72); border: 1.5px dashed #7db46b;
  color: #3c7a45; font-size: 16px; font-weight: 600; letter-spacing: 2px;
  cursor: pointer; transition: all 0.2s;
}
.btn-write svg { width: 17px; height: 17px; }
.btn-write:hover { background: #fff; border-style: solid; box-shadow: 0 8px 18px rgba(78, 145, 80, 0.16); }
.btn-write:active { transform: scale(0.98); }

#letters { display: flex; flex-direction: column; gap: 20px; margin-top: 18px; }

/* ---------------- 信纸（备忘录卡片） ---------------- */
.memo {
  position: relative; background: var(--paper);
  border: 1px solid #dfeccf; border-radius: 16px;
  padding: 20px 18px 16px;
  box-shadow: 0 8px 20px rgba(70, 120, 70, 0.08);
  animation: card-in 0.35s ease both;
}
.memo::before {
  content: ""; position: absolute; top: -9px; left: 50%;
  transform: translateX(-50%) rotate(-2.5deg);
  width: 92px; height: 20px; border-radius: 3px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.22) 0 6px, transparent 6px 12px),
    linear-gradient(135deg, rgba(148, 201, 104, 0.88), rgba(108, 182, 74, 0.88));
  box-shadow: 0 2px 5px rgba(46, 93, 58, 0.18);
}
.memo::after {
  content: ""; position: absolute; right: 8px; bottom: 6px;
  width: 62px; height: 62px; background: var(--apple-uri) center / contain no-repeat;
  opacity: 0.06; pointer-events: none;
}
.memo-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.author-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; color: #fff; font-weight: 500;
}
.author-chip svg { width: 10px; height: 10px; }
.author-chip.a, .author-chip.b { background: var(--green-a); }
.memo-date { font-family: var(--serif); font-size: 12px; color: #9ab69e; margin-left: auto; letter-spacing: 0.5px; }
.memo-del {
  border: 1px solid #e6cdc5; background: rgba(255, 255, 255, 0.65); color: #bd8d81;
  border-radius: 999px; padding: 2px 9px; font-size: 11px; cursor: pointer; transition: all 0.15s;
}
.memo-del:hover { background: #f6e3dd; color: #b0674f; }

.memo-title { font-family: var(--serif); font-size: 16.5px; font-weight: 700; color: var(--ink); margin: 4px 0 2px; letter-spacing: 0.5px; }
.memo-body {
  font-family: var(--serif); font-size: 15px; line-height: 26px; color: #3b4f40;
  white-space: pre-wrap; word-break: break-word; margin-top: 2px; padding: 0 2px;
  background-image: repeating-linear-gradient(to bottom, transparent 0 25px, var(--line) 25px 26px);
  background-attachment: local;
}
.memo-body-wrap { position: relative; margin-top: 2px; }
.memo-body.long {
  max-height: 312px; overflow: hidden; position: relative;
}
.memo-body.long::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 72px;
  background: linear-gradient(to bottom, transparent, var(--paper));
  pointer-events: none;
}
.memo-expand {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  border: none; background: transparent; color: var(--ink-soft);
  font-size: 12.5px; font-family: var(--serif); cursor: pointer; padding: 4px 8px;
}
.memo-expand:hover { color: var(--apple-deep); }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------------- 空状态 ---------------- */
.empty-state { text-align: center; padding: 46px 0 60px; }
.empty-apple svg { width: 88px; height: 88px; opacity: 0.55; margin-bottom: 12px; }
.empty-title { font-family: var(--serif); font-size: 16px; color: var(--ink-soft); letter-spacing: 2px; }
.empty-sub { font-size: 13px; color: #9ab69e; margin-top: 7px; }

/* ---------------- 写信信纸 ---------------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(30, 62, 38, 0.42);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  animation: fade-in 0.25s ease;
}
.paper {
  position: relative; overflow-x: hidden; overflow-y: auto;
  width: min(560px, 100%); max-height: 88dvh;
  background: #fcfef8; border-radius: 20px; padding: 22px 22px 16px;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 60px rgba(30, 62, 38, 0.35);
  animation: paper-up 0.3s ease;
}
.paper > * { position: relative; z-index: 1; }
.paper::after {
  content: ""; position: absolute; right: 12px; bottom: 8px; z-index: 0;
  width: 96px; height: 96px; background: var(--apple-uri) center / contain no-repeat;
  opacity: 0.07; pointer-events: none;
}
@keyframes paper-up { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

.paper-top {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 9px; border-bottom: 1px dashed #d8e8ce;
}
.paper-date { font-family: var(--serif); font-size: 13px; color: #6f8f77; letter-spacing: 1px; }
.paper-apple svg { width: 20px; height: 20px; display: block; }

.paper-title {
  border: none; border-bottom: 1px dashed #dcead0; background: transparent; outline: none;
  font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--ink);
  padding: 12px 2px 8px; width: 100%; letter-spacing: 1px;
}
.paper-title::placeholder { color: #b7cdbc; font-weight: 400; }

.paper-body {
  flex: 1 0 auto; min-height: 320px; border: none; outline: none; resize: none;
  background: transparent; margin-top: 8px; padding: 0 2px;
  font-family: var(--serif); font-size: 15.5px; line-height: 30px; color: #3b4f40;
  /* 横线跟着内容长，写多长都不会写到格子外面 */
  background-image: repeating-linear-gradient(to bottom, transparent 0 29px, rgba(139, 181, 127, 0.38) 29px 30px);
  background-attachment: local; background-repeat: repeat;
}
.paper-body::placeholder { color: #b7cdbc; }

/* 夹带进信封的东西：图片 / 录音 / 视频 */
.paper-media { margin-top: 12px; }
.media-row { display: flex; gap: 8px; flex-wrap: wrap; }
.media-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px dashed #cfe3c2; background: rgba(255, 255, 255, 0.62);
  color: var(--ink-soft); border-radius: 999px;
  padding: 7px 13px; font-size: 13px; cursor: pointer;
  font-family: var(--serif); letter-spacing: 0.5px;
  transition: all 0.16s;
}
.media-btn:hover { border-color: var(--apple); color: var(--apple-deep); background: #fff; }
.media-btn svg { width: 16px; height: 16px; display: block; }
.media-btn.recording {
  border-style: solid; border-color: #e08a76; color: #c05b45; background: var(--warn-bg);
  animation: rec-pulse 1.1s ease-in-out infinite;
}
@keyframes rec-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

.media-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.media-strip:empty { display: none; }
.media-item {
  position: relative; border-radius: 12px; overflow: hidden;
  border: 1px solid #dceccf; background: #fff;
  display: flex; align-items: center; justify-content: center;
  animation: card-in 0.28s ease both;
}
.media-image { width: 76px; height: 76px; }
.media-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-video { width: 112px; height: 76px; }
.media-video video { width: 100%; height: 100%; object-fit: cover; display: block; background: #1f2a20; }
.media-audio { padding: 5px 28px 5px 5px; }
.media-audio audio { height: 34px; width: 196px; max-width: 54vw; }
.media-badge {
  position: absolute; left: 5px; bottom: 5px;
  background: rgba(24, 46, 30, 0.62); color: #fff;
  font-size: 10.5px; padding: 1px 6px; border-radius: 999px; letter-spacing: 0.5px;
}
.media-del {
  position: absolute; top: 3px; right: 3px;
  width: 20px; height: 20px; border-radius: 50%; padding: 0;
  border: none; background: rgba(28, 52, 34, 0.6); color: #fff;
  font-size: 14px; line-height: 18px; cursor: pointer;
}
.media-del:hover { background: #c05b45; }

/* 信里的图片 / 录音 / 视频 */
.memo-media { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.memo-img {
  width: 100%; max-height: 300px; object-fit: cover; display: block;
  border-radius: 12px; border: 1px solid #e0edd5; cursor: zoom-in;
}
.memo-audio { width: 100%; height: 40px; }
.memo-video {
  width: 100%; max-height: 300px; display: block;
  border-radius: 12px; background: #1f2a20;
}

/* ---------------- 落款下面的评论区 ---------------- */
.cmt-zone { margin-top: 14px; border-top: 1px dashed #dfeecd; padding-top: 12px; }
.cmt-list { display: flex; flex-direction: column; gap: 10px; }
.cmt-list:empty { display: none; }
.cmt { display: flex; align-items: flex-start; gap: 8px; }
/* 头像永远是同一颗青苹果，没有名字，人人都一样 */
.cmt-apple { flex: 0 0 auto; width: 24px; height: 24px; margin-top: 1px; }
.cmt-apple svg { width: 100%; height: 100%; display: block; }
.cmt-main { flex: 1; min-width: 0; }
.cmt-text {
  font-family: var(--serif); font-size: 14px; line-height: 22px; color: #46614c;
  white-space: pre-wrap; word-break: break-word;
}
.cmt-del {
  flex: 0 0 auto; border: none; background: transparent; color: #c3b0aa;
  font-size: 15px; line-height: 1; padding: 2px 4px; cursor: pointer;
}
.cmt-del:hover { color: #b0674f; }
.cmt-media { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.cmt-img {
  width: 100%; max-width: 220px; max-height: 200px; object-fit: cover;
  border-radius: 10px; border: 1px solid #e3eed9; display: block; cursor: zoom-in;
}
.cmt-audio { width: 100%; max-width: 260px; height: 34px; }
.cmt-video {
  width: 100%; max-width: 260px; max-height: 200px;
  border-radius: 10px; background: #1f2a20; display: block;
}
.cmt-more {
  align-self: flex-start; border: none; background: transparent;
  color: var(--ink-mute); font-size: 12.5px; padding: 0; cursor: pointer;
  font-family: var(--serif); letter-spacing: 0.5px;
}
.cmt-more:hover { color: var(--apple-deep); }

.cmt-input-row { margin-top: 12px; }
.cmt-input {
  width: 100%; min-height: 34px; max-height: 170px; resize: none; display: block;
  border: 1px solid #e0edd5; border-radius: 12px; background: rgba(255, 255, 255, 0.72);
  padding: 8px 10px; outline: none;
  font-family: var(--serif); font-size: 14px; line-height: 20px; color: #3b4f40;
}
.cmt-input:focus { border-color: #a8d06f; background: #fff; }
.cmt-input::placeholder { color: #b7cdbc; }
.cmt-strip { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.cmt-chip {
  position: relative; width: 52px; height: 52px; border-radius: 10px; overflow: hidden;
  border: 1px solid #dceccf; background: #f4f9ee;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #6f8f77; font-family: var(--serif);
}
.cmt-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmt-chip-del {
  position: absolute; top: 1px; right: 1px; width: 16px; height: 16px; padding: 0;
  border: none; border-radius: 50%; background: rgba(28, 52, 34, 0.6);
  color: #fff; font-size: 11px; line-height: 15px; cursor: pointer;
}
.cmt-acts { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.cmt-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid #e0edd5; background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft); border-radius: 999px; padding: 5px 10px;
  font-size: 12px; cursor: pointer; font-family: var(--serif);
}
.cmt-btn .cmt-ic { display: inline-flex; width: 14px; height: 14px; }
.cmt-btn .cmt-ic svg { width: 100%; height: 100%; display: block; }
.cmt-btn.recording {
  border-color: #e08a76; color: #c05b45; background: var(--warn-bg);
  animation: rec-pulse 1.1s ease-in-out infinite;
}
.cmt-send {
  margin-left: auto; border: none; cursor: pointer;
  background: linear-gradient(135deg, #8cc152, #5a9b3e); color: #fff;
  border-radius: 999px; padding: 7px 16px; font-size: 13px;
  font-family: var(--serif); letter-spacing: 1px;
}
.cmt-send:active { transform: translateY(1px); }

/* 看大图 */
#viewer { background: rgba(12, 26, 16, 0.93); cursor: zoom-out; }
#viewer-img { max-width: 94vw; max-height: 84dvh; border-radius: 8px; object-fit: contain; }
.viewer-close {
  position: absolute; top: 16px; right: 18px;
  width: 40px; height: 40px; border-radius: 50%; padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.13);
  color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
}
.file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; left: -9999px; pointer-events: none; }

/* 信尾落款 */
.paper-sign {
  display: flex; align-items: center; justify-content: flex-end; gap: 7px;
  margin-top: 12px; padding-top: 4px;
}
.sign-input {
  width: 44%; max-width: 150px; text-align: right;
  border: none; border-bottom: 1px dashed #d5e6c9; background: transparent;
  outline: none; font-family: var(--serif); font-size: 14.5px; color: var(--ink);
  padding: 5px 2px; letter-spacing: 1px;
}
.sign-input::placeholder { color: #b7cdbc; font-size: 13px; letter-spacing: 0; }
.sign-input:focus { border-bottom-color: #8cc152; }
.sign-dash { font-family: var(--serif); font-size: 13px; color: #9ab69e; }

.memo-sign {
  text-align: right; font-family: var(--serif); font-size: 13.5px;
  color: #6f8f74; margin-top: 12px; letter-spacing: 1px;
}

.paper-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding-top: 12px; margin-top: 10px; border-top: 1px dashed #e2eed8;
  background: #fcfef8;
}
.paper-actions .btn-primary { width: auto; padding: 11px 26px; }

/* ---------------- 笔名 ---------------- */
.nick-card { max-width: 340px; padding: 28px 26px 22px; }
.nick-title { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--ink); letter-spacing: 1px; }
.nick-sub { font-size: 12.5px; color: var(--ink-mute); margin: 7px 0 16px; }
.nick-input {
  width: 100%; padding: 12px 14px; border-radius: 14px;
  border: 2px solid #c9dfc0; background: rgba(255, 255, 255, 0.9);
  font-size: 15px; color: var(--ink); text-align: center; outline: none;
}
.nick-input:focus { border-color: #7dbb6a; }

/* ---------------- Toast ---------------- */
#toast-wrap {
  position: fixed; top: max(16px, env(safe-area-inset-top)); left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 200; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px;
  background: rgba(38, 77, 46, 0.93); color: #f2f8ee;
  border-radius: 999px; padding: 10px 18px; font-size: 13.5px; letter-spacing: 0.5px;
  box-shadow: 0 10px 24px rgba(30, 62, 38, 0.3);
  animation: toast-in 0.3s ease; max-width: 86vw;
}
.toast svg { width: 15px; height: 15px; flex: none; }
.toast.hide { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px); } }

/* ---------------- 文件夹栏 ---------------- */
.folder-bar {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px;
  scrollbar-width: none; margin-top: 8px;
}
.folder-bar::-webkit-scrollbar { display: none; }
.folder-tab {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; cursor: pointer;
  background: rgba(255, 255, 255, 0.66); border: 1.5px solid #d7e8cd;
  color: #4b7a52; white-space: nowrap; transition: all 0.18s;
}
.folder-tab svg { width: 11px; height: 11px; }
.folder-tab .ft-count { font-size: 11px; color: #8fae94; }
.folder-tab.active {
  background: var(--green-a); border-color: var(--green-a); color: #fff;
  box-shadow: 0 6px 14px rgba(93, 156, 84, 0.28);
}
.folder-tab.active .ft-count { color: rgba(255, 255, 255, 0.82); }
.folder-tab:active { transform: scale(0.96); }

/* ---------------- 长按操作面板 ---------------- */
.overlay.sheet-overlay { align-items: flex-end; padding: 0; }
.sheet {
  width: 100%; max-width: 460px; background: #fbfdf8;
  border-radius: 22px 22px 0 0; padding: 20px 18px calc(16px + env(safe-area-inset-bottom));
  animation: sheet-up 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.sheet-title {
  font-family: var(--serif); font-size: 15px; color: var(--ink);
  letter-spacing: 1px; margin-bottom: 14px; padding-left: 4px;
}
.sheet-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.sheet-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 13px 16px; border-radius: 14px; border: 1.5px solid #dfeccf;
  background: #fff; color: #3c6a45; font-size: 14.5px; cursor: pointer;
  transition: all 0.16s; text-align: left;
}
.sheet-item svg { width: 14px; height: 14px; flex: none; }
.sheet-item:hover { border-color: #a8cf96; background: #f7fbf3; }
.sheet-item:active { transform: scale(0.985); }
.sheet-item.current { border-color: var(--green-a); background: #f2f9ec; }
.sheet-item.current::after { content: "在这"; margin-left: auto; font-size: 11.5px; color: #7ba86a; }
.sheet-item.danger { color: #b56a55; border-color: #f0d9d2; }
.sheet-item.danger:hover { background: #fdf3f0; border-color: #e8bfb2; }
.sheet-cancel {
  width: 100%; padding: 13px; border-radius: 14px; border: none;
  background: rgba(120, 160, 120, 0.12); color: #5c7a60;
  font-size: 14.5px; cursor: pointer; letter-spacing: 1px;
}
.sheet-cancel:active { transform: scale(0.985); }

/* 长按反馈 */
.memo.pressing { transform: scale(0.972); box-shadow: 0 4px 12px rgba(70, 120, 70, 0.14); }
.memo { transition: transform 0.18s ease, box-shadow 0.18s ease; }
.memo-folder-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: #8aa98f; margin-left: 6px;
}
.memo-folder-tag svg { width: 10px; height: 10px; }

/* ---------------- 批量整理 ---------------- */
.pick-dot {
  position: absolute; left: 10px; top: 15px; z-index: 2;
  width: 21px; height: 21px; border-radius: 50%; cursor: pointer;
  border: 1.8px solid #c3d9b8; background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.pick-dot svg { width: 12px; height: 12px; }
.pick-dot.on { background: var(--green-a); border-color: var(--green-a); color: #fff; }
.memo.picking { padding-left: 42px; }

.pick-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 130;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.97); border-top: 1px solid #e2eed8;
  box-shadow: 0 -6px 20px rgba(70, 120, 70, 0.1);
  animation: sheet-up 0.24s ease both;
}
.pick-count { font-size: 14px; color: #3c6a45; letter-spacing: 0.5px; }
.pick-actions { display: flex; gap: 10px; }
.pick-actions .btn-primary { width: auto; padding: 10px 22px; font-size: 14px; }
.pick-actions .btn-primary:disabled { opacity: 0.45; cursor: default; }

/* ---------------- 小屏适配 ---------------- */
@media (max-width: 390px) {
  .brand { font-size: 30px; letter-spacing: 8px; text-indent: 8px; }
  .otp { width: 52px; height: 58px; }
  .otp-boxes { gap: 8px; }
  .card { padding: 28px 22px 22px; }
}
