/* ============ tokens ============ */
:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --ink: #2a2622;
  --ink-2: #5c554d;
  --muted: #948c82;
  --line: #ece7df;
  --primary: #e4572e;
  --primary-2: #f0744f;
  --primary-soft: #fdeee8;
  --gold: #b8871f;
  --gold-soft: #fbf3df;
  --green: #3f8f5c;
  --green-soft: #e8f4ec;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(42, 38, 34, 0.06);
  --shadow-lg: 0 12px 40px rgba(42, 38, 34, 0.14);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  overscroll-behavior-y: none;
  margin: 0; padding: 0;
  background: #e9e4dc;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; font-size: inherit; color: inherit; }
img { display: block; }
a { color: inherit; text-decoration: none; }

/* ============ phone frame ============ */
#app { min-height: 100vh; }
.phone {
  position: relative;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  height: 100dvh;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 520px) {
  body { padding: 24px 0; }
  .phone {
    height: 880px; min-height: 880px;
    border-radius: 26px;
    box-shadow: 0 30px 80px rgba(42, 38, 34, 0.25);
  }
}

/* ============ topbar ============ */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 10px;
  background: linear-gradient(to bottom, rgba(246,243,238,0.98), rgba(246,243,238,0.86));
  backdrop-filter: blur(12px);
}
.topbar .tt { font-size: 19px; font-weight: 700; letter-spacing: 0.2px; }
.topbar .sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; box-shadow: var(--shadow);
  color: var(--ink-2);
}
.icon-btn svg { width: 18px; height: 18px; }

/* ============ main ============ */
.main {
  flex: 1;
  padding: 4px 16px 100px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.main::-webkit-scrollbar { width: 0; }
.no-tab .main { padding-bottom: 90px; }
.no-tab .tabbar { display: none; }

/* ============ tabbar ============ */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 66px;
  display: flex;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 10.5px; color: var(--muted);
  transition: color .15s;
}
.tabbar button svg { width: 22px; height: 22px; stroke-width: 1.7; }
.tabbar button.on { color: var(--primary); font-weight: 600; }

/* ============ cards ============ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.section-title {
  display: flex; align-items: baseline; gap: 8px;
  margin: 20px 2px 10px;
  font-size: 15px; font-weight: 700;
}
.section-title .more { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 400; }
.section-title::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px;
  background: var(--primary); display: inline-block;
}

/* ============ chips ============ */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  height: 32px; padding: 0 16px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: var(--ink-2);
  font-size: 13px; box-shadow: var(--shadow);
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip.on { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(228,87,46,0.28); }

/* ============ feed card ============ */
.feed { display: flex; flex-direction: column; gap: 12px; }
.wish-card { display: flex; gap: 12px; padding: 12px; }
.wish-card .thumb {
  width: 96px; height: 96px; border-radius: 12px; object-fit: cover; flex: 0 0 auto;
  background: #eee;
}
.wish-card .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wish-card .title {
  font-weight: 650; font-size: 15px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wish-card .desc {
  margin-top: 4px; font-size: 12.5px; color: var(--muted); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.wish-card .meta {
  margin-top: auto; padding-top: 8px;
  display: flex; align-items: center; gap: 10px;
  font-size: 11.5px; color: var(--muted);
}
.wish-card .meta .dot { width: 3px; height: 3px; border-radius: 50%; background: #d6cfc6; }
.avatar {
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, #f7c9b6, #e4572e);
  color: #fff; font-size: 9px; display: grid; place-items: center; font-weight: 700;
}
.pill {
  font-size: 10.5px; padding: 2px 7px; border-radius: 6px;
  background: var(--gold-soft); color: var(--gold); font-weight: 600;
}
.pill.pink { background: var(--primary-soft); color: var(--primary); }
.pill.green { background: var(--green-soft); color: var(--green); }

/* ============ detail ============ */
.detail-head { padding: 4px 2px 0; }
.detail-title { font-size: 22px; font-weight: 750; line-height: 1.35; letter-spacing: 0.2px; }
.detail-author { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; }
.detail-author .avatar { width: 30px; height: 30px; font-size: 12px; }
.detail-author .name { font-weight: 600; font-size: 13.5px; }
.detail-author .time { font-size: 11.5px; color: var(--muted); }
.detail-body { font-size: 15px; line-height: 1.85; color: var(--ink-2); white-space: pre-wrap; }
.detail-img {
  width: 100%; border-radius: var(--radius); margin: 14px 0; background: #eee;
}
.stat-row { display: flex; gap: 8px; margin: 16px 0; }
.stat-box {
  flex: 1; background: #fff; border-radius: 14px; padding: 12px 10px; text-align: center;
  box-shadow: var(--shadow);
}
.stat-box .n { font-size: 20px; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-box .l { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ============ action bar ============ */
.actionbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; gap: 10px; padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,0.96); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}

/* ============ buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 22px; border-radius: 999px;
  box-sizing: border-box; white-space: nowrap;
  font-size: 15px; font-weight: 650; line-height: 1;
  transition: transform .08s, opacity .15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(228,87,46,0.28); }
.btn-primary:disabled { background: #d9d3cb; box-shadow: none; color: #fff; }
.btn-ghost { background: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 16px; font-size: 13px; border-radius: 999px; }

/* ============ list ============ */
.list { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 16px; border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: none; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-size: 14.5px; font-weight: 550; }
.list-item .li-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.list-item .li-right { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.list-item .chev { color: #c9c2b8; }

/* ============ product grid ============ */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.product { display: flex; flex-direction: column; }
.product img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.product .pbody { padding: 10px 11px 12px; }
.product .pname {
  font-size: 13.5px; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product .price-row { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.product .price { color: var(--primary); font-weight: 750; font-size: 16px; }
.product .price small { font-size: 11px; font-weight: 500; }
.product .pts { font-size: 11px; color: var(--gold); background: var(--gold-soft); padding: 1px 6px; border-radius: 5px; }

/* ============ wallet ============ */
.wallet {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #2f2a25, #4a4037);
  color: #fff; border-radius: 20px; padding: 20px;
  box-shadow: 0 14px 34px rgba(47,42,37,0.28);
}
.wallet::after {
  content: ""; position: absolute; right: -40px; top: -60px;
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(228,87,46,0.55), transparent 65%);
}
.wallet .lbl { font-size: 12px; opacity: .7; letter-spacing: .4px; }
.wallet .num { font-size: 40px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.wallet .sub { font-size: 12px; opacity: .66; margin-top: 4px; }
.wallet .row { display: flex; gap: 18px; margin-top: 16px; position: relative; z-index: 1; }
.wallet .row div { font-size: 11.5px; opacity: .8; }
.wallet .row b { display: block; font-size: 15px; opacity: 1; font-weight: 700; }

/* ============ forms ============ */
.form-label { font-size: 12.5px; color: var(--muted); margin: 16px 2px 7px; }
.input, .textarea {
  width: 100%; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; outline: none;
  transition: border-color .15s;
}
.input:focus, .textarea:focus { border-color: #e8b6a5; }
.textarea { min-height: 130px; resize: vertical; line-height: 1.7; }
.type-row { display: flex; gap: 8px; flex-wrap: wrap; }
.type-opt {
  padding: 8px 14px; border-radius: 10px; background: #fff;
  border: 1px solid var(--line); font-size: 13px; color: var(--ink-2);
}
.type-opt.on { background: var(--primary-soft); border-color: #f3b9a6; color: var(--primary); font-weight: 600; }

/* ============ toast / modal ============ */
#layer { position: absolute; inset: 0; pointer-events: none; z-index: 100; }
.toast {
  position: absolute; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(10px);
  background: rgba(42,38,34,0.92); color: #fff; font-size: 13.5px;
  padding: 10px 16px; border-radius: 10px; opacity: 0;
  transition: opacity .2s, transform .2s; max-width: 80%; text-align: center;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.mask {
  position: absolute; inset: 0; background: rgba(30,26,22,0.45);
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: auto; animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.sheet {
  width: 100%; max-width: 430px; background: var(--bg);
  border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  animation: up .24s cubic-bezier(.2,.8,.2,1); max-height: 86%; overflow-y: auto;
}
@keyframes up { from { transform: translateY(24px); opacity: .6 } to { transform: none; opacity: 1 } }
.sheet h3 { margin: 0 0 4px; font-size: 17px; }
.sheet .hint { font-size: 12.5px; color: var(--muted); }

/* ad player */
.ad-player {
  background: #1d1a17; border-radius: 16px; height: 230px;
  display: grid; place-items: center; color: #fff; position: relative; overflow: hidden;
}
.ad-player .brand { font-size: 13px; opacity: .55; letter-spacing: 2px; }
.ad-player .count {
  position: absolute; right: 12px; top: 12px;
  background: rgba(255,255,255,.14); border-radius: 999px;
  padding: 3px 10px; font-size: 12px;
}
.ad-player .ring {
  width: 74px; height: 74px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.18); border-top-color: var(--primary-2);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* range */
input[type="range"] {
  -webkit-appearance: none; width: 100%; height: 4px; border-radius: 2px;
  background: #e6dfd5; outline: none; margin: 16px 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 3px solid var(--primary); box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

/* ============ login ============ */
.login { padding: 60px 26px 40px; }
.brand-mark {
  width: 62px; height: 62px; border-radius: 18px;
  background: linear-gradient(135deg, #f0744f, #e4572e);
  display: grid; place-items: center; color: #fff; font-size: 28px; font-weight: 800;
  box-shadow: 0 14px 30px rgba(228,87,46,.32);
}
.login h1 { font-size: 30px; margin: 22px 0 6px; letter-spacing: 1px; }
.login .slogan { color: var(--muted); font-size: 14px; line-height: 1.7; }
.login .roles { margin-top: 34px; display: flex; flex-direction: column; gap: 10px; }
.role-btn {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: #fff; border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow);
}
.role-btn .r-ic {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-size: 17px;
}
.role-btn .r-t { font-weight: 600; font-size: 14.5px; }
.role-btn .r-s { font-size: 11.5px; color: var(--muted); }
.login .foot { margin-top: 26px; font-size: 11.5px; color: #b3aaa0; line-height: 1.7; }

.login-steps { margin-top: 30px; display: flex; flex-direction: column; gap: 16px; }
.login-step { display: flex; gap: 12px; align-items: flex-start; }
.login-step .n {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
  background: #fff; box-shadow: var(--shadow); display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--primary);
}
.login-step b { font-size: 13.5px; font-weight: 650; }

/* ============ misc ============ */
.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 50px 0; }
.loading { text-align: center; color: var(--muted); font-size: 13px; padding: 60px 0; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid #ddd3c7; border-top-color: var(--primary);
  animation: spin .8s linear infinite; display: inline-block; vertical-align: -3px; margin-right: 6px;
}
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.muted { color: var(--muted); }
.tiny { font-size: 11.5px; }
.right { text-align: right; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 8px; }
.mt8 { margin-top: 8px } .mt12 { margin-top: 12px } .mt16 { margin-top: 16px }
.mb8 { margin-bottom: 8px }

.comment { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: none; }
.comment .avatar { width: 28px; height: 28px; font-size: 11px; flex: 0 0 auto; }
.comment .cname { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.comment .cbody { font-size: 14px; line-height: 1.6; margin-top: 2px; }
.comment .ctime { font-size: 11px; color: var(--muted); margin-top: 4px; }

.cmt-input {
  margin-top: 12px;
  display: flex; gap: 8px;
}
.cmt-input input {
  flex: 1; height: 42px; border-radius: 12px; border: 1px solid var(--line);
  padding: 0 14px; outline: none; background: #fff;
}

/* 外卖页 */
.hero {
  border-radius: 20px; padding: 22px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #f2a03d, #e4572e);
  box-shadow: 0 14px 30px rgba(228,87,46,.25);
}
.hero h2 { margin: 0; font-size: 21px; letter-spacing: .5px; }
.hero p { margin: 8px 0 18px; font-size: 13px; opacity: .9; line-height: 1.6; }
.hero .big { font-size: 30px; font-weight: 800; }
.hero .btn { background: #fff; color: var(--primary); box-shadow: none; }

.thumb-empty{display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#fdebe3,#f6f3ee);color:#e4572e;font-weight:700;font-size:20px}

/* 纯文字心愿：不显示缩略图，正文多给两行 */
.wish-card.no-thumb { display: block; padding: 14px 16px; }
.wish-card.no-thumb .desc { -webkit-line-clamp: 3; }
.wish-card.no-thumb .title { font-size: 15.5px; }

/* 底部导航等分占满整行 */
.tabbar button { flex: 1 1 0; min-width: 0; }

/* ============ 横向滑动提示 ============ */
.hscroll {
  display: flex; gap: 12px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
.hscroll::-webkit-scrollbar { display: none; }

.hint-wrap { position: relative; }
.hint-wrap::after {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 0; width: 40px;
  background: linear-gradient(to right, rgba(246, 243, 238, 0), rgba(246, 243, 238, 0.94));
  opacity: 0; transition: opacity .22s ease; pointer-events: none; border-radius: 0 10px 10px 0;
}
.hint-wrap.show::after { opacity: 1; }

.hint-arrow {
  position: absolute; right: 1px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 8px rgba(42, 38, 34, 0.18);
  border: 1px solid rgba(228, 87, 46, 0.18);
  color: var(--primary); font-size: 14px; font-weight: 700;
  line-height: 22px; text-align: center;
  opacity: 0; transition: opacity .22s ease; pointer-events: none; z-index: 3;
}
.hint-wrap.show .hint-arrow { opacity: 1; }

/* 活动卡片：只有封面 + 标题 + 一行简介 */
.act-card {
  flex: 0 0 auto; width: 236px;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform .15s ease;
}
.act-card:active { transform: scale(.985); }
.act-card:active { opacity: .85; }

/* ============================================================
   桌面端适配（≥ 900px）：左侧导航 + 内容区多列
   手机 / 平板沿用原来的手机壳布局
   ============================================================ */
@media (min-width: 900px) {
  body { padding: 0; background: var(--bg); }

  .phone {
    max-width: none; width: 100%;
    height: auto; min-height: 100vh;
    border-radius: 0; box-shadow: none; overflow: visible;
    padding-left: 212px;
    display: block;
  }

  /* ---- 左侧竖排导航 ---- */
  .tabbar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 212px; height: 100vh;
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 4px; padding: 84px 14px 24px;
    background: #fff; border-top: none; border-right: 1px solid var(--line);
    backdrop-filter: none;
  }
  .tabbar::before {
    content: "愿  攒愿集市";
    position: absolute; left: 26px; top: 26px;
    font-size: 17px; font-weight: 800; color: var(--ink); letter-spacing: .3px;
  }
  .tabbar button {
    flex: 0 0 auto;
    flex-direction: row; justify-content: flex-start; gap: 12px;
    height: 46px; padding: 0 14px; border-radius: 12px;
    font-size: 14px; color: var(--ink-2); font-weight: 500;
    transition: background .15s, color .15s;
  }
  .tabbar button:hover { background: #FAF7F2; }
  .tabbar button svg { width: 20px; height: 20px; }
  .tabbar button.on { background: #FDEEE8; color: var(--primary); font-weight: 650; }

  /* ---- 顶部与内容 ---- */
  .topbar {
    position: static;
    width: min(1116px, calc(100% - 56px)); margin: 0 auto;
    padding: 30px 0 14px;
    background: none; backdrop-filter: none;
  }
  .topbar .tt { font-size: 23px; }
  .topbar .sub { font-size: 13px; margin-top: 3px; }

  .main {
    width: min(1116px, calc(100% - 56px)); margin: 0 auto;
    padding: 0 0 64px;
    overflow: visible;
  }
  .no-tab .main { padding-bottom: 64px; }
  .no-tab .tabbar { display: flex; }

  /* ---- 列表页多列 ---- */
  .feed { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .grid2 { grid-template-columns: repeat(3, 1fr); gap: 14px; }

  .wish-card { height: 100%; }
  .wish-card .thumb { width: 108px; height: 108px; }

  /* 侧栏卡片：列表页里的「我的愿力」等整宽卡片保持通栏 */
  .main > .card { margin-bottom: 14px; }

  /* ---- 阅读类页面收窄 ---- */
  .phone[data-view="post"] .main,
  .phone[data-view="publish"] .main,
  .phone[data-view="notes"] .main { width: min(760px, calc(100% - 56px)); }

  /* 详情/发布页：顶栏与内容同宽，图片限高 */
  .phone[data-view="post"] .topbar,
  .phone[data-view="publish"] .topbar,
  .phone[data-view="notes"] .topbar { width: min(760px, calc(100% - 56px)); }

  .phone[data-view="post"] .main img {
    max-height: 62vh; object-fit: contain; background: #F1EDE6;
  }

  .phone[data-view="me"] .topbar,
  .phone[data-view="orders"] .topbar,
  .phone[data-view="settings"] .topbar,
  .phone[data-view="ledger"] .topbar { width: min(860px, calc(100% - 56px)); }

  .phone[data-view="me"] .main,
  .phone[data-view="orders"] .main,
  .phone[data-view="settings"] .main,
  .phone[data-view="ledger"] .main { width: min(860px, calc(100% - 56px)); }

  /* ---- 浮层：底部弹层改为居中弹窗 ---- */
  .mask { position: fixed; align-items: center; }
  .sheet {
    border-radius: 20px; max-width: 520px; max-height: 80vh;
    padding: 24px 22px;
  }
  .toast { position: fixed; bottom: 44px; }
}

/* ============================================================
   宽屏（≥ 1500px）：再多一列
   ============================================================ */
@media (min-width: 1500px) {
  .feed { grid-template-columns: repeat(3, 1fr); }
  .grid2 { grid-template-columns: repeat(4, 1fr); }
  .topbar, .main { width: min(1320px, calc(100% - 72px)); }
  .phone[data-view="post"] .main,
  .phone[data-view="publish"] .main,
  .phone[data-view="notes"] .main { width: min(800px, calc(100% - 72px)); }
}

/* ============================================================
   桌面端细节优化
   ============================================================ */
@media (min-width: 900px) {
  /* 栅格里的卡片等高 */
  .feed { align-items: stretch; }
  .wish-card { height: 100%; }

  /* 悬停反馈 */
  .card, .chip, .tabbar button { transition: box-shadow .18s, transform .18s, background .18s; }
  .feed .wish-card:hover,
  .grid2 .card:hover { box-shadow: 0 10px 28px rgba(42, 38, 34, 0.12); transform: translateY(-1px); }

  /* 侧栏 Logo */
  .tabbar::before {
    content: "攒愿集市";
    padding-left: 44px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Crect width='32' height='32' rx='10' fill='%23E4572E'/%3E%3Ctext x='16' y='22' font-size='17' font-family='PingFang SC,Microsoft YaHei,sans-serif' font-weight='700' fill='white' text-anchor='middle'%3E愿%3C/text%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 32px 32px;
    display: flex; align-items: center;
    min-height: 32px;
  }

  /* 顶部右侧的圆形按钮稍大一点 */
  .topbar .icon-btn { width: 38px; height: 38px; }
}

/* ============ 囧事墙 ============ */
.fn-sorts { display: flex; gap: 8px; padding: 2px 2px 10px; }
.fn-sort {
  height: 32px; padding: 0 16px; border-radius: 999px; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: #5c554d; box-shadow: var(--shadow);
}
.fn-sort.on { background: #2A2622; color: #fff; font-weight: 600; }

.funny-card { padding: 14px 16px; margin-bottom: 12px; cursor: pointer; }
.fn-meta { display: flex; align-items: center; gap: 8px; }
.fn-cat {
  font-size: 11px; color: #C2492A; background: #FDF2EC;
  padding: 1px 8px; border-radius: 6px;
}
.fn-body {
  margin-top: 8px; font-size: 15px; line-height: 1.72; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

.fn-god {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: #FBF7F0; border-left: 3px solid var(--primary);
}
.fn-god-label { font-size: 11px; color: var(--primary); font-weight: 700; }
.fn-god-text { margin-top: 4px; font-size: 13.5px; line-height: 1.6; color: #3f3a34; }

.fn-god-card {
  padding: 16px; border-radius: 14px; background: #FBF1EA;
  border-left: 4px solid var(--primary); margin-bottom: 12px;
}

.fn-acts {
  display: flex; gap: 22px; margin-top: 12px;
  font-size: 13px; color: var(--muted);
}
.fn-acts .on { color: var(--primary); font-weight: 600; }
.fn-acts .gold { color: #B8860B; margin-left: auto; }

.fn-c { padding: 10px 0; border-bottom: 1px solid #F6F3EE; }
.fn-c:last-child { border-bottom: none; }
.fn-c-head { display: flex; align-items: center; gap: 6px; }
.fn-c-author { font-size: 12.5px; color: var(--muted); }
.fn-god-flag { font-size: 10px; color: #fff; background: var(--primary); padding: 1px 6px; border-radius: 4px; }
.fn-c-body { margin-top: 4px; font-size: 14px; line-height: 1.6; }
.fn-c-foot { margin-top: 4px; font-size: 11.5px; color: #a09a90; }

@media (min-width: 900px) {
  .fn-body { -webkit-line-clamp: 3; }
}


/* 集市卡片：标题固定三行高，两列底部对齐 */
.grid2 > .card > div > div[style*="font-size:14px"] {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 4.2em;
  line-height: 1.4;
}

/* ============ 微信内引导小程序 ============ */
.weapp-mask {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(30,26,22,.45);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 16px 22px;
}
.weapp-card {
  width: 100%; max-width: 420px;
  background: #fff; border-radius: 20px; padding: 22px 20px 18px;
  box-shadow: 0 14px 40px rgba(0,0,0,.18);
}
.weapp-title { font-size: 18px; font-weight: 800; text-align: center; }
.weapp-sub { margin-top: 6px; font-size: 13px; color: var(--muted); text-align: center; }
.weapp-perks {
  display: flex; justify-content: center; gap: 14px;
  margin: 14px 0 18px; font-size: 12px; color: #2F7D4F;
}
.weapp-actions { display: flex; flex-direction: column; gap: 10px; }
.weapp-actions .btn { width: 100%; }
.weapp-hint { margin-top: 12px; font-size: 11.5px; color: #b3aaa0; text-align: center; }

/* ============ 登录页（精简版） ============ */
.login-page .main { padding: 0 24px; }
.login-lite {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding-bottom: 6vh;
}
.login-logo {
  width: 52px; height: 52px; border-radius: 15px;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  font-size: 26px; font-weight: 800;
  box-shadow: 0 8px 22px rgba(228,87,46,.28);
  margin-bottom: 14px;
}
.login-name { font-size: 27px; font-weight: 800; letter-spacing: .5px; }
.login-slogan { margin-top: 6px; font-size: 13.5px; color: var(--muted); }

.login-input {
  margin-top: 26px;
  height: 46px;
}
.login-code-btn {
  flex: 0 0 108px; height: 46px; border-radius: 13px;
  font-size: 13px; padding: 0 10px;
}
.login-submit { margin-top: 14px; height: 46px; }
.login-note { margin-top: 10px; font-size: 11.5px; color: #b3aaa0; text-align: center; }

.login-or {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.login-or::before, .login-or::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}
.login-or span { font-size: 11.5px; color: #b3aaa0; }

.login-wx { background: #07C160; color: #fff; height: 46px; }
.login-wx:active { transform: scale(.98); }

.login-foot {
  margin-top: 22px; font-size: 11px; color: #b3aaa0;
  text-align: center; line-height: 1.9;
}
.login-foot a { color: #b3aaa0; text-decoration: underline; }

/* 登录页不需要底部留白 */
.login-page .main { padding-bottom: 0; }

/* ============ 悬浮发布按钮 ============ */
.fab {
  position: fixed;
  right: 16px;
  bottom: 84px;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(228,87,46,.34);
  cursor: pointer;
  z-index: 60;
  transition: transform .08s;
  /* 关键：告诉浏览器这块区域的触摸手势由我们自己处理，不要拿去滚页面 */
  touch-action: none;
  -ms-touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.fab:active { transform: scale(.94); }
.fab svg { width: 22px; height: 22px; stroke-width: 2.2; }

@media (min-width: 900px) {
  .fab { bottom: 40px; width: 56px; height: 56px; }
}
