:root {
  --mist: #9090c0;
  --periwinkle: #aeb3df;
  --lilac: #d6c9e5;
  --rose: #e6bdc8;
  --peach: #efc5a8;
  --cream: #fbf5ed;
  --ink: #34334c;
  --text: #53516b;
  --muted: #77748c;
  --glass: rgba(255,255,255,.68);
  --line: rgba(83,81,107,.14);
  --shadow: 0 22px 54px rgba(83,75,115,.17);
  font-family: ui-serif, "Songti SC", "STSong", Georgia, serif;
  color: var(--ink);
  background: #ece9f2;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; min-height: 100%; background: #ece9f2; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background:
  linear-gradient(180deg, rgba(244,241,246,.2), rgba(237,233,241,.92)),
  url("/assets/传家宝首页主视觉.png") center / cover fixed no-repeat,
  radial-gradient(circle at 10% 6%, #faf8f5, #ddd9e7 64%, #c4c3d8); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(247,243,244,.7), rgba(236,231,241,.2) 52%, rgba(224,221,237,.45)); }
button, input, textarea { font: inherit; }
button, input[type="range"] { touch-action: manipulation; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.wrap { position: relative; z-index: 1; width: min(100%, 520px); min-height: 100vh; margin: 0 auto; padding: 20px 18px calc(46px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; }
.brand { color: var(--ink); text-decoration: none; letter-spacing: .3em; font-size: 17px; }
.mode { color: var(--muted); font: 12px/1.4 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; }
.screen { display: none; min-height: calc(100vh - 86px); animation: enter .35s ease both; }
.screen.active { display: flex; flex-direction: column; }
.intro { justify-content: flex-end; padding-bottom: 5vh; }
.intro-copy { margin-bottom: clamp(36px, 14vh, 126px); }
.eyebrow { margin: 0 0 10px; color: #7776a8; font: 600 12px/1.4 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; letter-spacing: .2em; }
h1 { margin: 0; font-size: clamp(34px, 10vw, 48px); line-height: 1.15; font-weight: 500; letter-spacing: .07em; }
.subtitle { margin: 12px 0 0; color: var(--muted); font-size: 15px; line-height: 1.75; }
.glass-card { background: var(--glass); border: 1px solid rgba(255,255,255,.72); box-shadow: var(--shadow); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.intro-fields { display: grid; grid-template-columns: 1fr 112px; gap: 12px; padding: 17px; border-radius: 24px; }
label { display: grid; gap: 7px; color: var(--muted); font: 12px/1.45 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; }
input, textarea { width: 100%; min-height: 46px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 14px; outline: none; color: var(--ink); background: rgba(255,255,255,.66); }
textarea { resize: vertical; line-height: 1.7; }
input:focus, textarea:focus { border-color: var(--mist); box-shadow: 0 0 0 3px rgba(144,144,192,.14); }
.primary-button, .secondary-button { display: grid; place-items: center; min-height: 52px; width: 100%; margin-top: 15px; padding: 12px 20px; border-radius: 999px; text-align: center; text-decoration: none; letter-spacing: .08em; }
.primary-button { border: 0; color: #fff; background: linear-gradient(135deg, #8e8dbb, #a7a1c8); box-shadow: 0 12px 28px rgba(93,87,137,.26); }
.secondary-button { border: 1px solid rgba(113,109,150,.2); color: #6e6b96; background: rgba(255,255,255,.64); }
.primary-button:disabled, .secondary-button:disabled { opacity: .48; cursor: not-allowed; }
.section-head { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: start; padding: 22px 0 18px; }
.back-button { width: 44px; height: 44px; margin-top: 2px; border: 0; border-radius: 50%; color: #716e98; background: rgba(255,255,255,.58); font-size: 22px; }
.section-head h1 { font-size: clamp(30px, 8vw, 42px); }
.statusbar { position: sticky; top: 10px; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 14px; padding: 9px 12px; border: 1px solid rgba(108,132,119,.16); border-radius: 13px; color: #668173; background: rgba(244,248,244,.88); box-shadow: 0 7px 18px rgba(73,70,102,.07); font: 12px/1.45 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; backdrop-filter: blur(12px); }
.statusbar.error { color: #9a625f; background: rgba(251,239,238,.92); }
.retry { min-height: 34px; padding: 0 5px; border: 0; color: inherit; background: transparent; text-decoration: underline; }
.points { display: grid; gap: 14px; }
.moment-card { padding: 17px; border-radius: 24px; }
.point-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.point-number { font-size: 17px; }
.told { display: inline-block; margin-left: 8px; padding: 4px 8px; border-radius: 99px; color: #6f6d99; background: rgba(174,179,223,.24); font: 11px/1.2 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; }
.remove { min-width: 44px; min-height: 38px; padding: 6px; border: 0; color: #a46f76; background: transparent; }
.point-grid { display: grid; grid-template-columns: 94px 1fr; gap: 12px; }
.happiness { grid-column: 1 / -1; padding-top: 3px; }
.range-labels { display: flex; justify-content: space-between; color: #8b889c; font-size: 10px; }
.range-row { display: grid; grid-template-columns: 1fr 45px; align-items: center; gap: 12px; }
input[type="range"] { min-height: 36px; padding: 0; accent-color: #9291be; }
.score { display: grid; place-items: center; min-height: 38px; border-radius: 11px; color: #65638a; background: rgba(235,232,244,.86); font: 600 14px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; }
.hint, .result-note { margin: 15px 5px 0; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.7; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
.actions .primary-button, .actions .secondary-button { margin-top: 12px; }
.result { justify-content: flex-start; }
.curve-card { position: relative; padding: 12px 8px 8px; border-radius: 28px; overflow: hidden; }
.curve-card::after { content: "轻点圆点，写下感受"; position: absolute; right: 18px; bottom: 13px; color: #88859d; font: 11px/1.4 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; }
canvas { display: block; width: 100%; height: 390px; }
.result-actions { margin-top: 12px; }
.sheet-mask { position: fixed; z-index: 20; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 18px; background: rgba(46,44,65,.28); backdrop-filter: blur(4px); }
.feeling-sheet { position: relative; width: min(100%, 500px); padding: 15px 20px calc(22px + env(safe-area-inset-bottom)); border-radius: 28px 28px 18px 18px; background: #f9f5f3; box-shadow: 0 -18px 60px rgba(48,44,67,.25); animation: sheetUp .25s ease both; }
.sheet-handle { width: 42px; height: 4px; margin: 0 auto 18px; border-radius: 99px; background: #cbc5d1; }
.sheet-close { position: absolute; top: 13px; right: 14px; width: 40px; height: 40px; border: 0; border-radius: 50%; color: #77748c; background: rgba(232,228,237,.72); font-size: 24px; }
.feeling-sheet h2 { margin: 0; font-size: 28px; font-weight: 500; }
.sheet-event { min-height: 1.7em; margin: 7px 0 18px; color: var(--text); }
.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 99px; color: #fff; background: rgba(52,51,76,.9); box-shadow: 0 9px 25px rgba(52,51,76,.24); font: 13px/1.4 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; }
@media (min-width: 800px) {
  .wrap { margin-right: 8vw; }
  .intro-copy { margin-bottom: 14vh; }
}
@media (max-width: 390px) {
  .wrap { padding-inline: 14px; }
  .topbar { min-height: 40px; }
  .intro-fields { grid-template-columns: 1fr 96px; padding: 14px; }
  .intro-copy { margin-bottom: 9vh; }
  .point-grid { grid-template-columns: 82px 1fr; }
  .actions { grid-template-columns: 1fr; gap: 0; }
  canvas { height: 360px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@keyframes enter { from { opacity: 0; transform: translateY(7px); } }
@keyframes sheetUp { from { transform: translateY(24px); opacity: .7; } }
