* { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f8f5;
  color: #243b30;
}
#app { max-width: 760px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

header {
  position: sticky; top: 0; z-index: 20;
  background: #2d6a4f; color: #fff;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
header h1 { font-size: 17px; font-weight: 600; flex: 1; }
#btnBack {
  background: rgba(255,255,255,.16); color: #fff;
  border: 1px solid rgba(255,255,255,.35); border-radius: 16px;
  font-size: 14px; padding: 5px 12px; cursor: pointer;
}
#btnBack:hover { background: rgba(255,255,255,.28); }

#crumb {
  padding: 9px 14px 7px; font-size: 13px; color: #4c6f5e;
  background: #eaf3ec; border-bottom: 1px solid #d7e7dc;
  white-space: nowrap; overflow-x: auto;
}
#crumb .ci { cursor: pointer; padding: 2px 4px; }
#crumb .ci:hover { color: #2d6a4f; text-decoration: underline; }
#crumb .sep { margin: 0 2px; color: #9dbcaa; }

main { flex: 1; padding: 14px; }
footer {
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
  font-size: 12px; color: #7d9489; text-align: center;
}

.hero {
  background: #fff; border: 1px solid #dfeae2; border-radius: 10px;
  padding: 14px; font-size: 14px; line-height: 1.7; color: #4c6f5e;
  margin-bottom: 14px;
}
.tip {
  background: #fff; border: 1px dashed #c9d9cd; border-radius: 10px;
  padding: 18px 14px; text-align: center; color: #6a8578; font-size: 14px;
}
.lt { font-size: 17px; font-weight: 600; color: #24503a; margin: 4px 2px 12px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.card {
  background: #fff; border: 1px solid #dfeae2; border-radius: 10px;
  padding: 13px 12px; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px;
  transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: 0 3px 10px rgba(45,106,79,.14); transform: translateY(-1px); }
.card.big .cn { font-size: 17px; }
.card.self { border-style: dashed; background: #f2f9f3; }
.cn { font-size: 15px; font-weight: 500; word-break: break-all; }
.bdg { font-size: 12px; border-radius: 12px; padding: 2px 9px; width: fit-content; }
.bdg.ok { background: #e3f3e8; color: #1e7a4d; }
.bdg.none { background: #eef0ef; color: #8b948e; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 9px; }
.cell {
  aspect-ratio: 1; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600;
  user-select: none;
}
.cell.ok {
  background: linear-gradient(160deg, #37a26b, #2d8a5c); color: #fff;
  cursor: pointer; box-shadow: 0 2px 6px rgba(45,138,92,.35);
}
.cell.ok:hover { filter: brightness(1.06); }
.cell.no { background: #dde5e0; color: #93a49a; }

.legend { margin-top: 14px; font-size: 13px; color: #4c6f5e; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -1px; }
.dot.ok { background: #2d8a5c; }
.dot.no { background: #dde5e0; }
.hint { margin-top: 10px; font-size: 12px; color: #7d9489; }

#sheetMask {
  position: fixed; inset: 0; background: rgba(20,34,27,.45); z-index: 40;
}
#sheet {
  position: fixed; left: 50%; top: 50%; z-index: 50;
  transform: translate(-50%, -50%);
  width: min(94vw, 720px);
  background: #fff; border-radius: 14px;
  padding: 16px;
  box-shadow: 0 6px 30px rgba(0,0,0,.25);
  max-height: 82vh; overflow-y: auto;
}
#sheet.open { animation: pop .18s ease-out; }
@keyframes pop {
  from { opacity: 0; transform: translate(-50%, -48%) scale(.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.sheet-bar { display: flex; align-items: center; margin-bottom: 10px; }
.sheet-bar span { flex: 1; font-size: 16px; font-weight: 600; color: #24503a; word-break: break-all; padding-right: 8px; }
#sheetClose {
  background: #eef3ef; border: none; border-radius: 50%;
  width: 30px; height: 30px; font-size: 13px; color: #4c6f5e; cursor: pointer;
}
.price { font-size: 22px; font-weight: 700; color: #1e7a4d; margin-bottom: 8px; }
.mj { font-size: 15px; font-weight: 600; color: #3d6a52; margin: 0 0 8px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tag { background: #eaf3ec; color: #3d6a52; font-size: 12px; border-radius: 5px; padding: 3px 9px; }
.st { font-size: 13px; color: #2d8a5c; margin-bottom: 12px; }
.pics { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.pics img { height: 150px; border-radius: 8px; border: 1px solid #dfeae2; flex: none; }

.c-actions { display: flex; gap: 8px; margin-top: 2px; }
.c-btn {
  flex: 1; text-align: center; font-size: 12px; color: #2d6a4f;
  background: #eaf3ec; border: 1px solid #d3e6da; border-radius: 14px;
  padding: 4px 0; cursor: pointer; text-decoration: none;
}
.c-btn:hover { background: #dcefe3; }
.intro-text { font-size: 14px; line-height: 1.8; color: #3d5a4c; margin-bottom: 10px; }
.intro-row { font-size: 13px; color: #4c6f5e; margin-bottom: 6px; }
.intro-row a { color: #1e7a4d; }

.nav-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.nav-opt {
  display: flex; flex-direction: column; gap: 3px;
  text-decoration: none; padding: 12px 14px;
  background: #eaf3ec; border: 1px solid #d3e6da; border-radius: 10px;
}
.nav-opt:active { background: #dcefe3; }
.nav-opt b { color: #24503a; font-size: 15px; }
.nav-opt span { color: #7d9489; font-size: 12px; }

/* curated area cover photos */
.card .cover {
  width: 100%; height: 100px; object-fit: cover; border-radius: 7px;
  display: block; background: #e8f0ea;
}
.card.big .cover { height: 120px; }

/* favorites bar */
#favBar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; align-items: center; gap: 8px;
  background: #2d6a4f; color: #fff;
  border-radius: 999px; padding: 7px 8px 7px 16px;
  font-size: 13px; max-width: calc(100vw - 24px); white-space: nowrap;
  box-shadow: 0 4px 14px rgba(20,50,35,.35);
}
#favBar button {
  border: none; border-radius: 999px; cursor: pointer;
  font-size: 13px; padding: 5px 14px;
}
#favOpen { background: #f5c451; color: #243b30; font-weight: 600; }
#favClear { background: rgba(255,255,255,.2); color: #fff; }

/* favorite button in plot detail */
.fav-btn {
  margin-top: 12px; text-align: center; cursor: pointer;
  border: 1px solid #e0c46a; border-radius: 9px;
  background: #fdf6e0; color: #7a5c14; font-size: 14px; padding: 10px;
}
.fav-btn.on { background: #f5c451; color: #4a3a08; }

/* zoom-in photo viewer */
#zoom {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
}
#zoomMask { position: absolute; inset: 0; background: rgba(0,0,0,.86); }
#zoomImg {
  position: relative; z-index: 1;
  max-width: 94vw; max-height: 90vh;
  border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
#zoomClose {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.22); color: #fff;
  font-size: 16px; cursor: pointer; line-height: 1;
}
#zoomClose:hover { background: rgba(255,255,255,.38); }
.pics img { cursor: zoom-in; }

/* compare cards */
.cmp {
  border: 1px solid #dfeae2; border-radius: 10px;
  padding: 12px; margin-bottom: 10px; background: #fbfdfb;
}
.cmp-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cmp-name { flex: 1; font-size: 15px; font-weight: 600; color: #24503a; word-break: break-all; }
.cmp-x { flex: none; font-size: 13px; color: #c0392b; cursor: pointer; padding: 3px 10px; border-radius: 6px; background: #fdecea; }
.cmp-price { font-size: 18px; font-weight: 700; color: #1e7a4d; margin-bottom: 6px; }
.cmp-info { font-size: 13px; color: #4c6f5e; margin: 6px 0; line-height: 1.6; }
.cmp-img { width: 100%; border-radius: 8px; border: 1px solid #dfeae2; display: block; margin-top: 6px; }
.cmp-loading { font-size: 13px; color: #7d9489; text-align: center; padding: 12px 0; }
