/* LoopGiGi A10 切片 2 — 刊登／搜尋版面樣式 (mobile-first)
   換皮批 (2026-11-11)：跟已批准嘅 redesign mock 視覺系統 — 暖紙底
   #FAF7F1、白卡、Archivo 字標、價錢行先、4:3 相片卡；品牌粉紅
   #D62598 不變。㩒掣最少 48px 高、輸入字體 16px（避免 iOS 自動
   放大）等 A14 合約尺寸一律保留。 */
:root {
  --brand: #d62598;
  --brand-dark: #b1187c;
  --brand-soft: #fbe3f1;
  --ink: #26221f;
  --muted: #857c74;
  --line: #eae2d8;
  --bg: #faf7f1;
  --card: #fff;
  --ph: #f3e9e2;
  --danger: #c0392b;
  --ok: #1e8449;
  --gold: #f5a623;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Archivo", "Noto Sans TC", -apple-system, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.wrap { max-width: 960px; margin: 0 auto; padding: 12px 16px 56px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0 8px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 20;
  background: rgba(250, 247, 241, 0.92); backdrop-filter: blur(8px);
}
.logo { font-size: 25px; font-weight: 800; letter-spacing: -0.5px; text-decoration: none; }
.logo .lg-loop { color: var(--ink); }
.logo .lg-gigi { color: var(--brand); }
.logo .lg-com { color: var(--muted); font-size: 13px; font-weight: 600; margin-left: 2px; letter-spacing: 0; }
.badge {
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 700;
  border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}
.langs { display: flex; gap: 6px; }
.langs button {
  min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; font-size: 14px; cursor: pointer;
}
.langs button[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); font-weight: 700; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.nav a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px;
  border-radius: 999px; background: #fff; border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px;
}
.nav a.current { background: var(--brand); color: #fff; border-color: var(--brand); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 18px; margin-top: 14px;
  box-shadow: 0 6px 24px rgba(38, 34, 31, 0.05);
}
h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; margin: 0 0 6px; }
p { line-height: 1.55; }
.hint { color: var(--muted); font-size: 14px; margin-top: 4px; }
.foot { color: var(--muted); font-size: 14px; text-align: center; margin-top: 28px; }

/* ---- 搜尋列（膠囊） ---- */
.searchbar {
  display: flex; gap: 8px; align-items: center;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 5px;
}
.searchbar:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.searchbar input[type="search"] {
  flex: 1; min-height: 52px; font-size: 16px; padding: 10px 14px;
  border: 0; border-radius: 999px; background: transparent; min-width: 0;
}
.searchbar input[type="search"]:focus { outline: none; }
.searchbar button {
  min-height: 52px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
  white-space: nowrap;
}
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.filters .full { grid-column: 1 / -1; }
.filters label { font-size: 13px; color: var(--muted); font-weight: 700; }
label { display: block; font-weight: 600; margin: 0 0 6px; font-size: 15px; }
select, input[type="text"], input[type="number"], textarea {
  width: 100%; min-height: 48px; font-size: 16px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
select:focus, input:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }

/* ---- 刊登卡（直式：相片 4:3 在上、價錢行先） ---- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr 1fr; } }
@media (min-width: 1024px) { .grid { grid-template-columns: 1fr 1fr 1fr 1fr; } }
.lcard {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 0; overflow: hidden;
  text-decoration: none; color: var(--ink);
  box-shadow: 0 4px 16px rgba(38, 34, 31, 0.05);
}
.lcard .thumb { width: 100%; height: auto; aspect-ratio: 4 / 3; flex: none; border-radius: 0; object-fit: cover; background: var(--ph); display: block; }
.lcard .nophoto {
  width: 100%; aspect-ratio: 4 / 3; flex: none; border-radius: 0; background: var(--ph);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; text-align: center; padding: 6px;
}
.lcard .body { min-width: 0; flex: 1; padding: 12px 13px 14px; }
.lcard .price { font-size: 18px; font-weight: 800; color: var(--brand); }
.lcard .price.free { color: var(--ok); }
.lcard .title { font-size: 15px; font-weight: 600; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lcard .cardcat { font-size: 13px; font-weight: 700; color: var(--brand-dark); margin-top: 3px; }
.lcard .meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.pill {
  display: inline-block; font-size: 11px; font-weight: 800; border-radius: 999px;
  padding: 2px 8px; margin-left: 6px; vertical-align: 2px;
}
.pill.featured { background: #fff3d6; color: #9a6200; }
.pill.free { background: var(--ok); color: #fff; }
.pill.neg { background: #eef; color: #335; }
/* 卡上徽章改疊喺相片左上角（直式卡）；Featured + 免費同時有就上下排 */
.lcard .pill { position: absolute; top: 10px; left: 10px; margin-left: 0; box-shadow: 0 2px 8px rgba(38, 34, 31, 0.18); }
.lcard .pill.featured ~ .pill.free { top: 42px; }
.btn {
  display: block; width: 100%; min-height: 52px; margin-top: 16px;
  border: 0; border-radius: 14px; background: var(--brand); color: #fff;
  font-size: 17px; font-weight: 700; cursor: pointer;
}
.btn:active { background: var(--brand-dark); }
.btn.secondary { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.danger { background: #fff; color: var(--danger); border: 1.5px solid var(--danger); }
.btn.small {
  display: inline-flex; align-items: center; width: auto; min-height: 40px; margin-top: 0;
  padding: 6px 14px; border-radius: 999px; font-size: 14px;
}
.btn:disabled { opacity: 0.55; cursor: default; }
.error { color: var(--danger); font-weight: 600; margin-top: 10px; min-height: 20px; }
.okmsg { color: var(--ok); font-weight: 700; margin-top: 10px; }

/* ---- 表單 ---- */
.field { margin-top: 14px; }
fieldset { border: 0; padding: 0; margin: 14px 0 0; }
fieldset legend { font-weight: 600; margin-bottom: 6px; }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row label {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 500; margin: 0;
  border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 14px; min-height: 44px; cursor: pointer; background: #fff;
}
.radio-row input { accent-color: var(--brand); }
.photos { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.photo-slot { position: relative; width: 96px; height: 96px; }
.photo-slot img { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; }
.photo-slot .tag {
  position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,0.65); color: #fff;
  font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 8px;
}
.photo-slot .busy {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.75); border-radius: 12px; font-size: 13px; color: var(--muted);
}
.addphoto {
  width: 96px; height: 96px; border: 1.5px dashed var(--brand); border-radius: 12px;
  background: #fff; color: var(--brand); font-weight: 700; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 6px;
}

/* ---- 詳情 ---- */
.gallery { margin-top: 14px; }
.gallery .main { width: 100%; border-radius: 16px; background: var(--ph); }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.gallery .thumbs img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; cursor: pointer; border: 2px solid transparent; }
.gallery .thumbs img.sel { border-color: var(--brand); }
.detail-price { font-size: 26px; font-weight: 800; color: var(--brand); }
.detail-price.free { color: var(--ok); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin-top: 12px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

/* ---- 收藏掣 (A8 第一件) ---- */
.favbtn {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 40px; height: 40px; border-radius: 999px;
  border: 1.5px solid var(--line); background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(38, 34, 31, 0.12);
  font-size: 19px; line-height: 1; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.favbtn.on { color: var(--brand); border-color: var(--brand); }
.favbtn:disabled { opacity: 0.5; cursor: default; }
#favBtn.saved { background: var(--brand); color: #fff; border-color: var(--brand); }
.favmsg a { color: var(--brand); font-weight: 700; margin-left: 6px; }

/* ---- 我的刊登／我的收藏 ---- */
.mrow { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.mrow:first-of-type { border-top: 0; }
.mrow img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--ph); }
.mthumb { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 10px; object-fit: cover; background: var(--ph); }
.mthumb.nophoto {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; text-align: center; padding: 4px;
}
.mrow-main { flex: 1; min-width: 0; }
.mtitle { font-weight: 600; }
.mrow-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.mrow .grow { flex: 1; min-width: 0; }
.mrow .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.mrow .acts button, .mrow .acts a {
  min-height: 40px; padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600;
  border: 1.5px solid var(--brand); background: #fff; color: var(--brand); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center;
}
.mrow .acts button.danger { border-color: var(--danger); color: var(--danger); }
.status { font-size: 12px; font-weight: 800; border-radius: 999px; padding: 2px 8px; background: #f1eae1; color: #555; }
.status.active { background: #e2f4e9; color: var(--ok); }
.status.sold { background: #fdeeda; color: #9a6200; }

/* ---- 儲存搜尋＋提示 v1 (A8 第二件) ---- */
.newbadge {
  display: inline-block; background: var(--brand); color: #fff;
  font-size: 12px; font-weight: 800; border-radius: 999px;
  padding: 2px 9px; margin-left: 8px; vertical-align: 2px; white-space: nowrap;
}
#saveSearchBtn { margin-top: 12px; }
