/* AutoRoomPrice 前端样式 */
:root {
  --bg: #f5f6f8;
  --panel: #fff;
  --line: #e6e8eb;
  --text: #1f2329;
  --muted: #8a9099;
  --brand: #2f6fed;
  --down: #16a34a;
  --up: #dc2626;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12px; margin-top: 10px; }

/* 顶栏 */
.topbar {
  height: 56px; display: flex; align-items: center; gap: 18px;
  padding: 0 20px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 500;
}
.brand { font-weight: 700; font-size: 16px; }
.topbar nav { display: flex; gap: 6px; }
.topbar nav a { padding: 6px 12px; border-radius: 6px; color: var(--muted); }
.topbar nav a.on, .topbar nav a:hover { background: #eef2ff; color: var(--brand); }
.spacer { flex: 1; }
.ghost {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.ghost:hover { border-color: var(--brand); color: var(--brand); }

/* 容器 */
.container { max-width: 1240px; margin: 0 auto; padding: 20px; }

/* 筛选 */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 5px 12px; border-radius: 999px; background: #fff;
  border: 1px solid var(--line); color: var(--muted); font-size: 13px;
}
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search input, .search select {
  height: 32px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; font-size: 13px; outline: none;
}
.search input[type=search] { width: 220px; }
.search input[type=number] { width: 90px; }
.search button, .panel button {
  height: 32px; padding: 0 16px; border: 0; border-radius: 6px;
  background: var(--brand); color: #fff; cursor: pointer; font-size: 13px;
}
.count { margin-left: auto; color: var(--muted); }

/* 卡片 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.card {
  background: var(--panel); border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); transition: .15s; display: block;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.thumb { position: relative; height: 150px; background: #eceef1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .noimg { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); }
.tags { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.tag { background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 4px; }
.tag.sxz { background: rgba(245,158,11,.9); }
.badge {
  position: absolute; left: 8px; top: 8px; font-size: 11px; padding: 2px 8px;
  border-radius: 4px; color: #fff; background: #6b7280;
}
.badge.特别关注 { background: #dc2626; }
.badge.关注 { background: #2f6fed; }
.badge.不关注 { background: #9ca3af; }
.badge.失效 { background: #4b5563; }
.card .body { padding: 12px; }
.card .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta { color: var(--muted); font-size: 12px; margin: 4px 0 8px; }
.price-row { display: flex; align-items: baseline; gap: 6px; }
.price { font-size: 20px; font-weight: 700; color: var(--brand); }
.unit { color: var(--muted); font-size: 12px; }
.delta { font-size: 12px; padding: 1px 6px; border-radius: 4px; }
.delta.down { color: var(--down); background: #e8f7ee; }
.delta.up { color: var(--up); background: #fdeaea; }
.note { margin-top: 8px; font-size: 12px; color: #6b7280; background: #f7f8fa; padding: 6px 8px; border-radius: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 60px; text-align: center; color: var(--muted); background: #fff; border-radius: 10px; }
.pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin: 28px 0; }
.pager a { padding: 6px 14px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 320px; background: #fff; padding: 32px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.login-card h1 { margin: 0 0 4px; font-size: 20px; }
.login-card form { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.login-card input {
  height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; outline: none;
}
.login-card input:focus { border-color: var(--brand); }
.login-card button { height: 40px; border: 0; border-radius: 8px; background: var(--brand); color: #fff; font-size: 14px; cursor: pointer; }
.alert { background: #fdeaea; color: #b91c1c; padding: 8px 12px; border-radius: 6px; margin-top: 12px; font-size: 13px; }
.tip { color: var(--muted); font-size: 12px; margin: 18px 0 0; text-align: center; }

/* 详情 */
.back { display: inline-block; margin-bottom: 14px; color: var(--muted); }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.detail-head h1 { font-size: 22px; margin: 0 0 4px; }
.price-box { text-align: right; white-space: nowrap; }
.price-box .price { font-size: 26px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; overflow-x: auto; }
.panel.wide { grid-column: 1 / -1; }
.panel h2 { font-size: 15px; margin: 0 0 12px; }
.gallery { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.gallery img { width: 100%; height: 120px; object-fit: cover; border-radius: 6px; }
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 8px 12px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.field { display: block; margin-bottom: 12px; font-size: 13px; }
.field select, .field textarea {
  width: 100%; margin-top: 6px; padding: 8px; border: 1px solid var(--line);
  border-radius: 6px; font: inherit; outline: none; resize: vertical;
}
.mini-map { height: 280px; border-radius: 8px; overflow: hidden; background: #eceef1; }
#priceChart { width: 100% !important; height: 260px !important; display: block; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 500; }

/* 地图页 */
.map-main { display: flex; height: calc(100vh - 56px); }
.map-side { width: 340px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.side-head { padding: 14px; border-bottom: 1px solid var(--line); }
.side-head .chips { margin-bottom: 8px; }
.side-list { flex: 1; overflow-y: auto; padding: 12px; }
.big-map { flex: 1; }
.side-item { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; cursor: pointer; }
.side-item:hover { border-color: var(--brand); }
.side-item img { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; background: #eceef1; }
.side-item .t { font-weight: 600; font-size: 13px; }
.side-item .m { color: var(--muted); font-size: 12px; }
.price-marker {
  background: #fff; border: 1px solid var(--brand); color: var(--brand);
  border-radius: 6px; padding: 2px 6px; font-size: 12px; font-weight: 600;
  white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.price-marker.s-特别关注 { border-color: #dc2626; color: #dc2626; }
.price-marker.s-失效 { border-color: #9ca3af; color: #9ca3af; }

@media (max-width: 860px) {
  .detail-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .map-side { width: 260px; }
}
