@import url("tokens.css");
/* ---------- 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(255,179,71,0.30), transparent 55%),
    radial-gradient(95% 55% at 90% 110%, rgba(22,199,154,0.16), transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
  background-attachment: fixed;
  font-size: var(--fs-md);
  line-height: 1.5;
}
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: var(--fs-md); color: var(--ink); }
a { color: inherit; text-decoration: none; }

/* ---------- 布局壳（手机视口） ---------- */
.shell { max-width: 460px; margin: 0 auto; min-height: 100vh; position: relative;
  background: linear-gradient(180deg, rgba(255,253,246,0.6), rgba(251,244,228,0.2));
  padding-bottom: 78px; }
.appbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bar-grad); color: var(--on-brand);
  padding: 30px var(--s4) var(--s3); backdrop-filter: blur(6px);
}
.appbar .row { display: flex; align-items: center; gap: var(--s3); }
.appbar .city { font-weight: 700; font-size: var(--fs-md); display: flex; align-items: center; gap: 4px; }
.appbar .search {
  flex: 1; height: 38px; border-radius: var(--r-pill);
  background: var(--search-bg); color: var(--search-ink);
  display: flex; align-items: center; gap: 8px; padding: 0 14px; font-size: var(--fs-sm);
  box-shadow: var(--sh-1);
}
.appbar .ico {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.22); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.appbar .brand { font-family: var(--font-serif); font-weight: 700; font-size: var(--fs-2xl);
  color: #fff; letter-spacing: 1px; margin: var(--s3) 0 var(--s1); text-shadow: 0 2px 8px rgba(180,90,0,0.25); }
.appbar .sub { color: rgba(255,255,255,0.92); font-size: var(--fs-sm); }

/* ---------- 分区 ---------- */
.section { padding: var(--s4); }
.h-title { display: flex; align-items: center; justify-content: space-between; margin: var(--s4) var(--s4) var(--s2); }
.h-title h2 { font-size: var(--fs-lg); font-weight: 700; }
.h-title .more { color: var(--muted); font-size: var(--fs-sm); }

/* ---------- 分类宫格 ---------- */
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); padding: 0 var(--s4); }
.cat { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--s3) 0; }
.cat .ic {
  width: 48px; height: 48px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  box-shadow: var(--sh-1); position: relative; overflow: hidden;
}
.cat .ic::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 30% 10%, rgba(255,179,71,0.5), transparent 60%); opacity: .9; }
.cat .ic span { position: relative; }
.cat .lb { font-size: var(--fs-xs); color: var(--ink-2); }

/* ---------- 卡片 ---------- */
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r);
  box-shadow: var(--sh-1); overflow: hidden; }
.post { margin: 0 var(--s4) var(--s4); padding: var(--s3); display: flex; gap: var(--s3); }
.post .thumb { width: 92px; height: 92px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3)); position: relative;
  display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--brand); overflow: hidden; }
.post .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post .body { flex: 1; min-width: 0; }
.post .ttl { font-weight: 700; font-size: var(--fs-md); margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.post .ct { color: var(--ink-2); font-size: var(--fs-sm);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post .meta { display: flex; align-items: center; gap: var(--s2); margin-top: 8px; color: var(--muted); font-size: var(--fs-xs); }
.tag { font-size: var(--fs-xs); padding: 2px 8px; border-radius: var(--r-pill); background: var(--surface-3); color: #B5610A; font-weight: 600; }
.tag.vip { background: linear-gradient(135deg,#FFE2B0,#FFC266); color: #9A4E00; }
.tag.official { background: var(--mint); color: #fff; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 var(--s5); border-radius: var(--r-pill); font-weight: 700; font-size: var(--fs-md);
  background: var(--brand); color: var(--on-brand); box-shadow: var(--sh-2); transition: transform .12s; }
.btn:active { transform: scale(.97); }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface); color: var(--brand); border: 1.5px solid var(--brand); box-shadow: none; }
.btn.mint { background: var(--mint); box-shadow: 0 6px 18px rgba(22,199,154,0.25); }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- 底部导航 ---------- */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 460px; z-index: 30; display: flex;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line-soft); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); font-size: 10px; padding: 6px 0; }
.tabbar a .ic { font-size: 20px; }
.tabbar a.on { color: var(--brand); }
.fab { position: fixed; right: 18px; bottom: 72px; z-index: 31; width: 54px; height: 54px;
  border-radius: 50%; background: var(--bar-grad); color: #fff; font-size: 26px;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-3);
  left: calc(50% + 170px); }

/* ---------- 通用块 ---------- */
.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); box-shadow: var(--sh-1);
  padding: var(--s4); margin: 0 var(--s4) var(--s4); }
.field { margin-bottom: var(--s4); }
.field label { display: block; font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%; height: 46px; border-radius: var(--r-sm); border: 1.5px solid var(--line);
  padding: 0 14px; background: var(--bg-1); outline: none; transition: border-color .15s; }
.field textarea { height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); }
.seg { display: flex; flex-wrap: wrap; gap: var(--s2); }
.seg button { padding: 9px 12px; border-radius: var(--r-pill); border: 1.5px solid var(--line);
  background: var(--bg-1); font-size: var(--fs-sm); color: var(--ink-2); font-weight: 600; }
.seg button.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- 提示条 ---------- */
.banner { margin: var(--s4); padding: 12px 14px; border-radius: var(--r); font-size: var(--fs-sm);
  background: linear-gradient(135deg, var(--surface-3), #FFE9CC); color: #9A4E00;
  border: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.banner.mint { background: linear-gradient(135deg, #DFFFF5, #C5F4E8); color: var(--mint-ink); }

/* ---------- 余额卡 ---------- */
.bal { background: var(--bar-grad); color: #fff; border-radius: var(--r-lg); padding: var(--s5);
  box-shadow: var(--sh-3); margin: var(--s4); position: relative; overflow: hidden; }
.bal::after { content:""; position:absolute; right:-30px; top:-30px; width:140px; height:140px; border-radius:50%;
  background: radial-gradient(circle, rgba(255,255,255,0.25), transparent 70%); }
.bal .k { opacity: .9; font-size: var(--fs-sm); }
.bal .v { font-family: var(--font-num); font-size: var(--fs-3xl); font-weight: 700; margin: 2px 0; }
.bal .v small { font-size: var(--fs-md); font-weight: 500; opacity: .85; margin-left: 6px; }
.bal .row2 { display: flex; gap: var(--s5); margin-top: 8px; }
.bal .row2 div .k { font-size: var(--fs-xs); opacity: .85; }
.bal .row2 div .v { font-family: var(--font-num); font-size: var(--fs-lg); font-weight: 700; }

/* ---------- 详情 ---------- */
.detail { padding: var(--s4); }
.detail h1 { font-size: var(--fs-xl); font-weight: 800; margin-bottom: var(--s2); }
.detail .cc { display: flex; gap: var(--s2); align-items: center; color: var(--muted); font-size: var(--fs-sm); margin-bottom: var(--s4); }
.detail .content { white-space: pre-wrap; color: var(--ink-2); line-height: 1.7; }
.detail .media { margin: var(--s4) 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.detail .media img, .detail .media video { width: 100%; border-radius: 12px; }
.detail .seller { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); background: var(--surface); border-radius: var(--r); border: 1px solid var(--line-soft); margin: var(--s4) 0; }
.detail .seller .av { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-3); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.detail .seller .nm { font-weight: 700; }
.detail .seller .meta { color: var(--muted); font-size: var(--fs-xs); }
.detail .acts { display: flex; gap: var(--s3); margin-top: var(--s4); }

/* ---------- 聊天 ---------- */
.conv { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); background: var(--surface);
  border-bottom: 1px solid var(--line-soft); }
.conv .av { width: 42px; height: 42px; border-radius: 50%; background: var(--surface-3); display: flex; align-items: center; justify-content: center; font-size: 19px; }
.conv .nm { font-weight: 700; }
.conv .last { color: var(--muted); font-size: var(--fs-xs); }
.chatbox { height: calc(100vh - 220px); overflow-y: auto; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.msg { max-width: 76%; padding: 10px 13px; border-radius: 16px; font-size: var(--fs-md); line-height: 1.5; }
.msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.them { align-self: flex-start; background: var(--surface); border: 1px solid var(--line-soft); border-bottom-left-radius: 4px; }
.composer { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 460px;
  display: flex; gap: var(--s2); padding: 10px var(--s4) calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,0.95); backdrop-filter: blur(12px); border-top: 1px solid var(--line-soft); }
.composer input { flex: 1; height: 44px; border-radius: var(--r-pill); border: 1.5px solid var(--line); padding: 0 16px; background: var(--bg-1); }
.composer .send { width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 18px; }

/* ---------- 杂项 ---------- */
.empty { text-align: center; color: var(--muted); padding: 40px var(--s4); }
.center-screen { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: var(--s5); }
.logo { font-family: var(--font-serif); font-size: 34px; font-weight: 800; color: var(--brand); text-align: center; margin-bottom: 4px; }
.logo-sub { text-align: center; color: var(--muted); margin-bottom: var(--s6); font-size: var(--fs-sm); }
.toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 50;
  background: rgba(42,36,16,0.92); color: #fff; padding: 10px 16px; border-radius: var(--r-pill);
  font-size: var(--fs-sm); box-shadow: var(--sh-3); max-width: 90%; text-align: center; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--brand); font-weight: 600; margin-bottom: var(--s2); }
.muted { color: var(--muted); }
.divider { height: 1px; background: var(--line-soft); margin: var(--s3) 0; }
