/* ============================================================
   心水清单 · H5 原型样式
   移动优先，桌面端自动收成手机框
   ============================================================ */

:root {
  --bg: #f7f4f2;
  --surface: #ffffff;
  --surface-2: #f1eeea;
  --ink: #1a1a1c;
  --ink-2: #5d6269;
  --muted: #9ca1a9;
  --line: rgba(26, 26, 28, 0.08);
  --like: #ff4d6d;
  --like-soft: #ffe8ed;
  --hold: #ef9f2e;
  --hold-soft: #fff1dc;
  --nope: #8a93a0;
  --nope-soft: #eceff2;
  --brand: #ff4d6d;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --sh-1: 0 1px 2px rgba(26, 26, 28, 0.04), 0 8px 24px rgba(26, 26, 28, 0.06);
  --sh-2: 0 18px 44px rgba(26, 26, 28, 0.16);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
img { display: block; max-width: 100%; }

.picker {
  position: fixed;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ---------- 手机外壳 ---------- */

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  overflow: hidden;
}

.view {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.view.locked { overflow: hidden; display: flex; flex-direction: column; }

@media (min-width: 600px) {
  body {
    display: grid;
    place-items: center;
    padding: 28px;
    background:
      radial-gradient(1200px 600px at 12% -10%, #ffe3ea 0%, rgba(255, 227, 234, 0) 60%),
      radial-gradient(900px 600px at 100% 110%, #e9e4ff 0%, rgba(233, 228, 255, 0) 55%),
      #efece9;
  }
  .app {
    width: 420px;
    height: min(880px, calc(100dvh - 56px));
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: var(--sh-2);
  }
  .layer { border-radius: 30px; overflow: hidden; }
}

/* ---------- 通用 ---------- */

.screen {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.screen.grow { height: 100%; min-height: 0; flex: 1 1 auto; }

.pad { padding-left: 20px; padding-right: 20px; }

.hd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(14px + var(--safe-t)) 20px 12px;
  background: linear-gradient(to bottom, var(--bg) 72%, rgba(247, 244, 242, 0));
  position: sticky;
  top: 0;
  z-index: 20;
}

.hd.flush { position: static; background: none; padding-top: calc(14px + var(--safe-t)); }

.hd-main { flex: 1 1 auto; min-width: 0; }
.hd h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
}
.hd h2 {
  font-size: 17px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hd .sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--sh-1);
  font-size: 17px;
  line-height: 1;
  color: var(--ink);
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn.plain { background: none; box-shadow: none; }
.icon-btn.accent { background: var(--like); color: #fff; box-shadow: 0 8px 18px rgba(255, 77, 109, 0.28); }

.body {
  flex: 1 1 auto;
  padding: 4px 20px 24px;
}

.stack-v { display: flex; flex-direction: column; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 48px;
  padding: 0 20px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 600;
  background: var(--surface);
  box-shadow: var(--sh-1);
  transition: transform 0.14s ease, opacity 0.14s ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn-block { display: flex; width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, #ff5f7d, #ff4d6d 55%, #f5395f);
  color: #fff;
  box-shadow: 0 10px 22px rgba(255, 77, 109, 0.3);
}
.btn-dark { background: var(--ink); color: #fff; box-shadow: 0 10px 22px rgba(26, 26, 28, 0.22); }
.btn-ghost { background: transparent; box-shadow: none; color: var(--ink-2); font-weight: 500; }
.btn-sm { height: 38px; font-size: 13.5px; border-radius: 12px; padding: 0 14px; }
.btn-danger { color: #e0364f; }

.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.spacer { flex: 1 1 auto; }

/* ---------- 空状态 ---------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 44px 24px;
  color: var(--muted);
}
.empty .em {
  width: 84px;
  height: 84px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: linear-gradient(150deg, #fff, #f0ece8);
  box-shadow: var(--sh-1);
}
.empty h3 { font-size: 16px; color: var(--ink); font-weight: 650; }
.empty p { font-size: 13px; max-width: 260px; line-height: 1.6; }
.empty .btn { margin-top: 8px; }

/* ---------- 分组卡片 ---------- */

.group-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-1);
  text-align: left;
  width: 100%;
  transition: transform 0.16s ease;
}
.group-card:active { transform: scale(0.985); }

.gc-covers {
  position: relative;
  flex: none;
  width: 76px;
  height: 76px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 22px;
}
.gc-covers img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gc-covers .c2 { transform: translate(46%, 34%) scale(0.5); border-radius: 8px; inset: auto; left: 0; top: 0; width: 100%; height: 100%; }
.gc-covers .c2 { border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12); }

.gc-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.gc-title { display: flex; align-items: center; gap: 6px; }
.gc-title h3 {
  font-size: 16px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gc-title .chev { color: #c9ccd2; font-size: 17px; margin-left: auto; }
.gc-meta { font-size: 12.5px; color: var(--muted); }

.bar {
  height: 6px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #ff8fa6, var(--like));
  transition: width 0.4s ease;
}

.gc-stats { display: flex; gap: 10px; font-size: 12px; color: var(--ink-2); }
.gc-stats span { display: inline-flex; align-items: center; gap: 4px; }
.dot { width: 6px; height: 6px; border-radius: 99px; display: inline-block; }
.dot.like { background: var(--like); }
.dot.hold { background: var(--hold); }
.dot.nope { background: var(--nope); }
.dot.todo { background: #d8d5d1; }

/* ---------- 统计条 ---------- */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 14px 12px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-1);
}
.stat { text-align: center; }
.stat b { display: block; font-size: 19px; font-weight: 700; letter-spacing: -0.5px; }
.stat span { font-size: 11.5px; color: var(--muted); }
.stat.like b { color: var(--like); }
.stat.hold b { color: var(--hold); }
.stat.nope b { color: var(--nope); }

/* ---------- 产品九宫格 ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.cell {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--sh-1);
  text-align: left;
  aspect-ratio: 3 / 4;
  transition: transform 0.16s ease;
}
.cell:active { transform: scale(0.97); }
.cell img { width: 100%; height: 100%; object-fit: cover; }
.cell .ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); }
.cell .tag {
  position: absolute;
  left: 7px;
  top: 7px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 600;
  color: #fff;
  backdrop-filter: blur(6px);
}
.cell .tag.like { background: rgba(255, 77, 109, 0.92); }
.cell .tag.hold { background: rgba(239, 159, 46, 0.94); }
.cell .tag.nope { background: rgba(138, 147, 160, 0.94); }
.cell .cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 8px 7px;
  font-size: 11.5px;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cell.add {
  display: grid;
  place-items: center;
  border: 1.5px dashed #d5d1cc;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: none;
  color: var(--muted);
}
.cell.add .plus { font-size: 26px; line-height: 1; }
.cell.add .cap2 { font-size: 11.5px; margin-top: 6px; }

/* ---------- 底部操作条 ---------- */

.actionbar {
  position: sticky;
  bottom: 0;
  z-index: 15;
  padding: 12px 20px calc(12px + var(--safe-b));
  background: linear-gradient(to top, var(--bg) 62%, rgba(247, 244, 242, 0));
}

/* ---------- 筛选（滑动）页 ---------- */

.filter-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.progress {
  margin: 0 20px 10px;
  height: 5px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #ffb199, var(--like));
  transition: width 0.35s ease;
}

.deck {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin: 4px 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.deck-stage {
  position: relative;
  width: 100%;
  height: 100%;
}

.card {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 14px 40px rgba(26, 26, 28, 0.16);
  transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.3s ease;
  will-change: transform;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.card.top { cursor: grab; transform: translateZ(0); }
.card.top:active { cursor: grabbing; }
.card.dragging { transition: none; }
.card.behind { pointer-events: none; }
.card img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.card .ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 34px;
  background: linear-gradient(150deg, #fbf9f7, #eeebe7);
}
.card .info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 46px 20px 22px;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.28) 55%, rgba(0, 0, 0, 0));
  pointer-events: none;
}
.card .info h3 {
  font-size: 19px;
  font-weight: 650;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}
.card .info .src {
  margin-top: 5px;
  font-size: 12.5px;
  opacity: 0.86;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .info .price {
  margin-top: 3px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}
.card .info .note {
  margin-top: 7px;
  font-size: 12.5px;
  line-height: 1.5;
  opacity: 0.86;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 滑动中的色罩：越拖越明显 */
.wash {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.wash.dir-left { background: linear-gradient(100deg, rgba(255, 77, 109, 0.58) 0%, rgba(255, 77, 109, 0) 62%); }
.wash.dir-right { background: linear-gradient(260deg, rgba(104, 114, 128, 0.62) 0%, rgba(104, 114, 128, 0) 62%); }
.wash.dir-up { background: linear-gradient(0deg, rgba(239, 159, 46, 0.52) 0%, rgba(239, 159, 46, 0) 62%); }

/* 盖章：跟着拖动进度由小变大、由淡变实 */
.stamp {
  --p: 0;
  --rot: 0deg;
  position: absolute;
  top: 24px;
  padding: 8px 18px;
  border-radius: 16px;
  border: 4px solid currentColor;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 4px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 6px 20px rgba(26, 26, 28, 0.18);
  opacity: 0;
  pointer-events: none;
  transform-origin: center;
  transform: rotate(var(--rot)) scale(calc(0.68 + 0.46 * var(--p)));
}
.stamp.dir-right { --rot: 12deg; right: 20px; }
.stamp.dir-left { --rot: -12deg; left: 20px; }
.stamp.dir-up { --rot: -4deg; left: 50%; margin-left: -62px; top: 40%; }
.stamp.st-like { color: var(--like); }
.stamp.st-nope { color: var(--nope); }
.stamp.st-hold { color: var(--hold); }

/* 判定成功后在牌堆中间弹一下，手快也能看到反馈 */
.flash {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 30px;
  border-radius: 999px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
  animation: flashPop 0.74s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}
.flash.like { background: linear-gradient(135deg, #ff6c88, #ff2f57); box-shadow: 0 14px 32px rgba(255, 77, 109, 0.45); }
.flash.nope { background: linear-gradient(135deg, #9ba4b0, #6b7480); box-shadow: 0 14px 32px rgba(90, 99, 110, 0.42); }
.flash.hold { background: linear-gradient(135deg, #f7bb5c, #e28f10); box-shadow: 0 14px 32px rgba(239, 159, 46, 0.42); }
@keyframes flashPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  22% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  58% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(1.12); }
}

/* 本轮计分条 */
.tally {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 9px 20px 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.tally .t { display: inline-flex; align-items: center; gap: 3px; transition: transform 0.15s ease; }
.tally .t.like { color: var(--like); }
.tally .t.hold { color: #b8791a; }
.tally .t.nope { color: var(--nope); }
.tally .t.target { color: var(--muted); font-weight: 500; }

.deck-actions {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 20px 20px 8px;
}

.act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 550;
}
.act .b {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 99px;
  background: var(--surface);
  box-shadow: var(--sh-1);
  font-size: 24px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.act.small .b { width: 50px; height: 50px; font-size: 20px; }
.act:active .b { transform: scale(0.9); }
.act.nope .b { color: var(--nope); }
.act.hold .b { color: var(--hold); }
.act.like .b { color: #fff; background: linear-gradient(135deg, #ff6c88, var(--like)); box-shadow: 0 10px 22px rgba(255, 77, 109, 0.32); }
.act[disabled] { opacity: 0.4; pointer-events: none; }

.hint {
  flex: none;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
  padding: 6px 20px calc(14px + var(--safe-b));
}
.hint kbd {
  font: inherit;
  background: var(--surface-2);
  border-radius: 5px;
  padding: 1px 5px;
}
/* 触屏设备不需要键盘提示 */
@media (hover: none) and (pointer: coarse) {
  .kbd-tip { display: none; }
}

/* 筛选完成 */
.done-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 30px 28px calc(30px + var(--safe-b));
  text-align: center;
}
.done-wrap .em {
  width: 92px;
  height: 92px;
  border-radius: 30px;
  display: grid;
  place-items: center;
  font-size: 40px;
  background: linear-gradient(150deg, #fff, #ffe6ec);
  box-shadow: var(--sh-1);
}
.done-wrap h2 { font-size: 20px; font-weight: 700; }
.done-wrap p { font-size: 13px; color: var(--ink-2); }
.done-cards { display: flex; gap: 10px; width: 100%; margin: 6px 0 4px; }
.done-card {
  flex: 1 1 0;
  padding: 14px 8px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-1);
}
.done-card b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.done-card span { font-size: 11.5px; color: var(--muted); }
.done-card.like b { color: var(--like); }
.done-card.hold b { color: var(--hold); }
.done-card.nope b { color: var(--nope); }

/* ---------- 结果页 ---------- */

.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 15px;
  background: var(--surface-2);
}
.seg button {
  height: 38px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background 0.18s ease, box-shadow 0.18s ease;
}
.seg button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(26, 26, 28, 0.12);
}
.seg button.on.s-like { color: var(--like); }
.seg button.on.s-hold { color: var(--hold); }
.seg button.on.s-nope { color: var(--nope); }

.list-item {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-1);
  text-align: left;
  transition: transform 0.15s ease;
}
.list-item:active { transform: scale(0.985); }
.list-item .thumb {
  flex: none;
  width: 62px;
  height: 62px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--muted);
}
.list-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-item .li-main { flex: 1 1 auto; min-width: 0; }
.list-item h4 {
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.li-price {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--like);
}

/* 已选合计 / 预算 */
.money {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--sh-1);
  font-size: 12.5px;
  color: var(--ink-2);
}
.money b { font-size: 16px; font-weight: 700; color: var(--ink); }
.money i { font-style: normal; color: var(--muted); font-size: 11.5px; }
.money.over b { color: #e0364f; }
.money .over-t {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 99px;
  background: #ffe8ec;
  color: #e0364f;
  font-weight: 700;
}

/* 结果页底部的小按钮并排 */
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1 1 0; }
.list-item .li-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank {
  flex: none;
  width: 24px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-2);
  margin: 4px 2px -2px;
}

/* ---------- 弹层 ---------- */

.layer { position: absolute; inset: 0; z-index: 60; pointer-events: none; }
.layer.on { pointer-events: auto; }

.mask {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 18, 0.36);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.26s ease;
}
.mask.on { opacity: 1; }

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 92%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -12px 40px rgba(26, 26, 28, 0.2);
  transform: translateY(102%);
  transition: transform 0.34s cubic-bezier(0.22, 0.61, 0.36, 1);
  overflow: hidden;
}
@media (min-width: 600px) {
  .sheet { border-radius: 26px 26px 30px 30px; }
}
.sheet.on { transform: translateY(0); }

.sheet-grip {
  flex: none;
  width: 40px;
  height: 4px;
  border-radius: 99px;
  background: #dcd8d3;
  margin: 10px auto 2px;
}
.sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 20px calc(20px + var(--safe-b));
}
.sheet-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}
.sheet-desc { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }

.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 550;
  margin-bottom: 6px;
}
.field label .opt { color: var(--muted); font-weight: 400; }
.input, .textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid transparent;
  box-shadow: var(--sh-1);
  outline: none;
  transition: border-color 0.18s ease;
}
.input:focus, .textarea:focus { border-color: rgba(255, 77, 109, 0.45); }
.textarea { resize: none; min-height: 84px; line-height: 1.55; }

.upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 34px 20px;
  border-radius: var(--r-lg);
  border: 1.5px dashed #d5d1cc;
  background: rgba(255, 255, 255, 0.6);
  text-align: center;
}
.upload .em { font-size: 30px; }
.upload h4 { font-size: 15px; font-weight: 650; }
.upload p { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

.thumb-preview {
  width: 100%;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
  margin-bottom: 12px;
}
.thumb-preview img { width: 100%; max-height: 260px; object-fit: cover; }

.status-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.status-row button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 11px 2px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--sh-1);
  font-size: 11.5px;
  white-space: nowrap;
  color: var(--ink-2);
  border: 1.5px solid transparent;
}
.status-row button .em { font-size: 18px; }
.status-row button.on.todo { border-color: #cfcac4; color: var(--ink-2); background: var(--surface-2); }
.status-row button.on.like { border-color: var(--like); color: var(--like); background: var(--like-soft); }
.status-row button.on.hold { border-color: var(--hold); color: #a86b09; background: var(--hold-soft); }
.status-row button.on.nope { border-color: var(--nope); color: #5b6470; background: var(--nope-soft); }

.sheet-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }

/* 目标张数选择 */
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chip {
  height: 46px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--sh-1);
  border: 1.5px solid transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  transition: transform 0.14s ease;
}
.chip:active { transform: scale(0.96); }
.chip.on { border-color: var(--like); color: var(--like); background: var(--like-soft); }

/* 分组详情里的状态筛选（全部 / 待筛选 / 喜欢 / 待定 / 不喜欢） */
.fchips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 -20px;
  padding: 2px 20px 4px;
}
.fchip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--sh-1);
  border: 1.5px solid transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background 0.16s ease, color 0.16s ease;
}
.fchip i { font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--muted); }
.fchip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.fchip.on i { color: rgba(255, 255, 255, 0.75); }
.fchip.on.like { background: var(--like); border-color: var(--like); }
.fchip.on.hold { background: var(--hold); border-color: var(--hold); }
.fchip.on.nope { background: var(--nope); border-color: var(--nope); }
.fchip.on.todo { background: #b6b0a9; border-color: #b6b0a9; }

/* 分批加载的尾巴 */
.load-more {
  grid-column: 1 / -1;
  padding: 14px 0 6px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.load-more::before { content: '↓ '; opacity: 0.55; }
.field-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
  margin-top: 8px;
}

/* 结果页提示条 */
.tip {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 12.8px;
  line-height: 1.6;
}
.tip.ok { background: #e7f6ed; color: #1d7a45; }
.tip.warn { background: var(--hold-soft); color: #8f5b08; }
.tip.lock { background: #fdf3dd; color: #8a6410; border: 1px solid #f3e0b4; }

.status-row.locked button { pointer-events: none; opacity: 0.55; }

.icon-btn { position: relative; }
.icon-btn .icon-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--like);
  color: #fff;
  font-size: 10.5px;
  font-style: normal;
  line-height: 17px;
  text-align: center;
  font-weight: 700;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-1);
  font-size: 14.5px;
  text-align: left;
}
.menu-item .em { font-size: 17px; }
.menu-item.danger { color: #e0364f; }

/* ---------- Toast ---------- */

/* ---------- 荣誉界面 ---------- */

/* ---------- 账号与同步状态 ---------- */

/* 顶部同步提示条：只在离线/失败时出现，正常情况不打扰 */
.sync-badge {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(8px + var(--safe-t));
  z-index: 55;
  padding: 9px 14px;
  border-radius: 14px;
  background: rgba(26, 26, 28, 0.88);
  color: #fff;
  font-size: 12.5px;
  text-align: center;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.sync-badge.on { opacity: 1; transform: translateY(0); }

.icon-dot.ok { background: #2fa96a; font-size: 9px; }

/* 首页那条"数据只在这台设备"的提示，整条可点 */
.tip-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.tip-btn b { font-weight: 700; }
.tip-btn:active { transform: scale(0.99); }

/* 首次手势引导 */
.hint-mask { background: rgba(20, 18, 18, 0.34); }
.hint-panel {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 3;
  width: min(320px, 86%);
  padding: 22px 20px 18px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 20px 50px rgba(26, 26, 28, 0.3);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 0.22s ease, transform 0.26s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}
.hint-panel.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.hint-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}
.hp {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.hp.left { background: var(--like-soft); color: var(--like); }
.hp.up { background: var(--hold-soft); color: #a86b09; }
.hp.right { background: var(--nope-soft); color: #5b6470; }
.hint-panel p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

/* 结果图片 */
.shot-mask { background: rgba(20, 18, 18, 0.62); }
.shot-panel {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: calc(24px + var(--safe-t)) 22px calc(24px + var(--safe-b));
  overflow-y: auto;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.24s ease, transform 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.shot-panel.on { opacity: 1; transform: scale(1); }
.shot-head { font-size: 13px; color: rgba(255, 255, 255, 0.92); }
.shot-img {
  width: 100%;
  max-width: 340px;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.shot-panel .btn { color: rgba(255, 255, 255, 0.9); }


.honor-panel {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(34px + var(--safe-t)) 24px calc(22px + var(--safe-b));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(168deg, #fff7ea 0%, #ffeef2 46%, #f2f0ff 100%);
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.28s ease, transform 0.34s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.honor-panel.on { opacity: 1; transform: scale(1); }

.honor-glow {
  position: absolute;
  left: 50%;
  top: -40px;
  width: 320px;
  height: 320px;
  margin-left: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 190, 110, 0.5), rgba(255, 190, 110, 0) 68%);
  pointer-events: none;
  animation: glowPulse 3.4s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.1); opacity: 1; }
}

.honor-badge { position: relative; text-align: center; margin-bottom: 12px; }
.hb-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto;
  background: conic-gradient(from 210deg, #ffd98a, #fff3cf, #ffc46b, #fff3cf, #ffd98a);
  box-shadow: 0 12px 30px rgba(208, 150, 40, 0.32), inset 0 0 0 2px rgba(255, 255, 255, 0.6);
  animation: badgeIn 0.62s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.hb-inner {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 38px;
  background: linear-gradient(160deg, #fffdf7, #ffeec8);
  box-shadow: inset 0 -3px 8px rgba(199, 148, 60, 0.25);
}
@keyframes badgeIn {
  0% { transform: scale(0.4) rotate(-18deg); opacity: 0; }
  70% { transform: scale(1.08) rotate(4deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
.hb-no {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--sh-1);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #a5761a;
}

.honor-title { font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 4px; }
.honor-rank { font-size: 13px; color: #8a7a5c; text-align: center; margin-bottom: 16px; }
.honor-rank b { font-size: 16px; color: #c8860d; }

.honor-picks { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.honor-picks.none { font-size: 13px; color: var(--muted); }
.hp-img {
  width: 78px;
  height: 78px;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 8px 20px rgba(26, 26, 28, 0.14);
}
.hp-img img { width: 100%; height: 100%; object-fit: cover; }
.hp-more { font-size: 13px; font-weight: 700; color: var(--muted); }
.honor-name { font-size: 15px; font-weight: 650; text-align: center; margin-bottom: 18px; }

.honor-facts {
  width: 100%;
  padding: 4px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--sh-1);
  margin-bottom: 18px;
}
.honor-facts .fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(26, 26, 28, 0.06);
}
.honor-facts .fact:last-child { border-bottom: 0; }
.honor-facts .fact span { font-size: 12.5px; color: var(--muted); }
.honor-facts .fact b { font-size: 13.5px; font-weight: 650; text-align: right; }

.honor-panel .btn { flex: none; }
.honor-tip { margin-top: 12px; font-size: 11.5px; line-height: 1.7; color: #9a8f7c; text-align: center; }

/* 我的荣誉：徽章墙 */
.badge-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 12px 12px;
  border-radius: var(--r-lg);
  background: linear-gradient(170deg, #fffaef, #fff5f7);
  border: 1px solid rgba(216, 176, 96, 0.24);
  box-shadow: var(--sh-1);
  text-align: center;
  transition: transform 0.15s ease;
}
.badge-card:active { transform: scale(0.98); }
.bc-no {
  padding: 2px 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #a5761a;
}
.bc-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(26, 26, 28, 0.1);
}
.bc-img img { width: 100%; height: 100%; object-fit: cover; }
.bc-name {
  width: 100%;
  font-size: 13.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bc-meta { font-size: 11.5px; color: var(--muted); }

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(118px + var(--safe-b));
  transform: translate(-50%, 12px);
  max-width: 78vw;
  padding: 11px 18px;
  border-radius: 14px;
  background: rgba(26, 26, 28, 0.9);
  color: #fff;
  font-size: 13.5px;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
  text-align: center;
  backdrop-filter: blur(8px);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 启动页 ---------- */

.splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  color: var(--muted);
}
.splash .logo {
  width: 74px;
  height: 74px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: linear-gradient(150deg, #fff, #ffe0e8);
  box-shadow: var(--sh-1);
}
.splash p { font-size: 13px; }

/* ---------- 骨架 ---------- */

.skel {
  background: linear-gradient(90deg, #efece8 25%, #f7f5f3 37%, #efece8 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
