/* ===== 全站通用样式：暖色、圆润、手机优先 ===== */
:root {
  --bg: #fff6f1;
  --card: #ffffff;
  --text: #4a3a3f;
  --muted: #a08b90;
  --pink: #ff7d9c;
  --pink-deep: #f25c84;
  --peach: #ffb38a;
  --line: #f6e3df;
  --soft: #fff0f3;
  --green: #5cc08f;
  --radius: 20px;
  --shadow: 0 6px 20px rgba(242, 92, 132, 0.10);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--text);
  background: var(--bg) radial-gradient(circle at 100% 0, #ffe1e8 0, transparent 45%) no-repeat;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: rgba(255, 246, 241, 0.88);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.topbar h1 { flex: 1; margin: 0; font-size: 18px; font-weight: 700; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: var(--card); box-shadow: var(--shadow);
  display: grid; place-items: center; font-size: 18px; cursor: pointer;
}
.who-chip {
  border: 0; border-radius: 999px; padding: 6px 12px 6px 8px;
  background: var(--card); box-shadow: var(--shadow); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px;
}
.who-chip .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--soft); }

main { padding: 6px 16px calc(28px + var(--safe-bottom)); max-width: 560px; margin: 0 auto; }

/* 卡片、按钮、表单 */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card h2 { margin: 0 0 10px; font-size: 16px; }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.btn {
  white-space: nowrap; flex: none;
  border: 0; border-radius: 14px; padding: 11px 16px; cursor: pointer;
  background: linear-gradient(135deg, var(--pink), var(--peach)); color: #fff; font-weight: 600;
  box-shadow: 0 4px 12px rgba(242, 92, 132, 0.25);
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: .5; }
.btn.ghost { background: var(--soft); color: var(--pink-deep); box-shadow: none; }
.btn.small { padding: 6px 12px; border-radius: 10px; font-size: 13px; }
.btn.block { width: 100%; flex: auto; }
.input, textarea.input, select.input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 14px; padding: 11px 14px;
  background: #fffdfc; outline: none; font-size: 16px; /* 16px 防止 iOS 自动放大 */
}
.input:focus { border-color: var(--pink); }
textarea.input { resize: vertical; min-height: 90px; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.check input { width: 20px; height: 20px; accent-color: var(--pink); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.list > li:last-child { border-bottom: 0; }
.emoji-badge { width: 44px; height: 44px; flex: none; border-radius: 14px; background: var(--soft); display: grid; place-items: center; font-size: 22px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--soft); color: var(--pink-deep); }
.empty { text-align: center; color: var(--muted); padding: 24px 0; }
.empty .big { font-size: 40px; display: block; margin-bottom: 6px; }

/* 分段切换 */
.tabs { display: flex; background: var(--card); border-radius: 16px; padding: 4px; box-shadow: var(--shadow); margin-bottom: 14px; }
.tabs button { flex: 1; border: 0; background: none; padding: 9px 0; border-radius: 12px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs button.active { background: linear-gradient(135deg, var(--pink), var(--peach)); color: #fff; }

/* 弹窗（底部抽屉） */
.sheet-mask { position: fixed; inset: 0; background: rgba(74, 58, 63, .35); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { width: 100%; max-width: 560px; background: var(--bg); border-radius: 24px 24px 0 0; padding: 20px 18px calc(20px + var(--safe-bottom)); animation: up .2s ease-out; max-height: 90vh; overflow: auto; }
.sheet h3 { margin: 0 0 14px; font-size: 17px; text-align: center; }
.sheet .actions { display: flex; gap: 10px; margin-top: 6px; }
.sheet .actions .btn { flex: 1; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-bottom)); transform: translateX(-50%); background: rgba(74, 58, 63, .9); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 14px; z-index: 99; animation: fade .2s; max-width: 85vw; text-align: center; }
.btn.grow { flex: 1; }
