/* ============ 跳蚤市集 · 设计令牌 ============ */
:root {
  --bg: #f6f4ee;
  --bg-2: #efece4;
  --card: #ffffff;
  --ink: #24211b;
  --ink-2: #6e675c;
  --ink-3: #a59d8f;
  --line: #e7e2d8;
  --accent: #e8622c;
  --accent-deep: #c94e1d;
  --accent-soft: #fdeee5;
  --xianyu: #ffe601;
  --xianyu-ink: #221f00;
  --green: #2f9e44;
  --green-soft: #e6f4ea;
  --amber: #f5a623;
  --amber-bg: #fff7e0;
  --amber-ink: #8a5a00;
  --danger: #d9480f;
  --danger-soft: #fdecea;
  --radius: 14px;
  --radius-s: 9px;
  --shadow: 0 1px 2px rgba(36,33,27,.05), 0 6px 20px rgba(36,33,27,.07);
  --shadow-hover: 0 2px 6px rgba(36,33,27,.08), 0 12px 32px rgba(36,33,27,.12);
  --topbar-h: 60px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17150f;
    --bg-2: #1e1b14;
    --card: #232019;
    --ink: #ece7dc;
    --ink-2: #a89f8f;
    --ink-3: #6f675a;
    --line: #353024;
    --accent: #ff7a3d;
    --accent-deep: #ff9a66;
    --accent-soft: #3a2415;
    --green: #51cf66;
    --green-soft: #1d2b1f;
    --amber-bg: #2e2410;
    --amber-ink: #ffd27a;
    --danger: #ff6b4a;
    --danger-soft: #37170f;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.35);
    --shadow-hover: 0 2px 6px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: var(--ink); }
img { display: block; }
::selection { background: var(--accent-soft); }
h1,h2,h3,h4 { margin: 0; font-weight: 700; }

/* ============ 顶栏 ============ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 800; letter-spacing: .5px; white-space: nowrap; }
.logo .mark { font-size: 24px; }
.logo .slogan { font-size: 11px; font-weight: 500; color: var(--ink-3); margin-left: 2px; align-self: flex-end; padding-bottom: 3px; }
.searchwrap { flex: 1; max-width: 460px; position: relative; }
.searchwrap input {
  width: 100%; height: 38px; border-radius: 19px; border: 1px solid var(--line);
  background: var(--card); padding: 0 40px 0 38px; outline: none; transition: border-color .15s;
}
.searchwrap input:focus { border-color: var(--accent); }
.searchwrap .icon { position: absolute; left: 13px; top: 9px; color: var(--ink-3); pointer-events: none; }
.searchwrap .clear { position: absolute; right: 8px; top: 7px; width: 24px; height: 24px; border-radius: 50%; color: var(--ink-3); display: none; align-items: center; justify-content: center; }
.searchwrap .clear.show { display: flex; }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: 19px; font-weight: 600; font-size: 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  transition: transform .12s, box-shadow .15s, background .15s, border-color .15s;
  white-space: nowrap; user-select: none;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn.xianyu { background: var(--xianyu); border-color: var(--xianyu); color: var(--xianyu-ink); font-weight: 700; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { color: var(--ink); background: var(--bg-2); }
.btn.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 15px; }
.btn.lg { height: 44px; padding: 0 22px; font-size: 15px; border-radius: 22px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; font-size: 19px; color: var(--ink-2);
  transition: background .15s;
}
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }
.nav-badge {
  position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg);
}
.top-avatar { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }

/* ============ 主体 ============ */
.main { max-width: 1120px; margin: 0 auto; padding: 18px 16px calc(120px + env(safe-area-inset-bottom)); }
@media (min-width: 860px) { .main { padding-bottom: 48px; } }

/* 公告条 */
.notice-strip {
  display: flex; align-items: center; gap: 10px;
  background: var(--amber-bg); color: var(--amber-ink);
  border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px;
}
.notice-strip .txt { flex: 1; min-width: 0; }
.notice-strip b { font-weight: 700; }
.notice-strip .x { color: inherit; opacity: .6; font-size: 16px; padding: 2px 6px; border-radius: 6px; }
.notice-strip .x:hover { opacity: 1; background: rgba(0,0,0,.06); }

/* 分类 chips */
.cats {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 34px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 34px), transparent 100%);
}
.cats.at-end { -webkit-mask-image: none; mask-image: none; }
.cats::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; height: 34px; padding: 0 14px; border-radius: 17px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  font-size: 13.5px; font-weight: 500; transition: all .15s; white-space: nowrap;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 700; }

.feedbar { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; }
.feedbar .count { color: var(--ink-3); font-size: 13px; }
.feedbar select {
  margin-left: auto; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); padding: 0 8px; outline: none; font-size: 13.5px; color: var(--ink-2);
}

/* ============ 信息流卡片 ============ */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .16s, box-shadow .2s; position: relative;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card:active { transform: translateY(-1px); }
.card-cover { position: relative; aspect-ratio: 1/1; background: var(--bg-2); overflow: hidden; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-cover .ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 54px; }
.card-cover .sold-mask, .card-cover .off-mask {
  position: absolute; inset: 0; background: rgba(20,18,14,.45); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; letter-spacing: 6px;
}
.tagline { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 6px; }
.mini-tag {
  background: rgba(20,18,14,.55); color: #fff; backdrop-filter: blur(4px);
  font-size: 11px; padding: 2px 8px; border-radius: 9px; font-weight: 500;
}
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card-title {
  font-size: 14.5px; font-weight: 600; line-height: 1.45; min-height: 2.9em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-all;
}
.card-title mark { background: linear-gradient(transparent 55%, color-mix(in srgb, var(--xianyu) 75%, transparent) 55%); color: inherit; padding: 0 1px; }
.card-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.card-meta { color: var(--ink-3); font-size: 12px; display: flex; gap: 8px; align-items: center; min-width: 0; }
.card-meta .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price { color: var(--accent); font-weight: 800; font-size: 17px; white-space: nowrap; }
.price .rmb { font-size: 12px; font-weight: 700; margin-right: 1px; }
.price .mode { font-size: 11px; font-weight: 600; color: var(--ink-3); margin-left: 3px; }
.price.free { color: var(--green); }

/* 骨架屏 */
.skel { border-radius: var(--radius); overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.skel .a { aspect-ratio: 1/1; }
.skel .b { height: 14px; margin: 12px; border-radius: 7px; width: 85%; }
.skel .c { height: 14px; margin: 0 12px 14px; border-radius: 7px; width: 45%; }
.skel .a, .skel .b, .skel .c {
  background: linear-gradient(100deg, var(--bg-2) 40%, color-mix(in srgb, var(--bg-2) 55%, var(--card)) 50%, var(--bg-2) 60%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.sentinel { height: 10px; }
.load-end { text-align: center; color: var(--ink-3); font-size: 13px; padding: 18px 0 8px; }

/* 空状态 */
.empty { text-align: center; padding: 64px 20px; color: var(--ink-3); }
.empty .e { font-size: 52px; margin-bottom: 10px; }
.empty .t { font-size: 16px; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; }
.empty .s { font-size: 13.5px; margin-bottom: 18px; }

/* ============ 详情页 ============ */
.detail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; } }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.gallery { position: relative; overflow: hidden; border-radius: var(--radius); }
.g-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--radius); }
.g-track::-webkit-scrollbar { display: none; }
.g-item { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 1/1; background: var(--bg-2); }
.g-item img { width: 100%; height: 100%; object-fit: contain; background: var(--bg-2); }
.g-item .ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 110px; }
.g-dots { display: flex; gap: 6px; justify-content: center; padding: 10px 0 2px; }
.g-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--line); transition: all .2s; }
.g-dots i.on { width: 18px; background: var(--accent); }
.g-count { position: absolute; right: 10px; top: 10px; background: rgba(20,18,14,.55); color: #fff; font-size: 12px; padding: 2px 9px; border-radius: 10px; backdrop-filter: blur(4px); }

.d-info { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.d-title { font-size: 20px; line-height: 1.45; word-break: break-all; }
.d-price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.d-price { font-size: 30px; font-weight: 800; color: var(--accent); }
.d-price .rmb { font-size: 16px; }
.d-price.free { color: var(--green); }
.d-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.d-tag { font-size: 12px; color: var(--ink-2); background: var(--bg-2); padding: 3px 10px; border-radius: 8px; }
.d-desc { color: var(--ink-2); font-size: 14.5px; white-space: pre-wrap; word-break: break-all; min-height: 20px; }
.d-meta { color: var(--ink-3); font-size: 12.5px; display: flex; gap: 14px; flex-wrap: wrap; }

.seller-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); cursor: pointer; transition: border-color .15s; }
.seller-row:hover { border-color: var(--ink-3); }
.seller-row .who { flex: 1; min-width: 0; }
.seller-row .nm { font-weight: 700; font-size: 14px; }
.seller-row .bio { color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seller-row .go { color: var(--ink-3); }
.avatar { border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; user-select: none; }
.avatar.anon { background: var(--ink-3) !important; }

.d-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.d-actions .btn { flex: 1; min-width: 120px; }

/* 风险提示 */
.risk-box {
  background: var(--amber-bg); border-radius: var(--radius-s); padding: 12px 14px;
  font-size: 13px; color: var(--amber-ink); line-height: 1.7;
  border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent);
}
.risk-box .rt { font-weight: 800; display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.risk-box ul { margin: 4px 0 0; padding-left: 18px; }
.risk-box a { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* 评论 */
.cmts { margin-top: 22px; padding: 18px 20px; }
.cmts h3 { font-size: 16px; margin-bottom: 14px; display: flex; gap: 6px; align-items: baseline; }
.cmts h3 .n { color: var(--ink-3); font-size: 13px; font-weight: 500; }
.cmt { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.cmt .body { flex: 1; min-width: 0; }
.cmt .who { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.cmt .who .owner-tag { background: var(--accent-soft); color: var(--accent); font-size: 11px; padding: 0 6px; border-radius: 6px; font-weight: 700; }
.cmt .txt { margin-top: 2px; font-size: 14.5px; word-break: break-all; white-space: pre-wrap; }
.cmt-input { display: flex; gap: 10px; margin-top: 14px; align-items: flex-end; }
.cmt-input .field { flex: 1; }
.cmt-input textarea {
  width: 100%; min-height: 42px; max-height: 120px; resize: none; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-2); padding: 9px 12px; outline: none;
}
.cmt-input textarea:focus { border-color: var(--accent); background: var(--card); }
.cmt-input .anon { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-3); cursor: pointer; user-select: none; padding-bottom: 9px; white-space: nowrap; }

/* 开关 */
.switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; background: var(--line); border-radius: 12px; transition: background .18s; }
.switch .dot { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .18s; }
.switch input:checked ~ .track { background: var(--accent); }
.switch input:checked ~ .dot { left: 21px; }

/* ============ 表单 ============ */
.form-card { max-width: 640px; margin: 0 auto; padding: 24px; }
.form-card h2 { font-size: 20px; margin-bottom: 18px; }
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.field .req { color: var(--danger); }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field input[type=url], .field textarea, .field select {
  width: 100%; height: 42px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card); padding: 0 12px; outline: none; transition: border-color .15s;
}
.field textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.price-row { display: flex; gap: 10px; }
.price-row .mode-pick { display: flex; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; flex: 0 0 auto; }
.price-row .mode-pick button { padding: 0 14px; font-size: 13.5px; color: var(--ink-2); border-right: 1px solid var(--line); }
.price-row .mode-pick button:last-child { border-right: none; }
.price-row .mode-pick button.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.price-row input { flex: 1; }
.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form-row2 { grid-template-columns: 1fr; } }

.img-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.img-item { position: relative; width: 86px; height: 86px; border-radius: 11px; overflow: hidden; background: var(--bg-2); }
.img-item img { width: 100%; height: 100%; object-fit: cover; }
.img-item .rm {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center;
}
.img-add {
  width: 86px; height: 86px; border-radius: 11px; border: 1.5px dashed var(--ink-3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-3); font-size: 12px; transition: all .15s; cursor: pointer;
}
.img-add:hover { border-color: var(--accent); color: var(--accent); }
.img-add .plus { font-size: 24px; line-height: 1; }
.ack-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); background: var(--amber-bg); padding: 10px 12px; border-radius: 11px; }
.ack-row input { margin-top: 3px; accent-color: var(--accent); }
.ack-row a { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ============ 消息 ============ */
.chat-wrap { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 16px; min-height: calc(100vh - var(--topbar-h) - 120px); }
@media (max-width: 860px) { .chat-wrap { grid-template-columns: 1fr; } }
.conv-list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow-y: auto; max-height: calc(100vh - var(--topbar-h) - 130px); }
@media (max-width: 860px) { .conv-list.has-panel { display: none; } .conv-list { max-height: none; min-height: 50vh; } }
.conv-item { display: flex; gap: 10px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--line); transition: background .12s; position: relative; }
.conv-item:last-child { border-bottom: none; }
.conv-item:hover { background: var(--bg-2); }
.conv-item.on { background: var(--accent-soft); }
.conv-item .info { flex: 1; min-width: 0; }
.conv-item .r1 { display: flex; gap: 8px; align-items: baseline; }
.conv-item .nm { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item .tm { margin-left: auto; color: var(--ink-3); font-size: 11.5px; flex: 0 0 auto; }
.conv-item .r2 { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.conv-item .last { color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.conv-item .unread { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }

.chat-panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 420px; max-height: calc(100vh - var(--topbar-h) - 130px); }
@media (max-width: 860px) { .chat-panel { display: none; min-height: calc(100vh - var(--topbar-h) - 90px); max-height: none; } .chat-panel.show { display: flex; position: fixed; inset: var(--topbar-h) 0 calc(57px + env(safe-area-inset-bottom)) 0; border-radius: 0; z-index: 40; max-height: none; } }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head .back { display: none; }
@media (max-width: 860px) { .chat-head .back { display: flex; } }
.chat-head .t { flex: 1; min-width: 0; }
.chat-head .who { font-weight: 800; font-size: 15px; }
.chat-head .item-link { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.chat-head .item-link:hover { color: var(--accent); }
.chat-safe {
  margin: 10px 14px 0; padding: 8px 12px; border-radius: 10px; font-size: 12.5px;
  background: var(--amber-bg); color: var(--amber-ink); display: flex; gap: 6px; align-items: center; line-height: 1.55;
}
.chat-safe a { color: var(--accent); font-weight: 700; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.bubbles { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.day-sep { text-align: center; color: var(--ink-3); font-size: 11.5px; margin: 4px 0; }
.bubble-row { display: flex; gap: 8px; align-items: flex-end; }
.bubble-row.mine { flex-direction: row-reverse; }
.bubble {
  max-width: min(72%, 420px); padding: 8px 13px; border-radius: 16px; font-size: 14.5px;
  background: var(--bg-2); color: var(--ink); word-break: break-all; white-space: pre-wrap;
  border-bottom-left-radius: 5px; box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.bubble-row.mine .bubble { background: var(--accent); color: #fff; border-bottom-left-radius: 16px; border-bottom-right-radius: 5px; }
.bubble .tm { display: block; font-size: 10.5px; opacity: .55; margin-top: 3px; text-align: right; }
.quick-chips { display: flex; gap: 8px; padding: 0 14px 8px; overflow-x: auto; scrollbar-width: none; }
.quick-chips::-webkit-scrollbar { display: none; }
.quick-chips .qc {
  flex: 0 0 auto; font-size: 12.5px; color: var(--ink-2); border: 1px solid var(--line);
  padding: 4px 12px; border-radius: 14px; background: var(--bg); transition: all .15s;
}
.quick-chips .qc:hover { color: var(--accent); border-color: var(--accent); }
.chat-input { display: flex; gap: 10px; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.chat-input textarea {
  flex: 1; min-height: 40px; max-height: 110px; resize: none; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-2); padding: 8px 12px; outline: none;
}
.chat-input textarea:focus { border-color: var(--accent); background: var(--card); }
.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; }

/* ============ 个人页 ============ */
.profile-head { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.profile-head .who { flex: 1; min-width: 180px; }
.profile-head .nm { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.profile-head .mail { color: var(--ink-3); font-size: 12.5px; margin-top: 1px; }
.profile-head .bio { color: var(--ink-2); font-size: 13.5px; margin-top: 6px; }
.profile-head .edit-hint { color: var(--ink-3); font-size: 12px; cursor: pointer; }
.profile-head .edit-hint:hover { color: var(--accent); }
.stats { display: flex; gap: 26px; margin-left: auto; }
.stat { text-align: center; }
.stat .n { font-size: 20px; font-weight: 800; color: var(--accent); }
.stat .l { font-size: 12px; color: var(--ink-3); }
.tabs { display: flex; gap: 4px; margin: 18px 0 14px; border-bottom: 1px solid var(--line); }
.tab { padding: 9px 16px; font-size: 14.5px; font-weight: 600; color: var(--ink-3); border-bottom: 2.5px solid transparent; margin-bottom: -1px; transition: color .15s; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--accent); border-color: var(--accent); }
.list-rows { display: flex; flex-direction: column; gap: 10px; }
.row-card { display: flex; gap: 12px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; align-items: center; cursor: pointer; transition: transform .14s; }
.row-card:hover { transform: translateY(-2px); }
.row-card .thumb { width: 74px; height: 74px; border-radius: 10px; overflow: hidden; background: var(--bg-2); flex: 0 0 auto; position: relative; }
.row-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-card .thumb .ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 30px; }
.row-card .mid { flex: 1; min-width: 0; }
.row-card .t { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-card .s { color: var(--ink-3); font-size: 12px; margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.row-card .ops { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.st-badge { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 7px; }
.st-badge.active { background: var(--green-soft); color: var(--green); }
.st-badge.sold { background: var(--accent-soft); color: var(--accent); }
.st-badge.off { background: var(--bg-2); color: var(--ink-3); }

/* 用户主页 */
.user-head { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; display: flex; gap: 16px; align-items: center; }
.user-head .nm { font-size: 20px; font-weight: 800; }
.user-head .bio { color: var(--ink-2); font-size: 13.5px; margin-top: 4px; }
.user-head .meta { color: var(--ink-3); font-size: 12px; margin-top: 6px; }

/* ============ 弹层 ============ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(20,17,12,.5);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  animation: fadeIn .16s;
}
.modal {
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow-hover);
  width: 100%; max-width: 400px; padding: 22px; position: relative;
  animation: popIn .18s; max-height: 88vh; overflow-y: auto;
}
.modal.wide { max-width: 560px; }
.modal .close { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%; color: var(--ink-3); display: flex; align-items: center; justify-content: center; font-size: 15px; }
.modal .close:hover { background: var(--bg-2); color: var(--ink); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.mtabs { display: flex; background: var(--bg-2); border-radius: 11px; padding: 3px; margin-bottom: 18px; }
.mtabs button { flex: 1; height: 34px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.mtabs button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; }
.code-row .btn { flex: 0 0 auto; }
.demo-hint { margin-top: 14px; font-size: 12.5px; color: var(--ink-3); text-align: center; line-height: 1.7; }
.demo-hint b { color: var(--ink-2); }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 120; background: rgba(10,9,6,.92); display: flex; align-items: center; justify-content: center; cursor: zoom-out; animation: fadeIn .15s; }
.lightbox img { max-width: 94vw; max-height: 94vh; object-fit: contain; border-radius: 8px; }

/* toast */
#toast-root { position: fixed; top: calc(var(--topbar-h) + 12px); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast {
  background: rgba(30,27,20,.92); color: #fff; font-size: 13.5px; padding: 9px 18px; border-radius: 20px;
  box-shadow: var(--shadow-hover); animation: toastIn .2s; max-width: 100%; text-align: center; word-break: break-all;
}
.toast.ok { background: color-mix(in srgb, var(--green) 88%, #000); }
.toast.err { background: color-mix(in srgb, var(--danger) 90%, #000); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

/* ============ 底部导航（移动） ============ */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: none; background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav .inner { display: grid; grid-template-columns: repeat(4, 1fr); }
.bn-item { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0 6px; color: var(--ink-3); font-size: 10.5px; position: relative; }
.bn-item .ic { font-size: 21px; line-height: 1.2; filter: grayscale(1) opacity(.75); transition: filter .15s; }
.bn-item.on { color: var(--accent); }
.bn-item.on .ic { filter: none; }
.bn-item .nav-badge { top: 3px; right: calc(50% - 22px); border-color: var(--card); }
.bn-item.publish .ic { background: var(--accent); color: #fff; width: 40px; height: 40px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; filter: none; margin-top: -8px; box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 45%, transparent); }
@media (max-width: 860px) { .bottomnav { display: block; } }
@media (max-width: 860px) {
  .topbar .searchwrap { display: block; flex: 1; max-width: none; }
  .logo .txt, .logo .slogan { display: none; }
  .top-actions .btn.publish-btn, .top-actions .btn.msg-btn, .top-actions .btn.login-btn { display: none; }
}
@media (min-width: 861px) { .bottomnav { display: none !important; } }

/* 详情页移动端 actionbar */
.m-actionbar {
  position: fixed; left: 0; right: 0; z-index: 45;
  display: none; gap: 8px; padding: 8px 12px;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  bottom: calc(57px + env(safe-area-inset-bottom)); /* 让开底部导航 */
  box-shadow: 0 -4px 16px rgba(36,33,27,.06);
}
@media (max-width: 860px) { .m-actionbar { display: flex; } .m-actionbar .btn { flex: 1; } }
@media (max-width: 860px) { .detail-page .main { padding-bottom: calc(150px + env(safe-area-inset-bottom)); } }

/* 杂项 */
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: rot .7s linear infinite; vertical-align: -3px; }
@keyframes rot { to { transform: rotate(360deg); } }
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.page-head h2 { font-size: 20px; }
.page-head .sub { color: var(--ink-3); font-size: 13px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.footer-note { text-align: center; color: var(--ink-3); font-size: 12px; padding: 28px 0 10px; line-height: 1.9; }

/* 回到顶部 */
.to-top {
  position: fixed; right: 22px; bottom: 90px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-hover);
  font-size: 18px; color: var(--ink-2); z-index: 30;
  opacity: 0; pointer-events: none; transform: translateY(10px); transition: all .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 860px) { .to-top { bottom: calc(150px + env(safe-area-inset-bottom)); right: 14px; } }
