:root {
  --bg: #f4eddf;
  --card: #ece3d1;
  --card-border: #d8cab0;
  --text: #4a3b28;
  --muted: #8a7a62;
  --tag: #ddd2bc;
  --gold-1: #f7d977;
  --gold-2: #e5ae37;
  --gold-text: #5a3d0c;
  --price: #c4561c;
  --lead: #e5ae37;
  --danger: #c0392b;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[v-cloak] { display: none; }

html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }

/* ---------- 通用控件 ---------- */
.btn {
  border: 1px solid #c99a2e;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  color: var(--gold-text);
  font-weight: 600;
  border-radius: 6px;
  padding: 0 12px;
  height: 34px;
  white-space: nowrap;
  cursor: pointer;
}
.btn:active { filter: brightness(.95); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.plain { background: #f8f3e8; border-color: var(--card-border); color: var(--text); font-weight: 400; }
.btn.block { width: 100%; height: 42px; font-size: 16px; }

.input {
  border: 1px solid #cdbd9e;
  background: #fbf7ef;
  border-radius: 6px;
  height: 34px;
  padding: 0 10px;
  outline: none;
  min-width: 0;
}
.input:focus { border-color: var(--gold-2); box-shadow: 0 0 0 2px rgba(229, 174, 55, .2); }

.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; }

#toast {
  position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%);
  background: rgba(40, 32, 20, .88); color: #fff; padding: 10px 16px; border-radius: 8px;
  font-size: 14px; max-width: 80vw; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 100;
}
#toast.show { opacity: 1; }

/* ---------- 顶部 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--card-border);
  padding: 8px 12px 6px;
}
.topbar .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.topbar .alliance { font-weight: 700; font-size: 16px; }
.topbar .date {
  border: 1px solid var(--card-border); background: #f8f3e8; border-radius: 14px;
  height: 28px; padding: 0 10px; font-size: 13px;
}
.topbar .summary {
  margin-top: 6px; font-size: 13px; background: var(--card);
  border: 1px solid var(--card-border); border-radius: 6px; padding: 4px 8px;
  display: flex; justify-content: space-between; align-items: center;
}
.summary b { color: var(--price); font-size: 15px; }
.summary .me { background: none; border: 0; color: var(--muted); padding: 0; cursor: pointer; }

/* ---------- 物品卡片 ---------- */
.list { padding: 8px 10px 40px; max-width: 640px; margin: 0 auto; }
.card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--card-border);
  border-radius: 8px;
  padding: 8px 8px 8px 6px;
  margin-bottom: 8px;
}
.card.lead { border-left-color: var(--lead); }
.card.closed { opacity: .65; }
.card .thumb {
  width: 56px; height: 56px; border-radius: 8px; object-fit: cover;
  background: #d9cdb5; border: 1px solid rgba(0, 0, 0, .08);
}
.card .info { min-width: 0; }
.card .name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag { background: var(--tag); border-radius: 4px; padding: 0 6px; font-size: 12px; line-height: 20px; color: #6b5a40; }
.tag.qty { background: #f3dfa5; color: var(--gold-text); font-weight: 600; }

.card .side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.card .top { font-size: 14px; min-height: 20px; white-space: nowrap; transition: background .3s; border-radius: 4px; padding: 0 4px; }
.card .top .who { color: var(--text); margin-right: 4px; max-width: 6em; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }
.card .top .amount { color: var(--price); font-weight: 700; font-size: 16px; }
.card .top .none { color: var(--price); font-weight: 700; }
.card .top.flash { background: #ffe39a; }
.card .bid { display: flex; gap: 6px; }
.card .bid .input { width: 78px; height: 32px; }
.card .bid .btn { height: 32px; padding: 0 10px; font-size: 13px; }

.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* ---------- 状态页 / 登录页 ---------- */
.panel {
  max-width: 380px; margin: 12vh auto 0; padding: 24px 20px;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 12px;
}
.panel h1 { margin: 0 0 4px; font-size: 22px; text-align: center; }
.panel .sub { text-align: center; color: var(--muted); margin-bottom: 18px; }
.panel .field { margin-bottom: 12px; }
.panel .field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.panel .field .input { width: 100%; height: 40px; font-size: 15px; }
.panel .row { display: flex; gap: 8px; }
.panel .row .input { flex: 1; }
.panel .foot { margin-top: 14px; display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }

.tabs { display: flex; background: #e2d7c1; border-radius: 8px; padding: 3px; margin-bottom: 16px; }
.tabs button {
  flex: 1; border: 0; background: none; height: 34px; border-radius: 6px; cursor: pointer; color: var(--muted);
}
.tabs button.on { background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); color: var(--gold-text); font-weight: 600; }

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.dialog { background: var(--bg); border-radius: 12px; padding: 18px; width: 100%; max-width: 340px; }
.dialog h3 { margin: 0 0 12px; font-size: 16px; }
.dialog .input { width: 100%; height: 40px; }
.dialog .actions { display: flex; gap: 8px; margin-top: 14px; }
.dialog .actions .btn { flex: 1; height: 38px; }

@media (max-width: 360px) {
  .card { grid-template-columns: 48px 1fr auto; gap: 8px; }
  .card .thumb { width: 48px; height: 48px; }
  .card .bid .input { width: 64px; }
}
