:root {
  color-scheme: light;
  --pink: #f45e91;
  --pink-bright: #ff719b;
  --pink-pale: #ffe7ef;
  --plum: #392644;
  --ink: #4a3548;
  --muted: #927f90;
  --paper: #fff9f6;
  --line: rgba(226, 190, 211, .72);
  --shadow: 0 18px 46px rgba(25, 12, 36, .24);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: #211d3d; }
body { -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
#app { min-height: 100dvh; }
.boot-screen, .auth-screen, .scene-page { position: relative; min-height: 100dvh; overflow: hidden; }
.boot-screen { display: grid; place-content: center; gap: 16px; color: #fff3f7; text-align: center; letter-spacing: .08em; }
.boot-screen p { margin: 0; font-size: 15px; }
.boot-flower { width: 34px; height: 34px; margin: auto; border: 3px solid rgba(255,255,255,.22); border-top-color: #ff9dbb; border-radius: 50%; animation: spin .8s linear infinite; }

.scene-page { overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: max(18px, env(safe-area-inset-top)) 0 calc(92px + env(safe-area-inset-bottom)); color: #fff7f8; background: #201d3d url("https://picc.ggl-lam.yuxiapp.com/miniapp/love-note/v20261109/night-garden-mailbox-bg.png") center top / cover fixed no-repeat; }
.scene-page::before { position: fixed; inset: 0; z-index: 0; background: linear-gradient(180deg, rgba(20,22,53,.27), rgba(33,22,47,.42) 66%, rgba(30,19,36,.67)); content: ""; pointer-events: none; }
.scene-page > * { position: relative; z-index: 1; }
.page-wrap { width: min(100%, 520px); min-height: calc(100dvh - 18px); margin: 0 auto; padding: 4px 22px 30px; }
.topbar { display: flex; align-items: center; min-height: 42px; gap: 12px; }
.back-button { display: inline-grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(255,255,255,.32); border-radius: 50%; color: white; background: rgba(255,255,255,.1); font-size: 24px; line-height: 1; }
.topbar-title { margin: 0; flex: 1; color: #fff6fa; text-align: center; font-size: 17px; font-weight: 700; letter-spacing: .08em; }
.topbar-spacer { width: 38px; }
.kicker { color: #f9afc8; font-size: 11px; font-weight: 800; letter-spacing: .28em; text-align: center; }
.page-title { margin: 6px 0; color: #fff7fb; text-align: center; font-size: clamp(23px, 7vw, 30px); line-height: 1.35; text-shadow: 0 2px 18px rgba(11,9,33,.42); }
.page-subtitle { margin: 0; color: rgba(255,241,246,.86); text-align: center; font-size: 14px; line-height: 1.8; }

.home-wrap { display: flex; flex-direction: column; padding-top: 4px; }
.home-wordmark { width: min(100%, 410px); height: clamp(150px, 47vw, 208px); margin: 0 auto -6px; object-fit: contain; filter: drop-shadow(0 9px 17px rgba(13,9,32,.3)); animation: sign-sway 6s ease-in-out infinite; transform-origin: 50% 10%; }
.home-message { margin: 0 0 5px; color: #fff3f5; text-align: center; font-size: 14px; line-height: 1.65; text-shadow: 0 2px 9px rgba(9,8,31,.6); }
.home-stage { position: relative; display: flex; justify-content: center; align-items: end; min-height: clamp(238px, 76vw, 340px); margin: -2px 0 2px; }
.home-stage::after { position: absolute; z-index: 0; bottom: 9px; width: 196px; height: 25px; border-radius: 50%; background: radial-gradient(ellipse, rgba(11,8,20,.76), transparent 73%); content: ""; }
.home-mailbox { position: relative; z-index: 1; width: min(74vw, 295px); height: clamp(240px, 76vw, 340px); object-fit: contain; object-position: center bottom; filter: drop-shadow(0 13px 16px rgba(8,6,23,.34)); animation: mailbox-breathe 5s ease-in-out infinite; }
.count-pill { display: flex; width: min(82%, 330px); justify-content: center; align-items: center; gap: 13px; margin: 4px auto 15px; padding: 11px 17px; border: 1px solid rgba(255,224,230,.28); border-radius: 999px; background: rgba(31,24,49,.6); color: #fff0f4; font-size: 13px; backdrop-filter: blur(8px); }
.count-pill strong { color: #ffd6ac; font-size: 15px; }
.count-dot { width: 4px; height: 4px; border-radius: 50%; background: #ff9db6; }
.primary-actions { display: grid; width: min(82%, 330px); gap: 12px; margin: 0 auto; }
.action-button, .button-primary, .button-secondary, .button-soft { display: inline-flex; min-height: 54px; justify-content: center; align-items: center; gap: 11px; padding: 12px 18px; border: 1px solid rgba(255,255,255,.78); border-radius: 999px; box-shadow: 0 10px 25px rgba(19,10,32,.24), inset 0 1px 2px rgba(255,255,255,.42); font-weight: 800; transition: transform .18s ease, filter .18s ease; }
.action-button:active, .button-primary:active, .button-secondary:active, .button-soft:active { transform: scale(.975); filter: brightness(1.05); }
.action-button { color: #fff; background: linear-gradient(135deg, #ff8ca9, #f45e91 62%, #e84b83); font-size: 17px; }
.action-button.secondary { color: #64444f; background: linear-gradient(135deg, #fff4e5, #f8d7c0); }
.action-icon { width: 25px; height: 25px; object-fit: contain; }
.bottom-nav { display: flex; justify-content: space-around; align-items: center; gap: 8px; margin: auto 0 0; padding: 22px 2px 3px; }
.nav-item { display: grid; min-width: 80px; justify-items: center; gap: 5px; border: 0; color: #fff4f6; background: transparent; font-size: 12px; text-shadow: 0 2px 9px rgba(9,8,31,.65); }
.nav-item img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(12,8,24,.34)); }
.note-status { display: flex; width: min(90%, 360px); min-height: 45px; justify-content: center; align-items: center; gap: 9px; margin: 13px auto 0; padding: 8px 13px; border: 1px solid rgba(255,234,241,.25); border-radius: 15px; color: #fff2f5; background: rgba(35,25,48,.43); text-align: center; font-size: 12px; line-height: 1.55; }
.note-status-icon { width: 19px; height: 19px; flex: 0 0 19px; object-fit: contain; }
.bottom-nav-spacer { min-height: 8px; flex: 1; }

.glass-card { margin: 20px 0; padding: 18px; border: 1px solid rgba(255,231,239,.66); border-radius: 23px; color: var(--ink); background: linear-gradient(145deg, rgba(255,251,249,.97), rgba(255,234,243,.96)); box-shadow: var(--shadow); }
.section-heading { margin: 0 0 12px; color: var(--plum); font-size: 18px; font-weight: 800; }
.field-label { display: block; margin: 16px 0 8px; color: #634d60; font-size: 14px; font-weight: 700; }
.field-help { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.input, .select, .textarea { display: block; width: 100%; min-height: 46px; padding: 12px 13px; border: 1px solid #f0d5e1; border-radius: 14px; outline: 0; color: #493744; background: rgba(255,255,255,.82); font-size: 15px; }
.input:focus, .select:focus, .textarea:focus { border-color: #f59ab7; box-shadow: 0 0 0 3px rgba(244,94,145,.1); }
.textarea { min-height: 130px; resize: vertical; line-height: 1.7; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.field.full { grid-column: 1 / -1; }
.radio-row { display: flex; gap: 10px; }
.radio-option, .contact-option { display: inline-flex; flex: 1; min-height: 44px; justify-content: center; align-items: center; gap: 8px; border: 1px solid #efd5e1; border-radius: 14px; color: #766072; background: #fffafa; }
.radio-option input, .contact-option input { accent-color: var(--pink); }
.radio-option:has(input:checked), .contact-option.is-selected { border-color: #f377a0; color: #c84673; background: #fff0f5; }
.sms-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.sms-row .input { min-width: 0; }
.sms-send { min-width: 108px; padding: 0 12px; border: 1px solid #ef82a3; border-radius: 14px; color: #cf4d79; background: #fff1f6; font-size: 13px; font-weight: 700; }
.button-primary { width: 100%; margin-top: 17px; color: white; background: linear-gradient(110deg, #ff7da1, #ef4f86); font-size: 16px; }
.button-secondary { width: 100%; min-height: 48px; margin-top: 10px; border-color: rgba(255,255,255,.45); color: white; background: rgba(255,255,255,.1); font-size: 14px; }
.button-soft { width: 100%; min-height: 46px; border: 1px solid #f1c4d4; color: #bc4c75; background: #fff2f6; font-size: 14px; }
.subtle-note { margin: 12px 2px 0; color: #fbe7ed; text-align: center; font-size: 12px; line-height: 1.65; }

.extract-stage { position: relative; display: grid; min-height: 46vh; place-items: center; margin: 5px 0 12px; }
.extract-jar { width: min(72vw, 305px); max-height: 43vh; object-fit: contain; filter: drop-shadow(0 15px 25px rgba(8,6,22,.45)); }
.extract-stage.shaking .extract-jar { animation: jar-shake .8s ease-in-out; }
.draw-envelope { position: absolute; z-index: 3; top: 56%; left: 50%; width: 88px; height: 64px; object-fit: contain; opacity: 0; pointer-events: none; filter: drop-shadow(0 8px 12px rgba(15,8,28,.34)); }
.extract-stage.shaking .draw-envelope { animation: jar-envelope-flight .78s .08s cubic-bezier(.15,.7,.25,1) forwards; }
.draw-copy { margin: -4px 0 20px; color: #ffeef3; text-align: center; font-size: 14px; }
.paper-flight { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; overflow: hidden; background: rgba(28,18,44,.55); animation: fade-in .2s ease both; }
.flight-mailbox { position: absolute; right: 8%; bottom: 10%; width: min(43vw, 210px); height: 34vh; object-fit: contain; }
.flight-envelope { position: absolute; z-index: 2; left: 40%; top: 34%; width: 130px; transform-origin: 50% 50%; animation: envelope-flight 1.1s cubic-bezier(.24,.7,.2,1) forwards; }
.flight-label { position: absolute; bottom: 18%; width: 100%; color: #fff4f7; text-align: center; font-size: 15px; letter-spacing: .12em; }

.note-paper { position: relative; padding: 24px 21px; border: 1px solid rgba(230,190,204,.76); border-radius: 20px; color: #4c3547; background: #fffaf6 url("https://picc.ggl-lam.yuxiapp.com/miniapp/love-note/v20261109/paper-result.png") center / 100% 100% no-repeat; box-shadow: 0 13px 30px rgba(37,17,40,.16); }
.owner-row { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.avatar { width: 48px; height: 48px; flex: 0 0 48px; border: 2px solid #ffe5ed; border-radius: 50%; object-fit: cover; background: #f8dce7; }
.avatar-fallback { display: grid; place-items: center; color: #e06490; font-size: 18px; }
.owner-name { color: #b6426c; font-size: 15px; font-weight: 800; }
.owner-sub { margin-top: 3px; color: #96818f; font-size: 12px; }
.note-content { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.75; }
.note-images { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.note-images img, .upload-preview img { width: 100%; aspect-ratio: 1; border-radius: 12px; object-fit: cover; }
.contact-block { margin-top: 16px; padding-top: 14px; border-top: 1px dashed #eacbd7; }
.contact-line { display: flex; align-items: center; gap: 9px; min-height: 44px; color: #62485e; font-size: 14px; }
.contact-line img { width: 20px; height: 20px; object-fit: contain; }
.contact-line .text { flex: 1; overflow-wrap: anywhere; }
.contact-action { padding: 6px 10px; border: 0; border-radius: 999px; color: #bf4f78; background: #ffe5ee; font-size: 12px; }
.result-card { position: relative; width: min(calc(100% - 30px), 470px); max-height: 88dvh; overflow: auto; padding: 21px 19px 19px; border: 1px solid rgba(255,255,255,.85); border-radius: 26px; color: var(--ink); background: linear-gradient(155deg, #fffdfb, #fff0f6); box-shadow: 0 25px 80px rgba(8,5,20,.5); animation: pop-in .3s cubic-bezier(.2,.8,.25,1.1) both; }
.result-title { margin: 4px 30px 16px; color: #7a4964; text-align: center; font-size: 22px; font-weight: 800; }
.modal-close { position: absolute; top: 13px; right: 15px; display: grid; width: 32px; height: 32px; place-items: center; border: 0; color: #9a788b; background: transparent; font-size: 25px; }
.result-actions { display: grid; gap: 9px; margin-top: 16px; }
.result-again { width: 100%; min-height: 49px; border: 1px solid white; border-radius: 999px; color: white; background: linear-gradient(110deg, #ff7fa2, #ed4d84); font-weight: 800; }
.result-library { width: 100%; min-height: 44px; border: 1px solid #efc3d2; border-radius: 999px; color: #b84b73; background: #fff2f6; font-weight: 700; }

.tab-switch { display: grid; grid-template-columns: 1fr 1fr; margin: 18px 0; padding: 4px; border-radius: 999px; background: rgba(255,245,248,.94); }
.tab-switch button { min-height: 42px; border: 0; border-radius: 999px; color: #806b7c; background: transparent; font-weight: 700; }
.tab-switch button.active { color: white; background: linear-gradient(110deg, #ff7da1, #ef4f86); box-shadow: 0 5px 14px rgba(203,62,113,.23); }
.item-card { margin: 12px 0; padding: 17px; border: 1px solid rgba(255,236,242,.74); border-radius: 19px; color: var(--ink); background: linear-gradient(145deg, rgba(255,252,249,.98), rgba(255,237,244,.98)); box-shadow: 0 12px 30px rgba(20,10,33,.2); }
.item-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 9px; color: #9a8492; font-size: 12px; }
.status-chip { padding: 5px 9px; border-radius: 999px; color: #a45b29; background: #fff0d9; white-space: nowrap; }
.status-chip.passed { color: #32825a; background: #e7f7ec; }
.status-chip.rejected { color: #c13e70; background: #ffe4ed; }
.item-card .note-content { max-height: 8.5em; overflow: hidden; }
.item-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.item-actions button { min-height: 34px; padding: 6px 12px; border: 1px solid #f0c0d2; border-radius: 999px; color: #b94c73; background: #fff3f7; font-size: 12px; }
.empty-state { display: grid; justify-items: center; gap: 10px; padding: 42px 12px; color: #ffedf3; text-align: center; }
.empty-state img { width: 75px; height: 75px; object-fit: contain; }
.empty-state strong { font-size: 17px; }
.empty-state span { color: rgba(255,240,245,.82); font-size: 13px; }
.upload-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 10px; }
.upload-cell { position: relative; }
.upload-cell button { position: absolute; top: 5px; right: 5px; display: grid; width: 24px; height: 24px; place-items: center; border: 0; border-radius: 50%; color: white; background: rgba(76,43,62,.76); }
.upload-add { display: grid; min-height: 92px; place-content: center; gap: 4px; border: 1px dashed #e5b8cb; border-radius: 13px; color: #bd6c8d; background: #fff5f8; text-align: center; }
.upload-add strong { font-size: 25px; font-weight: 400; }
.upload-add span { font-size: 11px; }
.contact-options { display: flex; gap: 9px; }
.contact-option { min-height: 46px; justify-content: flex-start; padding: 0 10px; }
.contact-option input { margin: 0; }
.stepper { display: inline-flex; align-items: center; gap: 15px; padding: 5px 7px; border: 1px solid #f0d4e0; border-radius: 999px; background: #fffafa; }
.stepper button { width: 35px; height: 35px; border: 0; border-radius: 50%; color: #c24b78; background: #ffe8f0; font-size: 21px; }
.stepper span { min-width: 22px; color: #634457; text-align: center; font-weight: 800; }
.age-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 9px; }
.age-row .input { text-align: center; }
.submit-success { display: grid; min-height: 70vh; align-content: center; justify-items: center; gap: 11px; text-align: center; }
.success-mark { display: grid; width: 74px; height: 74px; place-items: center; border: 1px solid rgba(255,255,255,.72); border-radius: 50%; color: white; background: linear-gradient(135deg, #ff9bb5, #e9568c); box-shadow: 0 15px 34px rgba(220,71,125,.3); font-size: 37px; }
.submit-success h2 { margin: 5px 0 0; font-size: 25px; }
.submit-success p { margin: 0; color: rgba(255,241,246,.85); font-size: 14px; line-height: 1.7; }
.progress-note { margin-top: 10px; color: #fddde7; font-size: 12px; }

.auth-screen { display: grid; place-items: center; overflow-x: hidden; overflow-y: auto; padding: max(22px, env(safe-area-inset-top)) 22px max(22px, env(safe-area-inset-bottom)); color: #fff; background: #211d3d url("https://picc.ggl-lam.yuxiapp.com/miniapp/love-note/v20261109/night-garden-mailbox-bg.png") center / cover no-repeat; }
.auth-screen::before { position: absolute; inset: 0; background: rgba(21,18,43,.52); content: ""; }
.auth-panel { position: relative; width: min(100%, 470px); max-height: 90dvh; overflow-y: auto; padding: 24px; border: 1px solid rgba(255,255,255,.76); border-radius: 26px; background: linear-gradient(145deg, rgba(255,253,250,.98), rgba(255,237,244,.97)); box-shadow: var(--shadow); color: var(--ink); }
.auth-brand { display: block; width: min(80%, 280px); height: 110px; margin: 0 auto 10px; object-fit: contain; }
.auth-panel h1 { margin: 0 0 8px; color: #69445d; text-align: center; font-size: 23px; }
.auth-panel > p { margin: 0 0 17px; color: #8b7888; text-align: center; font-size: 13px; line-height: 1.7; }
.auth-hint { margin-top: 12px !important; color: #ac6c86 !important; font-size: 12px !important; }
.notice-card { padding: 13px 14px; border: 1px solid #f1d3df; border-radius: 14px; color: #775d70; background: rgba(255,255,255,.65); font-size: 13px; line-height: 1.7; }
.policy-overlay { position: fixed; z-index: 50; inset: 0; display: grid; place-items: end center; padding: 16px 12px calc(12px + env(safe-area-inset-bottom)); background: rgba(12,8,25,.68); animation: fade-in .18s ease both; }
.policy-card { width: min(100%, 520px); max-height: 85dvh; display: flex; flex-direction: column; padding: 21px 19px 15px; border: 1px solid #fff; border-radius: 23px; color: #533e52; background: #fff8f7; box-shadow: var(--shadow); animation: slide-up .25s ease both; }
.policy-card h2 { margin: 0; color: #754961; text-align: center; font-size: 18px; }
.policy-card p { margin: 8px 0 11px; color: #9a8391; text-align: center; font-size: 12px; }
.policy-text { overflow: auto; min-height: 90px; padding: 12px; border: 1px solid #f0dce5; border-radius: 14px; background: white; white-space: pre-wrap; font-size: 13px; line-height: 1.75; }
.policy-actions { display: grid; grid-template-columns: .85fr 1.15fr; gap: 10px; margin-top: 13px; }
.policy-actions button { min-height: 44px; border: 1px solid #ebcad7; border-radius: 999px; color: #9b7388; background: #fff; }
.policy-actions button:last-child { border-color: #ef7198; color: white; background: linear-gradient(110deg, #ff7da1, #ef4f86); font-weight: 800; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(32px + env(safe-area-inset-bottom)); max-width: calc(100% - 34px); padding: 11px 16px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; color: white; background: rgba(43,31,49,.91); box-shadow: 0 9px 30px rgba(0,0,0,.28); font-size: 13px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.busy-overlay { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; background: rgba(19,14,34,.35); }
.busy-panel { display: grid; min-width: 136px; justify-items: center; gap: 12px; padding: 20px; border-radius: 18px; color: white; background: rgba(49,38,53,.91); }
.busy-spinner { width: 28px; height: 28px; border: 3px solid rgba(255,255,255,.25); border-top-color: #ff91b0; border-radius: 50%; animation: spin .8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(15px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes slide-up { from { transform: translateY(26px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
@keyframes sign-sway { 0%, 100% { transform: rotate(-.7deg); } 50% { transform: rotate(.7deg); } }
@keyframes mailbox-breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes jar-shake { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-5deg) translateX(-5px); } 32% { transform: rotate(5deg) translateX(5px); } 49% { transform: rotate(-4deg) translateX(-3px); } 68% { transform: rotate(3deg) translateX(3px); } 84% { transform: rotate(-1deg); } }
@keyframes envelope-flight { 0% { opacity: 0; transform: translate(-42vw, 18vh) rotate(-18deg) rotateX(0deg) scale(.7); } 18% { opacity: 1; } 48% { transform: translate(-2vw, 2vh) rotate(2deg) rotateX(14deg) scale(1); } 78% { opacity: 1; transform: translate(16vw, -7vh) rotate(8deg) rotateX(38deg) scale(.82); } 100% { opacity: 0; transform: translate(44vw, -18vh) rotate(18deg) rotateX(76deg) scale(.16); } }
@keyframes jar-envelope-flight { 0% { opacity: 0; transform: translate(-50%, 28%) rotate(-14deg) scale(.22); } 24% { opacity: 1; transform: translate(-50%, 3%) rotate(7deg) scale(1); } 56% { opacity: 1; transform: translate(calc(-50% + var(--flight-x)), -72%) rotate(-6deg) scale(.8); } 100% { opacity: 0; transform: translate(calc(-50% + var(--flight-x)), calc(-155% + var(--flight-y))) rotate(var(--flight-r)) scale(.36); } }

@media (min-width: 600px) {
  .scene-page { padding-top: 20px; }
  .home-wrap { min-height: calc(100dvh - 114px); }
  .home-stage { min-height: 290px; }
}
@media (max-height: 720px) {
  .home-wordmark { height: 145px; }
  .home-stage { min-height: 225px; }
  .home-mailbox { height: 235px; }
  .bottom-nav { padding-top: 14px; }
}
