* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f4f5f7;
  color: #222;
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.topbar { background: #1f6feb; color: #fff; padding: 12px 0; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; }
.brand { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.topbar nav a { color: #fff; text-decoration: none; margin-left: 16px; opacity: .9; }
.topbar nav a:hover { opacity: 1; text-decoration: underline; }

main.wrap { padding-top: 20px; padding-bottom: 40px; }
.footer { color: #777; font-size: .8rem; padding: 20px 0 30px; border-top: 1px solid #ddd; }

.status-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; border: 1px solid #e3e6ea; border-radius: 8px;
  padding: 12px 16px; margin-bottom: 12px; flex-wrap: wrap; gap: 10px;
}
.btn {
  display: inline-block; background: #1f6feb; color: #fff; border: 0;
  padding: 8px 14px; border-radius: 6px; font-size: .9rem; cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #1859c2; }
.btn-ghost { background: transparent; color: #1f6feb; border: 1px solid #1f6feb; }
.btn-ghost:hover { background: #eef4ff; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.filters input, .filters select {
  padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: .9rem;
}

.logs { margin-bottom: 12px; }
.logs details { background: #fff; border: 1px solid #e3e6ea; border-radius: 8px; padding: 10px 14px; }
.logs summary { cursor: pointer; font-weight: 600; }
.logs table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .85rem; }
.logs td, .logs th { padding: 5px 8px; text-align: left; border-bottom: 1px solid #eee; }
.err { color: #c0392b; font-size: .8rem; }
.badge { padding: 2px 8px; border-radius: 10px; font-size: .75rem; color: #fff; }
.badge-ok { background: #27ae60; }
.badge-error { background: #c0392b; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card-wrap { position: relative; }
.card {
  background: #fff; border: 1px solid #e3e6ea; border-radius: 10px; overflow: hidden;
  text-decoration: none; color: inherit; display: block; transition: box-shadow .15s;
}
.card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.card-img { position: relative; height: 160px; background: #e9edf1; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 12px 14px; }
.card-price { font-size: 1.25rem; font-weight: 700; color: #1f6feb; }
.card-meta { color: #555; font-size: .85rem; margin: 2px 0 6px; }
.card-title { font-weight: 600; line-height: 1.25; min-height: 1.25em; }
.card-loc { color: #777; font-size: .85rem; margin-top: 4px; }
.card-foot { display: flex; justify-content: space-between; color: #999; font-size: .75rem; margin-top: 8px; }
.empty { grid-column: 1 / -1; background: #fff; border: 1px dashed #ccc; border-radius: 8px; padding: 30px; text-align: center; color: #777; }

.badge-new {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: #e67e22; font-weight: 700; letter-spacing: .03em;
}

.fav-btn {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 36px; height: 36px; border: none; border-radius: 50%;
  background: rgba(255,255,255,.92); color: #999; font-size: 1.1rem;
  line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.25);
  transition: transform .12s, color .12s;
}
.fav-btn:hover { transform: scale(1.12); color: #e74c3c; }
.fav-btn.fav-on { color: #e74c3c; }
.fav-btn.fav-lg {
  position: static; width: auto; height: auto; padding: 8px 14px;
  border-radius: 6px; font-size: .9rem; background: #fff;
  border: 1px solid #e74c3c; color: #e74c3c; box-shadow: none;
}
.fav-btn.fav-lg:hover { background: #fdecea; }
.fav-btn.fav-lg.fav-on { background: #e74c3c; color: #fff; }

.detail { background: #fff; border: 1px solid #e3e6ea; border-radius: 10px; padding: 20px; }
.detail-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.detail-head-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.detail-price { font-size: 1.6rem; font-weight: 700; color: #1f6feb; }
.detail-img { margin: 14px 0; max-height: 360px; overflow: hidden; border-radius: 8px; }
.detail-img img { width: 100%; object-fit: cover; }
.detail-grid { display: flex; gap: 16px; margin: 10px 0; }
.detail-grid div { background: #f0f3f7; border-radius: 8px; padding: 12px 18px; text-align: center; }
.detail-grid strong { display: block; font-size: 1.3rem; }
.detail-grid span { font-size: .8rem; color: #666; }
.detail-meta { color: #555; font-size: .9rem; line-height: 1.6; margin: 12px 0; }
