/* He² —— hy & Alex 的小基地 · 软萌手绘风 */
:root {
  --bg: #fff8ec;
  --dot-1: rgba(255, 150, 175, 0.2);
  --dot-2: rgba(130, 185, 240, 0.16);
  --paper: #fffdf7;
  --ink: #4b3a37;
  --ink-2: #8a7672;
  --ink-3: #b9a8a3;
  --line: #4b3a37;
  --line-soft: rgba(75, 58, 55, 0.18);
  --shade: rgba(75, 58, 55, 0.13);
  --face: #43312e;
  --on-accent: #3e2f2c;
  /* 马卡龙色 */
  --p-pink: #ffd0da;
  --p-blue: #cfe6ff;
  --p-yellow: #fff0b0;
  --p-mint: #cdeedb;
  --p-lilac: #e3d8ff;
  --p-peach: #ffdcc4;
  /* 主题色（每个人自己选） */
  --accent: #ffb8c8;
  --accent-2: #e8708f;
  --accent-soft: color-mix(in srgb, var(--accent) 38%, var(--paper));
  --ok: #3f9e6b;
  --ok-bg: #d3f1df;
  --warn: #b0761b;
  --hand: "ZCOOL KuaiLe", "Fredoka", -apple-system, "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --round: "Fredoka", "ZCOOL KuaiLe", -apple-system, "PingFang SC", sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "OPPO Sans", "vivo Sans",
    "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #241f30;
    --dot-1: rgba(255, 190, 210, 0.07);
    --dot-2: rgba(170, 210, 255, 0.06);
    --paper: #2f2940;
    --ink: #f3e8dc;
    --ink-2: #c6b9c3;
    --ink-3: #8f849b;
    --line: #e7dacd;
    --line-soft: rgba(231, 218, 205, 0.18);
    --shade: rgba(0, 0, 0, 0.35);
    --p-pink: #f2bccb;
    --p-blue: #b9d6f2;
    --p-yellow: #ecdc9b;
    --p-mint: #b7dcc6;
    --p-lilac: #cfc2f0;
    --p-peach: #efc8ab;
    --accent-soft: color-mix(in srgb, var(--accent) 26%, var(--paper));
    --ok: #7fd7a4;
    --ok-bg: #2f4a3f;
    --warn: #f0c46e;
  }
}
[data-theme="sakura"] { --accent: #ffc49c; --accent-2: #e07a3c; }
[data-theme="honey"] { --accent: #ffe08a; --accent-2: #c89412; }
[data-theme="mint"] { --accent: #a9e4c2; --accent-2: #2f9e64; }
[data-theme="sky"] { --accent: #a9d3fb; --accent-2: #3584cf; }
[data-theme="lavender"] { --accent: #cdbbff; --accent-2: #7f5fd8; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(var(--dot-1) 2px, transparent 2.4px),
    radial-gradient(var(--dot-2) 2px, transparent 2.4px);
  background-size: 28px 28px;
  background-position: 0 0, 14px 14px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
svg { flex: none; }

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 8px) 16px calc(env(safe-area-inset-bottom) + 40px);
  min-height: 100dvh;
}
.wordmark { font-family: var(--round); font-weight: 600; letter-spacing: -.01em; }
.wordmark sup { font-size: .5em; color: var(--accent-2); margin-left: 1px; vertical-align: .8em; line-height: 0; }
.eyebrow { font-family: var(--hand); font-size: 15px; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.eyebrow .spark { color: var(--accent-2); font-size: 13px; }

/* ---------- 小人 ---------- */
.pal-svg { display: block; color: var(--line); overflow: visible; }
.bob { animation: bob 3.2s ease-in-out infinite; transform-origin: 50% 90%; }
.bob.late { animation-delay: -1.6s; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}

/* ---------- 顶栏 ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tile {
  position: relative; flex: none; width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center; background: var(--accent); color: var(--on-accent);
  border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line);
  font-family: var(--round); font-weight: 600; font-size: 17px;
}
.brand .wordmark { font-size: 23px; line-height: 1.05; }
.greet { font-family: var(--hand); font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.greet .conn { color: var(--warn); }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--paper); color: var(--ink); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line);
  transition: transform .1s ease, box-shadow .1s ease;
}
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }

/* ---------- 封面：两个小人 ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  margin: 10px 0 18px; padding: 22px 16px 18px; min-height: 270px;
  border: 2.5px solid var(--line); border-radius: 30px 26px 32px 28px;
  background: linear-gradient(180deg, var(--p-blue) 0%, color-mix(in srgb, var(--p-blue) 40%, var(--p-pink)) 55%, var(--p-pink) 100%);
  box-shadow: 0 5px 0 var(--shade);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; text-align: center;
}
@media (prefers-color-scheme: dark) {
  .hero { background: linear-gradient(180deg, #3b3666 0%, #4a3c63 60%, #5b4060 100%); }
}
.hero .cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero.has-cover::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 40%, rgba(40, 20, 30, .35) 100%);
}
.doodles { position: absolute; inset: 0; z-index: 1; pointer-events: none; color: var(--line); }
.doodles .d { position: absolute; animation: twinkle 3s ease-in-out infinite; }
.doodles .cloud { animation: drift 14s ease-in-out infinite alternate; }
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(.75) rotate(20deg); opacity: .6; } }
@keyframes drift { from { transform: translateX(-8px); } to { transform: translateX(10px); } }
.hero-inner { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; width: 100%; }
.duo { display: flex; align-items: flex-end; justify-content: center; gap: 6px; }
.pal-fig { margin: 0; display: flex; flex-direction: column; align-items: center; width: 124px; }
.pal-fig .pal-body { width: 104px; }
.pal-fig .pal-body.dim { filter: saturate(.55); opacity: .85; }
.pal-photo {
  width: 96px; height: 96px; border-radius: 50%; overflow: hidden; margin-bottom: 8px;
  border: 2.5px solid var(--line); box-shadow: 0 4px 0 var(--shade);
}
.pal-photo img { width: 100%; height: 100%; object-fit: cover; }
.pal-fig figcaption {
  margin-top: 6px; padding: 2px 12px; border-radius: 99px; background: var(--paper);
  border: 2px solid var(--line); font-family: var(--round); font-weight: 600; font-size: 15px;
  display: inline-flex; align-items: center; gap: 6px;
}
.pal-fig .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); border: 1.5px solid var(--line); }
.pal-fig .dot.on { background: #6fd39b; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { transform: scale(1.25); } }
.duo .and { font-family: var(--round); font-weight: 600; font-size: 20px; margin-bottom: 40px; color: var(--line); }
.sticker {
  margin-top: 14px; padding: 4px 16px 3px; background: var(--paper); border: 2.5px solid var(--line);
  border-radius: 16px; transform: rotate(-3deg); box-shadow: 0 4px 0 var(--shade);
  display: inline-flex; align-items: baseline; gap: 5px; font-family: var(--hand); font-size: 15px;
}
.sticker b { font-family: var(--round); font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--accent-2); }
.set-since {
  margin-top: 14px; padding: 7px 16px; border-radius: 99px; background: var(--paper); color: var(--ink);
  border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); font-family: var(--hand); font-size: 15px;
}
.milestone {
  margin-top: 10px; padding: 3px 12px; border-radius: 99px; font-family: var(--hand); font-size: 13.5px;
  background: color-mix(in srgb, var(--paper) 80%, transparent); border: 1.5px dashed var(--line);
}

/* ---------- 头像（没照片时就是小人） ---------- */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 2px solid var(--line); }
.avatar .pal-svg { width: 100%; height: 100%; }
.avatar img.stk { border: 0; border-radius: 0; object-fit: contain; }
.pal-photo.sticker-img { width: 108px; height: 108px; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
.pal-photo.sticker-img img { object-fit: contain; filter: drop-shadow(0 3px 0 var(--shade)); }
.avatar.sm { width: 34px; height: 34px; }
.avatar.xs { width: 30px; height: 30px; }

/* ---------- 卡片 ---------- */
.card {
  position: relative; margin-bottom: 16px; padding: 16px;
  background: var(--paper); border: 2.5px solid var(--line);
  border-radius: 26px 22px 26px 24px;
  box-shadow: 0 5px 0 var(--shade);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; min-height: 28px; }
.live {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 2px 11px 2px 9px; border-radius: 99px; font-family: var(--hand); font-size: 14px;
  background: var(--ok-bg); color: var(--ok); border: 2px solid currentColor;
}
.live i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: blink 1.6s ease-in-out infinite; }
.live.off { background: transparent; color: var(--ink-3); }
.live.off i { animation: none; }

/* 对方现在 */
.now-main { display: flex; gap: 14px; align-items: center; }
.now-pal { position: relative; width: 84px; flex: none; }
.now-pal .avatar { width: 84px; height: 84px; }
.now-pal .badge {
  position: absolute; top: -6px; right: -10px; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-size: 21px; background: var(--paper);
  border: 2px solid var(--line); box-shadow: 0 2px 0 var(--line);
}
.now-text { min-width: 0; flex: 1; }
.now-what { font-family: var(--hand); font-size: 25px; line-height: 1.25; }
.now-note {
  display: inline-block; margin-top: 4px; padding: 3px 10px; border-radius: 12px 12px 12px 4px;
  background: var(--p-yellow); color: var(--on-accent); font-size: 14px; word-break: break-word;
  border: 1.5px solid var(--line);
}
.now-since { font-size: 12.5px; color: var(--ink-2); margin-top: 5px; font-variant-numeric: tabular-nums; }
.devs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.dev {
  display: flex; align-items: center; gap: 9px; min-width: 0; padding: 9px 11px;
  border-radius: 16px; border: 2px dashed var(--line-soft); color: var(--ink-3);
}
.dev.on { border: 2px solid var(--line); background: var(--ok-bg); color: var(--ok); }
.dev .dv { min-width: 0; color: var(--ink); }
.dev .k { font-size: 11.5px; color: var(--ink-2); line-height: 1.3; }
.dev .v { font-family: var(--hand); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev .v.muted { color: var(--ink-3); }
.dev .k { display: flex; align-items: center; gap: 6px; }
.bat {
  font-family: var(--round); font-weight: 600; font-size: 11px; line-height: 1;
  padding: 2px 5px; border-radius: 99px; border: 1.5px solid var(--line-soft); color: var(--ink-2);
}
.bat.low { color: #d6455f; border-color: #d6455f; background: rgba(214, 69, 95, .1); }
.bat.chg { color: var(--ok); border-color: var(--ok); }

/* 今天用了多久 */
.use-rows { display: grid; gap: 8px; }
.use-row {
  display: grid; grid-template-columns: 30px auto 1fr 1fr; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 16px; border: 2px dashed var(--line-soft);
}
.use-row .who { font-family: var(--hand); font-size: 15px; white-space: nowrap; }
.use-row .use { display: inline-flex; align-items: center; gap: 5px; justify-content: flex-end; font-size: 14px; font-weight: 600; white-space: nowrap; }
.use-row .use svg { color: var(--ink-3); }
.week .eyebrow { gap: 8px; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.bar-track { height: 120px; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar {
  width: 70%; max-width: 30px; display: flex; flex-direction: column; overflow: hidden;
  border: 2px solid var(--line); border-radius: 10px 10px 6px 6px; background: var(--paper);
}
.week[data-u="a"] { --pc-c: #ffc2d1; }
.week[data-u="b"] { --pc-c: #b9dcff; }
.seg { display: block; min-height: 3px; }
.seg.phone { background: var(--pc-c, var(--accent)); }
.seg.pc { background: repeating-linear-gradient(135deg, var(--pc-c, var(--accent)) 0 4px, var(--paper) 4px 7px); border-bottom: 1.5px solid var(--line); }
.bl { font-family: var(--hand); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.bv { font-family: var(--round); font-size: 10.5px; font-weight: 600; color: var(--ink-2); height: 14px; }
.legend { display: flex; justify-content: center; gap: 18px; font-family: var(--hand); font-size: 14px; color: var(--ink-2); margin: 2px 0 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 16px; height: 16px; border-radius: 5px; border: 2px solid var(--line); display: inline-block; }
.legend .sw.phone { background: var(--ink-3); }
.legend .sw.pc { background: repeating-linear-gradient(135deg, var(--ink-3) 0 4px, var(--paper) 4px 7px); }

/* 我现在 · 报备 */
.mine-now { display: flex; align-items: center; gap: 12px; }
.mine-now .avatar { width: 46px; height: 46px; }
.cur-text { flex: 1; min-width: 0; }
.cur-what { font-family: var(--hand); font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cur-what .cur-note { font-family: var(--sans); font-size: 14px; color: var(--ink-2); }
.cur-sub { font-size: 12.5px; color: var(--ink-2); }
.note-field {
  display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 0 14px; height: 46px;
  border-radius: 16px; border: 2px dashed var(--line-soft); color: var(--ink-3);
  transition: border-color .15s ease, background .15s ease;
}
.note-field input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 16px; color: var(--ink); }
.note-field input::placeholder { color: var(--ink-3); }
.note-field:focus-within { border: 2px solid var(--line); background: var(--accent-soft); }
.tiles {
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: 74px; gap: 10px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none;
  margin: 12px -16px 0; padding: 4px 16px 8px; scroll-padding: 0 16px;
}
.tiles::-webkit-scrollbar { display: none; }
.st {
  --c: var(--p-pink);
  position: relative; scroll-snap-align: start; padding: 9px 0 7px; border-radius: 20px 18px 20px 17px;
  background: var(--c); color: var(--on-accent); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  transition: transform .1s ease, box-shadow .1s ease;
}
.st:nth-child(6n + 2) { --c: var(--p-blue); }
.st:nth-child(6n + 3) { --c: var(--p-yellow); }
.st:nth-child(6n + 4) { --c: var(--p-mint); }
.st:nth-child(6n + 5) { --c: var(--p-lilac); }
.st:nth-child(6n + 6) { --c: var(--p-peach); }
.st .e { font-size: 27px; line-height: 1.2; }
.st .l { font-family: var(--hand); font-size: 13.5px; white-space: nowrap; }
.st:active { transform: translateY(3px); box-shadow: 0 0 0 var(--line); }
.st.cur { border-width: 3px; transform: translateY(-3px) rotate(-3deg); box-shadow: 0 5px 0 var(--line); }
.st.cur::after {
  content: "✓"; position: absolute; top: -10px; right: -8px; width: 22px; height: 22px; border-radius: 50%; color: var(--on-accent);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--accent); border: 2px solid var(--line);
}
.st.add { --c: transparent; color: var(--ink-2); border-style: dashed; box-shadow: none; }

/* 戳一戳 */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  --c: var(--p-pink);
  padding: 6px 14px; border-radius: 99px; background: var(--c); color: var(--on-accent);
  border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line);
  font-family: var(--hand); font-size: 15px; transition: transform .1s ease, box-shadow .1s ease;
}
.chip:nth-child(6n + 2) { --c: var(--p-yellow); }
.chip:nth-child(6n + 3) { --c: var(--p-blue); }
.chip:nth-child(6n + 4) { --c: var(--p-mint); }
.chip:nth-child(6n + 5) { --c: var(--p-peach); }
.chip:nth-child(6n + 6) { --c: var(--p-lilac); }
.chip:active { transform: translateY(3px); box-shadow: 0 0 0 var(--line); }
.composer { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.composer input {
  flex: 1; min-width: 0; height: 48px; border-radius: 24px; padding: 0 18px; outline: none; font-size: 16px;
  background: var(--paper); border: 2px solid var(--line-soft); transition: border-color .15s ease, background .15s ease;
}
.composer input:focus { border-color: var(--line); background: var(--accent-soft); }
.send {
  width: 48px; height: 48px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line);
  transition: transform .1s ease, box-shadow .1s ease;
}
.send:active { transform: translateY(3px); box-shadow: 0 0 0 var(--line); }

/* ---------- 动态 ---------- */
.feed { display: flex; flex-direction: column; gap: 10px; }
.day {
  align-self: center; font-family: var(--hand); font-size: 13px; color: var(--ink-2);
  padding: 0 12px; margin-top: 6px; position: relative;
}
.day::before, .day::after { content: "~"; color: var(--ink-3); margin: 0 6px; }
.day:first-child { margin-top: 0; }
.msg { display: flex; align-items: flex-end; gap: 7px; max-width: 88%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg > .avatar { margin-bottom: 20px; }
.msg .mb { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.msg.mine .mb { align-items: flex-end; }
.bubble {
  padding: 7px 13px; border-radius: 18px 18px 18px 5px; font-size: 15px; word-break: break-word;
  background: var(--paper); border: 2px solid var(--line);
}
.mine .bubble { border-radius: 18px 18px 5px 18px; background: var(--accent); color: var(--on-accent); }
.bubble.report { display: flex; gap: 9px; align-items: flex-start; background: var(--p-yellow); color: var(--on-accent); }
.mine .bubble.report { background: var(--accent-soft); color: var(--ink); }
.report .ri { font-size: 22px; line-height: 1.2; }
.report .h { font-family: var(--hand); font-size: 16px; }
.report .n { font-size: 13.5px; opacity: .8; margin-top: 1px; }
.msg .t { font-size: 11px; color: var(--ink-3); margin: 3px 6px 0; font-variant-numeric: tabular-nums; }
.sys {
  align-self: center; display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 3px 12px; border-radius: 99px; border: 1.5px dashed var(--line-soft);
  font-size: 12.5px; color: var(--ink-2);
}
.sys .t { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--ink-2); font-family: var(--hand); font-size: 15px; padding: 10px 0 4px; }
.empty .pal-svg { width: 64px; margin: 0 auto 6px; }

/* ---------- 提示卡（贴了胶带的便签） ---------- */
.hint { display: flex; gap: 12px; align-items: flex-start; background: color-mix(in srgb, var(--p-yellow) 45%, var(--paper)); margin-top: 22px; }
@media (prefers-color-scheme: dark) {
  .hint { background: color-mix(in srgb, var(--p-yellow) 10%, var(--paper)); }
}
.hint::before {
  content: ""; position: absolute; top: -12px; left: 50%; width: 76px; height: 20px;
  transform: translateX(-50%) rotate(-3deg); background: color-mix(in srgb, var(--accent) 70%, transparent);
  border-radius: 3px;
}
.hint .hi { width: 38px; height: 38px; border-radius: 13px; flex: none; display: grid; place-items: center; font-size: 19px; background: var(--paper); border: 2px solid var(--line); }
.hint .hb { flex: 1; min-width: 0; }
.hint p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.hint .ht { font-family: var(--hand); font-size: 16px; color: var(--ink); margin-bottom: 2px; }
.hint .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- 按钮 / 输入 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; text-decoration: none;
  padding: 9px 18px; border-radius: 16px; font-family: var(--hand); font-size: 16px; font-weight: 400;
  background: var(--accent); color: var(--on-accent); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line);
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--line); }
.btn:disabled { opacity: .5; }
.btn.ghost { background: var(--paper); color: var(--ink); }
.btn.small { padding: 5px 12px; font-size: 14px; border-radius: 13px; }
.btn.block { display: flex; width: 100%; padding: 12px; font-size: 18px; }
.btn.danger { background: var(--paper); color: var(--accent-2); }
.input, select.input, textarea.input {
  flex: 1; min-width: 0; color: var(--ink); background: var(--paper);
  border: 2px solid var(--line-soft); border-radius: 14px; padding: 10px 13px; font-size: 16px; outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.input:focus { border-color: var(--line); background: var(--accent-soft); }
textarea.input { resize: vertical; min-height: 130px; line-height: 1.7; }

/* ---------- 登录 ---------- */
.login {
  min-height: calc(100dvh - 60px); display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding-bottom: 5vh;
}
.login .duo { margin-bottom: 8px; }
.login .duo .pal-svg { width: 112px; }
.login h1 { font-size: 52px; margin: 6px 0 0; line-height: 1.05; }
.login .sub { font-family: var(--hand); color: var(--ink-2); margin: 6px 0 26px; font-size: 18px; }
.login form { width: 100%; max-width: 330px; display: flex; flex-direction: column; gap: 12px; }
.login .input { height: 56px; text-align: center; font-size: 20px; letter-spacing: .14em; border-radius: 18px; border: 2.5px solid var(--line); box-shadow: 0 4px 0 var(--shade); }
.login .input::placeholder { letter-spacing: .02em; font-family: var(--hand); font-size: 17px; color: var(--ink-3); }
.login .btn.block { height: 56px; border-radius: 18px; font-size: 20px; }
.login .small { font-size: 12.5px; color: var(--ink-3); margin-top: 18px; }
.login .hint { text-align: left; width: 100%; max-width: 330px; margin-bottom: 22px; }

/* ---------- 底部弹层 / 设置 ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 20; background: rgba(40, 25, 30, .35);
  display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease;
}
.sheet {
  position: relative; width: 100%; max-width: 480px; max-height: 90dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg); border: 2.5px solid var(--line); border-bottom: 0; border-radius: 28px 28px 0 0;
  padding: 10px 16px calc(env(safe-area-inset-bottom) + 24px);
  animation: up .3s cubic-bezier(.2, .9, .3, 1.15);
}
.sheet .grab { width: 44px; height: 6px; border-radius: 99px; background: var(--line-soft); margin: 0 auto 14px; }
.sheet h3 { font-family: var(--hand); font-weight: 400; font-size: 26px; margin: 0 0 14px; }
.sheet .card h2 { font-family: var(--hand); font-weight: 400; font-size: 17px; margin: 0 0 12px; color: var(--ink); }
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label, .field > .lbl { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 7px; }
.row-in, .send-row { display: flex; gap: 8px; align-items: center; }
.field input[type="date"] { min-height: 46px; }
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-top: 2px dashed var(--line-soft); font-size: 15px;
}
.toggle-row:first-of-type { border-top: 0; padding-top: 0; }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--paper); border: 2px solid var(--line); transition: background .18s ease; }
.switch span::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; border: 2px solid var(--line); transition: transform .22s cubic-bezier(.3, 1.4, .5, 1);
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.swatch { width: 42px; height: 42px; border-radius: 50%; padding: 0; border: 2px solid var(--line); transition: transform .12s ease; }
.swatch.cur { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5.5px var(--line); transform: rotate(-8deg) scale(1.05); }
.swatch:active { transform: scale(.9); }
.photo-row { display: flex; align-items: center; gap: 12px; }
.photo-row .avatar { width: 58px; height: 58px; }
.cover-prev { width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; object-fit: cover; margin-bottom: 10px; border: 2px solid var(--line); }
.device { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-top: 2px dashed var(--line-soft); }
.device:first-child { border-top: 0; padding-top: 0; }
.device .ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex: none; background: var(--p-blue); border: 2px solid var(--line); }
.device .txt { flex: 1; min-width: 0; font-size: 15px; }
.device .sub { font-size: 12px; color: var(--ink-3); }
.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 15px; word-break: break-all; }
.copy-box { display: flex; align-items: center; gap: 8px; border: 2px dashed var(--line-soft); border-radius: 14px; padding: 7px 7px 7px 12px; margin-bottom: 10px; }
.copy-box .code { flex: 1; min-width: 0; font-size: 12px; color: var(--ink-2); }
.steps { margin: 8px 0 12px; padding-left: 20px; font-size: 14px; color: var(--ink-2); }
.steps li { margin-bottom: 7px; }
.steps b { color: var(--ink); }
.muted-note { font-size: 13px; color: var(--ink-3); margin: 10px 0 0; }
details.more { border-top: 2px dashed var(--line-soft); padding-top: 10px; margin-top: 10px; }
details.more:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
details.more > summary { cursor: pointer; font-family: var(--hand); font-size: 16px; list-style: none; padding: 4px 0; display: flex; align-items: center; justify-content: space-between; }
details.more > summary::after { content: "›"; color: var(--ink-3); font-size: 22px; transition: transform .2s ease; }
details.more[open] > summary::after { transform: rotate(90deg); }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { margin-bottom: 8px; }
.st-edit { border: 2px dashed var(--line-soft); border-radius: 16px; padding: 10px; margin-bottom: 8px; display: grid; gap: 7px; }
.st-edit .r { display: flex; gap: 7px; align-items: center; }
.st-edit .input { padding: 8px 10px; }
.st-edit .em { flex: 0 0 58px; text-align: center; }
.st-edit label { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.emoji-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 7px; margin-bottom: 14px; }
.emoji-pick button { height: 44px; border-radius: 13px; font-size: 21px; background: var(--paper); border: 2px solid var(--line-soft); transition: transform .1s ease; }
.emoji-pick button:active { transform: scale(.88); border-color: var(--line); }
.version { text-align: center; font-family: var(--hand); font-size: 13px; color: var(--ink-3); margin-top: 16px; }

/* ---------- 提示 & 小动画 ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 26px); z-index: 40;
  transform: translate(-50%, 16px) rotate(-2deg) scale(.9); opacity: 0; pointer-events: none;
  padding: 9px 18px; border-radius: 18px; max-width: calc(100vw - 32px); text-align: center;
  font-family: var(--hand); font-size: 16px; background: var(--paper); color: var(--ink);
  border: 2.5px solid var(--line); box-shadow: 0 4px 0 var(--line);
  transition: opacity .2s ease, transform .3s cubic-bezier(.3, 1.5, .5, 1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) rotate(-2deg) scale(1); }
.float-heart { position: fixed; z-index: 30; font-size: 28px; pointer-events: none; animation: floatup 1.6s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes floatup {
  0% { transform: translateY(0) scale(.4); opacity: 0; }
  20% { opacity: 1; transform: translateY(-18px) scale(1.2) rotate(-10deg); }
  100% { transform: translateY(-160px) scale(.9) rotate(12deg); opacity: 0; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(70px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
