:root {
  --brand: #FF5A3C;
  --brand-2: #FF8A50;
  --brand-deep: #F04A2F;
  --bg: #F5F6F8;
  --card: #ffffff;
  --text: #222;
  --text-2: #666;
  --text-3: #999;
  --line: #EEEEF0;
  --green: #16B364;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(120deg, var(--brand-2), var(--brand));
  color: #fff;
  padding: 10px 16px 12px;
  box-shadow: 0 2px 10px rgba(255, 90, 60, .25);
}
.topbar-inner { display: flex; align-items: center; gap: 10px; }
.logo { width: 34px; height: 34px; border-radius: 10px; }
.site-title { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.site-name { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.site-sub { font-size: 11px; opacity: .92; }
.icon-btn {
  background: rgba(255,255,255,.22); border: none; color: #fff;
  width: 36px; height: 36px; border-radius: 10px; font-size: 17px; cursor: pointer;
}
.searchbar { display: flex; gap: 8px; margin-top: 10px; }
.searchbar input {
  flex: 1; border: none; border-radius: 12px; padding: 10px 14px; font-size: 15px; outline: none;
}
.btn-search {
  background: #fff; color: var(--brand); border: none; border-radius: 12px;
  padding: 0 16px; font-size: 15px; font-weight: 600; cursor: pointer;
}

/* ---------- 主内容 ---------- */
main { max-width: 640px; margin: 0 auto; padding: 12px 12px 84px; }

/* 筛选 tab */
.tabs {
  display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 2px;
}
.tabs button {
  flex-shrink: 0; border: 1px solid var(--line); background: #fff; color: var(--text-2);
  border-radius: 20px; padding: 7px 16px; font-size: 14px; cursor: pointer;
}
.tabs button.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.tabs .sep { flex: 1; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chips .chip {
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  border-radius: 16px; padding: 5px 12px; font-size: 13px; cursor: pointer;
}
.chips .chip.active { background: #FFF0EB; border-color: var(--brand); color: var(--brand); }

/* 物品卡片 */
.card {
  background: var(--card); border-radius: var(--radius); padding: 12px;
  margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.05);
  display: flex; gap: 12px; cursor: pointer;
}
.card .thumb {
  width: 84px; height: 84px; border-radius: 12px; background: #F2E3DA;
  flex-shrink: 0; object-fit: cover; display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: #D8B39A; overflow: hidden;
}
.card .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card .row1 { display: flex; align-items: center; gap: 6px; }
.badge {
  font-size: 11px; padding: 2px 8px; border-radius: 6px; font-weight: 600; flex-shrink: 0;
}
.badge.lost { background: #FFE3DC; color: #F04A2F; }
.badge.found { background: #DFF6EA; color: #16B364; }
.badge.resolved { background: #ECECF0; color: #8A8A94; }
.tag { font-size: 11px; color: var(--text-3); background: #F4F4F6; border-radius: 6px; padding: 2px 8px; }
.card .title { font-size: 16px; font-weight: 600; margin: 4px 0 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .desc { font-size: 13px; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--text-3);
  display: flex; gap: 10px; align-items: center; }

/* 空状态 / 加载 */
.empty { text-align: center; color: var(--text-3); padding: 60px 0; }
.empty .big { font-size: 48px; }
.loadmore { text-align: center; color: var(--text-3); font-size: 13px; padding: 12px; }

/* ---------- ICP 备案页脚 ---------- */
.icp-footer { text-align: center; padding: 18px 12px 70px; font-size: 12px; color: var(--text-3); }
.icp-footer a { color: var(--text-3); text-decoration: none; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: #fff; border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  max-width: 640px; margin: 0 auto;
}
.tab { background: none; border: none; color: var(--text-3); font-size: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; padding: 4px 20px; }
.tab span { font-size: 11px; }
.tab.active { color: var(--brand); font-weight: 600; }
.fab-wrap { color: var(--brand); }

/* ---------- 表单 ---------- */
.form-card { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
  font-size: 15px; outline: none; background: #FAFAFB; font-family: inherit;
}
.field input:focus, .field textarea:focus { border-color: var(--brand); background: #fff; }
.field textarea { resize: vertical; min-height: 90px; }
.seg { display: flex; background: #F2F3F5; border-radius: 12px; padding: 4px; }
.seg button { flex: 1; border: none; background: none; padding: 10px; border-radius: 9px;
  font-size: 15px; color: var(--text-2); cursor: pointer; font-weight: 600; }
.seg button.active { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.upload-cell { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #FAFAFB; }
.upload-cell img { width: 100%; height: 100%; object-fit: cover; }
.upload-cell .del {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; border: none; font-size: 12px; cursor: pointer; line-height: 1;
}
.upload-add {
  aspect-ratio: 1; border: 1.5px dashed #D5D5DB; border-radius: 10px; background: #FAFAFB;
  color: var(--text-3); font-size: 28px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}

.btn {
  display: block; width: 100%; border: none; border-radius: 12px; padding: 13px;
  font-size: 16px; font-weight: 700; cursor: pointer; background: linear-gradient(120deg, var(--brand-2), var(--brand));
  color: #fff; text-align: center;
}
.btn:disabled { opacity: .6; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }

/* ---------- 详情页 ---------- */
.swiper { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; }
.swiper img { width: 100%; height: 240px; object-fit: cover; display: block; }
.swiper .dots { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; display: flex; gap: 5px; justify-content: center; }
.swiper .dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.5); }
.swiper .dots i.on { background: #fff; width: 16px; border-radius: 3px; }
.no-img { width: 100%; height: 200px; background: linear-gradient(120deg, #FFEADF, #FFD9C9);
  display: flex; align-items: center; justify-content: center; font-size: 56px; color: #E0A98C; }

.detail-card { background: #fff; border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.detail-title { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.info-list { display: flex; flex-direction: column; gap: 10px; }
.info-item { display: flex; align-items: center; font-size: 14px; gap: 10px; }
.info-item .k { color: var(--text-3); width: 62px; flex-shrink: 0; }
.info-item .v { flex: 1; color: var(--text); word-break: break-all; }
.info-item .act { color: var(--brand); font-size: 13px; cursor: pointer; flex-shrink: 0; font-weight: 600; }
.section-title { font-size: 14px; font-weight: 700; color: var(--text-2); margin: 4px 0 8px; }
.desc-text { font-size: 14px; color: var(--text); white-space: pre-wrap; }

.actions { display: flex; gap: 10px; margin-bottom: 12px; }
.actions .btn { flex: 1; }

/* ---------- 登录/注册 ---------- */
.auth-box { background: #fff; border-radius: var(--radius); padding: 24px 20px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.auth-box h2 { margin: 0 0 4px; font-size: 20px; }
.auth-box .sub { color: var(--text-3); font-size: 13px; margin-bottom: 18px; }
.auth-switch { text-align: center; margin-top: 14px; font-size: 13px; color: var(--text-2); }
.auth-switch a { color: var(--brand); font-weight: 600; cursor: pointer; }

/* 个人中心 */
.profile { background: linear-gradient(120deg, var(--brand-2), var(--brand)); border-radius: var(--radius);
  padding: 20px; color: #fff; margin-bottom: 12px; display: flex; align-items: center; gap: 14px; }
.avatar { width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center; font-size: 26px; }
.profile .name { font-size: 18px; font-weight: 700; }
.profile .meta { font-size: 12px; opacity: .9; }
.profile .logout { margin-left: auto; background: rgba(255,255,255,.22); border: none; color: #fff;
  border-radius: 9px; padding: 7px 12px; font-size: 13px; cursor: pointer; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-mask[hidden] { display: none; }
.modal-box { background: #fff; border-radius: 18px; padding: 18px; width: 100%; max-width: 380px; }
.modal-box h3 { margin: 0 0 12px; font-size: 17px; text-align: center; }
.modal-box img.share-img { width: 100%; border-radius: 12px; display: block; }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.modal-actions .btn { flex: 1; font-size: 14px; padding: 11px; }
.modal-close { position: absolute; top: 12px; right: 12px; border: none; background: none; font-size: 22px; color: #999; cursor: pointer; }
.modal-inner { position: relative; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%);
  background: rgba(0,0,0,.78); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; z-index: 200; opacity: 0; pointer-events: none; transition: opacity .25s; max-width: 80%; text-align: center; }
.toast.show { opacity: 1; }

@media (min-width: 640px) {
  .tabbar { left: 50%; transform: translateX(-50%); }
}
