/* ============================================================
   Per Anna · 蜡笔手绘风 —— 纸面颗粒 · 抖抖的手绘描边 · 蜡笔手写字
   参考：小熊维尼蜡笔贴纸那种童趣手绘感(原创吉祥物,非迪士尼)
   ============================================================ */
:root {
  --paper: #fff7e9;
  --ink: #6b4f47;        /* 蜡笔棕,正文 */
  --ink-soft: #b09a8e;
  --line: #8a6a5a;       /* 手绘描边棕 */
  --red: #ff4d3d;        /* 蜡笔红(像 NICE) */
  --pink: #ff8fab;
  --pink-deep: #ff5d8f;
  --mint: #7fdcc4;
  --lav: #c3b1f0;
  --butter: #ffd76b;
  --sky: #9ad6ff;
  --card: #fffdf8;
  --radius: 24px;
  --shadow: 0 8px 18px rgba(138,106,90,.16);
  --shadow-soft: 0 5px 12px rgba(138,106,90,.10);
  --display: "Gaegu", "ZCOOL KuaiLe", "Hiragino Maru Gothic ProN", "PingFang SC", system-ui, cursive;
  --body: "Gaegu", "ZCOOL KuaiLe", "Hiragino Maru Gothic ProN", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--body); font-size: 17px; color: var(--ink); line-height: 1.65;
  background-color: var(--paper);
}
/* 纸面颗粒 */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: .06; mix-blend-mode: multiply;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 手绘描边框(抖抖的蜡笔线)---------- */
.card, .bubble, .meet-card, .sbox, .polaroid, .epigraph, .egg-card, button.btn, .counter {
  position: relative;
}
.card::before, .bubble::before, .meet-card::before, .sbox::before, .polaroid::before,
.epigraph::before, .egg-card::before, button.btn::before, .counter::before {
  content: ''; position: absolute; inset: 0; border: 2.5px solid var(--line);
  border-radius: inherit; filter: url(#rough); pointer-events: none; z-index: 2; opacity: .9;
}

/* ---------- 顶部 + 吉祥物 ---------- */
.hero {
  position: relative;
  background: linear-gradient(165deg, #ffe2d2 0%, #ffe9f2 45%, #e7f4ff 100%);
  border-radius: 0 0 36px 36px; padding: 24px 18px 28px;
  display: flex; align-items: center; justify-content: center; gap: clamp(6px, 3vw, 28px);
  box-shadow: var(--shadow-soft); overflow: hidden;
}
.hero-fig { flex: none; width: 92px; height: 92px; filter: url(#rough); animation: float 3.4s ease-in-out infinite; z-index: 1; }
.hero-fig:last-of-type { animation-delay: .9s; }
.rays { position: absolute; width: 74px; height: 74px; top: 30px; opacity: .85; z-index: 0; animation: spin 22s linear infinite; }
.rays.r-left { left: 4%; } .rays.r-right { right: 4%; animation-direction: reverse; }
.brand-card { position: relative; z-index: 1; background: var(--card); border-radius: 28px; padding: 16px 30px 14px; text-align: center; box-shadow: var(--shadow); transform: rotate(-1.5deg); }
.brand-heart { position: absolute; top: -16px; left: 50%; font-size: 28px; animation: heartbob 2.2s ease-in-out infinite; }
.brand { font-family: var(--display); font-size: 40px; font-weight: 700; color: var(--red); line-height: 1; }
.brand-sub { font-family: var(--display); font-size: 16px; color: var(--lav); margin-top: 2px; white-space: nowrap; }
.sparkle { position: absolute; font-size: 18px; animation: twinkle 2.4s ease-in-out infinite; z-index: 1; }
.sparkle.s1 { top: 14px; left: 30%; color: var(--red); }
.sparkle.s2 { top: 54px; right: 30%; font-size: 20px; color: var(--butter); animation-delay: .7s; }
.sparkle.s3 { bottom: 16px; left: 40%; font-size: 14px; color: var(--pink-deep); animation-delay: 1.3s; }

/* ---------- 导航：圆胖小药丸 ---------- */
.nav {
  position: sticky; top: 10px; z-index: 50; display: flex; justify-content: center; gap: 2px; flex-wrap: wrap;
  width: max-content; max-width: calc(100% - 20px); margin: -14px auto 0; padding: 6px;
  background: var(--card); border-radius: 999px; box-shadow: var(--shadow);
  border: 2.5px solid var(--line);
}
.nav-btn {
  border: none; background: transparent; cursor: pointer; color: var(--ink-soft); font-family: var(--display); font-weight: 700; font-size: 15px;
  display: flex; flex-direction: column; align-items: center; gap: 0; padding: 6px 12px; border-radius: 999px; transition: transform .12s ease, background .15s ease;
}
.nav-btn .ni { font-size: 19px; line-height: 1.1; }
.nav-btn:hover { transform: translateY(-2px); }
.nav-btn.active { background: var(--red); color: #fff; }

main { max-width: 640px; margin: 0 auto; padding: 24px 18px 90px; }
.page { display: none; }
.page.active { display: block; animation: rise .4s ease; }

/* ---------- 小横幅 ---------- */
.epigraph {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 auto 20px; padding: 9px 18px; width: fit-content; max-width: 100%;
  background: var(--card); border-radius: 999px; box-shadow: var(--shadow-soft);
  font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--red); text-align: center;
}
.epi-heart { animation: bob 2s ease-in-out infinite; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 12px; font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--red); }
.card h2::before { content: '🖍️ '; }
.card h2::after { content: ''; display: block; width: 64px; height: 4px; margin-top: 2px; background: var(--red); border-radius: 4px; filter: url(#rough2); }

/* ---------- 按钮：蜡笔糖果 ---------- */
button.btn {
  border: none; cursor: pointer; border-radius: 999px; padding: 11px 26px; font-family: var(--display); font-size: 18px; font-weight: 700;
  color: #fff; background: var(--pink-deep); box-shadow: var(--shadow); transition: transform .1s ease;
}
button.btn:hover { transform: translateY(-2px); }
button.btn:active { transform: translateY(1px) scale(.97); }
button.btn.round { width: 48px; height: 48px; padding: 0; font-size: 26px; display: inline-flex; align-items: center; justify-content: center; background: var(--butter); color: var(--ink); }

/* ---------- 表单 ---------- */
select { font-family: var(--body); font-size: 16px; color: var(--ink); background: #fff; border: 2.5px solid var(--line); border-radius: 14px; padding: 9px 14px; outline: none; }
label.field { display: flex; flex-direction: column; gap: 5px; font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--ink-soft); }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.muted { color: var(--ink-soft); font-size: 15px; }
.empty { text-align: center; color: var(--ink-soft); padding: 30px 0; font-size: 17px; }
a { color: var(--pink-deep); }

/* ---------- 今日 / Oggi ---------- */
.oggi { text-align: center; }
.bubble { background: var(--card); border-radius: 26px; padding: 24px 22px; box-shadow: var(--shadow); margin-bottom: 16px; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%) rotate(45deg); width: 24px; height: 24px; background: var(--card); border-right: 2.5px solid var(--line); border-bottom: 2.5px solid var(--line); filter: url(#rough); z-index: 1; }
.greeting { font-family: var(--display); font-size: 17px; font-weight: 700; color: var(--lav); margin-bottom: 10px; }
.note-it { font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1.35; color: var(--ink); }
.note-zh { font-size: 16px; color: var(--ink-soft); margin-top: 10px; }
.mascot { width: 120px; height: 120px; filter: url(#rough); }
.tomorrow { font-family: var(--display); font-weight: 700; color: var(--pink-deep); font-size: 16px; margin-top: 6px; }

/* ---------- 惊喜盲盒 ---------- */
.surprise-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.sbox {
  border: none; border-radius: 20px; padding: 20px 14px; min-height: 148px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; text-align: center; cursor: pointer; font-family: var(--body); box-shadow: var(--shadow-soft);
}
.sbox.tone1 { background: #ffe3ee; } .sbox.tone2 { background: #e3f8ef; }
.sbox.tone3 { background: #ece4ff; } .sbox.tone4 { background: #fff1cf; }
.sbox.sealed { animation: wiggle 3s ease-in-out infinite; }
.sbox.sealed:nth-child(even) { animation-delay: .5s; }
.sbox.sealed:hover { transform: scale(1.04) rotate(-1deg); }
.sbox-bow { position: absolute; top: 7px; font-size: 22px; z-index: 3; }
.sbox-gift { font-size: 46px; margin-top: 12px; }
.sbox-hint { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--red); }
.sbox.open { cursor: default; }
.sbox-icon { font-size: 40px; }
.sbox-it { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--ink); }
.sbox-zh { font-size: 13.5px; color: var(--ink-soft); }
.sbox.reveal { animation: pop .45s cubic-bezier(.2,1.3,.5,1); }

/* ---------- 我们 / Noi ---------- */
.counter { text-align: center; color: #fff; border-radius: var(--radius); padding: 28px 24px 24px; margin-bottom: 16px; background: linear-gradient(155deg, #ff9ec0 0%, #c9a8ff 100%); box-shadow: var(--shadow); }
.counter::before { border-color: var(--line); }
.counter-deco { position: absolute; top: -12px; right: 22px; font-size: 34px; transform: rotate(12deg); animation: bob 2.4s ease-in-out infinite; z-index: 3; }
.counter-label { font-family: var(--display); font-weight: 700; font-size: 18px; }
.counter-num { font-family: var(--display); font-weight: 700; font-size: 80px; line-height: 1; margin: 2px 0; text-shadow: 3px 3px 0 rgba(138,106,90,.25); }
.counter-unit { font-family: var(--display); font-weight: 700; font-size: 20px; }
.meet-card { display: flex; align-items: center; gap: 14px; background: linear-gradient(150deg, #d3f6ec 0%, #fff3c8 100%); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 18px; box-shadow: var(--shadow-soft); }
.meet-emoji { font-size: 38px; flex: none; z-index: 3; }
.meet-text { font-family: var(--display); font-weight: 700; font-size: 19px; color: #4f8a76; z-index: 3; }
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 4px; border-radius: 4px; background: #ffd3a8; filter: url(#rough); }
.tl-item { position: relative; margin-bottom: 14px; }
.tl-item:last-child { margin-bottom: 0; }
.tl-dot { position: absolute; left: -30px; top: -2px; font-size: 18px; }
.tl-body { background: #fffaf2; border: 2.5px solid var(--line); border-radius: 16px; padding: 11px 15px; }
.tl-date { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--red); }
.tl-it { font-family: var(--display); font-weight: 700; font-size: 17px; margin-top: 1px; }
.tl-zh { color: var(--ink-soft); font-size: 14px; }
.tl-photo { display: block; max-width: 100%; margin: 8px 0; border-radius: 12px; border: 2.5px solid var(--line); }
.tl-photo.broken { display: none; }

/* ---------- 相册 / Foto（拍立得）---------- */
.album-stage { user-select: none; }
.polaroid { background: var(--card); border-radius: 14px; padding: 12px 12px 6px; box-shadow: var(--shadow); transform: rotate(-1.2deg); cursor: pointer; }
.slide-img { display: block; width: 100%; max-height: 420px; object-fit: cover; border-radius: 8px; background: #ffe3ee; }
.slide-img.broken { min-height: 260px; position: relative; }
.slide-img.broken::after { content: '🐰💗🧸'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 40px; letter-spacing: 6px; background: linear-gradient(150deg, #ffe3ee, #ece4ff); border-radius: 8px; }
.slide-cap { text-align: center; padding: 12px 6px 8px; }
.slide-it { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--ink); }
.slide-zh { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.album-nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 16px; }
.album-dots { display: flex; gap: 7px; }
.album-dots .dot { width: 10px; height: 10px; border-radius: 50%; background: #ffd3a8; }
.album-dots .dot.on { background: var(--red); transform: scale(1.25); }

/* ---------- 特殊日子彩蛋 ---------- */
.egg-overlay { position: fixed; inset: 0; z-index: 999; display: flex; align-items: center; justify-content: center; background: rgba(255,220,200,.55); backdrop-filter: blur(4px); overflow: hidden; animation: fadein .3s ease; }
.egg-card { background: var(--card); border-radius: 30px; text-align: center; padding: 34px 32px; max-width: 86vw; box-shadow: 0 18px 44px rgba(138,106,90,.3); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.egg-card.pop { animation: pop .5s cubic-bezier(.2,1.3,.5,1); }
.egg-emoji { font-size: 64px; }
.egg-title { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1.25; color: var(--red); }
.egg-sub { font-family: var(--display); font-weight: 700; font-size: 19px; color: var(--lav); }
.egg-confetti { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.confetti { position: absolute; top: -10%; font-size: 24px; animation-name: fall; animation-timing-function: linear; animation-iteration-count: infinite; }

/* ---------- 小提示气泡 ---------- */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; font-family: var(--display); font-weight: 700; padding: 11px 24px; border-radius: 999px; font-size: 16px; box-shadow: var(--shadow); z-index: 100; max-width: 84vw; }

/* ---------- 动画 ---------- */
@keyframes float { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(-2deg); } }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-5px) rotate(6deg); } }
@keyframes heartbob { 0%,100% { transform: translateX(-50%) translateY(0) rotate(0); } 50% { transform: translateX(-50%) translateY(-5px) rotate(6deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle { 0%,100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes wiggle { 0%,92%,100% { transform: rotate(0); } 94% { transform: rotate(-4deg); } 97% { transform: rotate(4deg); } }
@keyframes pop { 0% { transform: scale(.5); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes fall { 0% { transform: translateY(-10vh) rotate(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(110vh) rotate(360deg); opacity: .9; } }
.bounce { animation: floatbob 2.6s ease-in-out infinite; }
@keyframes floatbob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; } }

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
  .hero-fig { width: 66px; height: 66px; }
  .rays { width: 56px; height: 56px; }
  .brand { font-size: 32px; }
  .nav-btn { font-size: 13px; padding: 6px 9px; }
  .nav-btn .ni { font-size: 17px; }
  .note-it { font-size: 22px; }
  .counter-num { font-size: 64px; }
}
