:root {
  --bg: #fff4f6;
  --paper: rgba(255, 255, 255, 0.72);
  --ink: #2a2224;
  --muted: #8d7f83;
  --line: rgba(255, 80, 110, 0.12);
  --brand: #ff2d55;
  --brand-soft: #ffe4ea;
  --brand-ink: #fff;
  --ok: #2f9b6a;
  --warn: #c47a1a;
  --shadow: 0 12px 32px rgba(255, 45, 85, 0.08);
  --radius: 20px;
  --safe: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Segoe UI", sans-serif;
}

button, input, textarea, select { font: inherit; color: inherit; }

h1, h2, h3 { font-weight: 650; letter-spacing: -0.02em; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.app {
  position: relative;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(1200px 480px at 12% -10%, #ffd6e0 0%, transparent 55%),
    radial-gradient(900px 420px at 110% 8%, #ffe9c8 0%, transparent 50%),
    var(--bg);
}

.glow {
  pointer-events: none;
  position: absolute;
  inset: auto -40px 18% auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 45, 85, 0.12);
  filter: blur(40px);
}

.glass {
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
}

.top {
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px 10px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #ff5d7a, var(--brand));
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(255, 45, 85, 0.28);
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1;
}

.eyebrow {
  margin: 0 0 3px;
  font-size: 12px;
  color: var(--brand);
}

.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.who, .text-btn, .tab, .chip, .map-btn {
  border: 0;
  background: none;
  cursor: pointer;
}

.who, .map-btn {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  font-size: 13px;
}

.lead {
  margin: 6px 0 0;
  max-width: 34em;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.view {
  flex: 1;
  min-height: 0;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.view[hidden],
.overlay[hidden],
.sheet[hidden],
.detail[hidden] {
  display: none !important;
}

.toolbar {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.toolbar::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  height: 32px;
  padding: 0 14px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  box-shadow: 0 4px 12px rgba(42, 34, 36, 0.04);
}

.chip[aria-pressed="true"] {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 16px rgba(255, 45, 85, 0.22);
}

.chip.weed[aria-pressed="true"] {
  background: #2a2224;
}

.stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-rows: minmax(240px, 1fr) 46%;
}

.map-wrap { position: relative; min-height: 220px; }
#map {
  height: 100%;
  background: #f3dce2;
}

.search.float {
  position: absolute;
  left: 14px;
  top: 14px;
  right: 104px;
  z-index: 500;
}

.search input,
.composer input,
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 247, 249, 0.9);
  border-radius: 16px;
  padding: 12px 15px;
  box-shadow: inset 0 0 0 1px rgba(255, 45, 85, 0.04);
}

.search input {
  height: 42px;
  border-radius: 999px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.map-btn {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 500;
}

.panel {
  min-width: 0;
  background: rgba(255, 247, 249, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  overflow: auto;
  padding: 16px 16px 20px;
  box-shadow: 0 -10px 30px rgba(255, 45, 85, 0.06);
}

.panel-head, .page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-head { align-items: flex-start; margin-bottom: 14px; }
.page-head h2 { margin: 0; font-size: 28px; }
.page-head.tight { padding: 2px 2px 8px; }

.count, .text-btn, .meta { font-size: 12px; color: var(--muted); }
.list, .stack { display: flex; flex-direction: column; gap: 12px; }

.card, .sheet, .review, .meal {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  border-radius: 24px;
  padding: 16px 16px;
  box-shadow: var(--shadow);
}

button.card {
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
}

.card .cover {
  height: 128px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 45, 85, 0.18), rgba(255, 196, 120, 0.28)),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.7), transparent 40%);
  background-size: cover;
  background-position: center;
}
.card .cover img {
  display: block;
  width: 100%;
  height: 128px;
  object-fit: cover;
}
.meal > .cover,
.sheet > .cover {
  height: 108px;
  margin: -16px -16px 12px;
  border-radius: 24px 24px 0 0;
  overflow: hidden;
}
.meal > .cover img,
.sheet > .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card .cover.chaoshan { background: linear-gradient(135deg, #ffd39a, #ffb3c4); }
.card .cover.other { background: linear-gradient(135deg, #c8f0d8, #ffe1b5); }
.card .cover.weed { background: linear-gradient(135deg, #ffc2cf, #d8c6c8); }
.card .body { padding: 12px 14px 14px; }

.card[aria-current="true"], .meal[aria-current="true"] {
  box-shadow: 0 0 0 2px rgba(255, 45, 85, 0.28), var(--shadow);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.card-top.meta .tags {
  flex: 1;
  min-width: 0;
  line-height: 1.45;
}
.card-top .km, .card-top .tag {
  flex: none;
}

.name { margin: 0; font-size: 16px; font-weight: 650; }

.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
}
.tag.other { background: #e7f7ee; color: var(--ok); }
.tag.weed, .tag.closed { background: #2a2224; color: #fff; }

.note { margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: #43383b; }

.detail { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.detail h2 { margin: 0; font-size: 26px; }

.navs, .actions, .verdicts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn, .navs a, .verdicts button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  background: linear-gradient(180deg, #ff5d7a, var(--brand));
  color: var(--brand-ink);
  box-shadow: 0 8px 18px rgba(255, 45, 85, 0.22);
}

.btn.ghost, .navs a.ghost, .verdicts button {
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.verdicts button[aria-pressed="true"] {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
}

.warn {
  margin: 0;
  padding: 10px 12px;
  background: #fff3d8;
  color: var(--warn);
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
}

.photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.photos img {
  width: 100%;
  height: 88px;
  object-fit: cover;
  border-radius: 12px;
}

.page {
  flex: 1;
  width: 100%;
  min-width: 0;
  overflow: auto;
  padding: 16px 18px calc(22px + var(--safe));
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field span { font-size: 12px; color: var(--muted); }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (min-width: 720px) {
  .field-row { grid-template-columns: 1fr 1fr 1fr; }
}
.portrait-block {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.portrait-block > span {
  flex: none;
  width: 36px;
  padding-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.on {
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: none;
}
.add-tag {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 8px;
}

.chat {
  flex: 1;
  min-height: 0;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 8px 16px 12px;
}

.suggest {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  flex: none;
}

.thread {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
  padding-bottom: 10px;
}

.bubble {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: 18px;
  line-height: 1.6;
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  flex: none;
}

.bubble.bot {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-bottom-left-radius: 8px;
}
.bubble.me {
  align-self: flex-end;
  background: linear-gradient(180deg, #ff5d7a, var(--brand));
  color: #fff;
  border-bottom-right-radius: 8px;
}

.composer {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: none;
  position: sticky;
  bottom: 0;
  margin: 4px 0 6px;
  padding: 8px 8px 8px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
}

.composer input {
  border-radius: 999px;
  box-shadow: none;
  background: transparent;
  border: 0;
}

.composer .btn {
  min-height: 38px;
  padding: 0 18px;
}

.people { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(160deg, #ff8aa0, var(--brand));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  flex: none;
  z-index: 40;
  margin: 8px 12px calc(8px + var(--safe));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 4px;
}

.tab {
  height: 56px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
}

.ico {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 9px;
  background: rgba(255, 45, 85, 0.08);
  position: relative;
}

.ico::before, .ico::after {
  content: "";
  position: absolute;
  background: currentColor;
  opacity: 0.55;
}

.ico.map::after {
  width: 9px;
  height: 9px;
  left: 6px;
  top: 4px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}
.ico.meal::before, .ico.meal::after {
  width: 7px;
  height: 7px;
  top: 8px;
  border-radius: 50%;
}
.ico.meal::before { left: 3px; }
.ico.meal::after { right: 3px; }
.ico.chat::after {
  width: 12px;
  height: 9px;
  left: 5px;
  top: 5px;
  border-radius: 6px 6px 6px 2px;
}
.ico.me::before {
  width: 7px;
  height: 7px;
  left: 8px;
  top: 4px;
  border-radius: 50%;
}
.ico.me::after {
  width: 12px;
  height: 6px;
  left: 5px;
  bottom: 4px;
  border-radius: 6px 6px 2px 2px;
}

.tab[aria-current="page"] { color: var(--brand); }
.tab[aria-current="page"] .ico { background: var(--brand-soft); }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 34, 36, 0.28);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal {
  width: min(400px, 100%);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  padding: 22px;
}

.pin {
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 4px 8px rgba(42, 34, 36, 0.18);
}
.pin.campus { width: 16px; height: 16px; border-radius: 6px; transform: none; background: var(--ink); }
.pin.chaoshan { background: #f3b04c; }
.pin.other { background: var(--ok); }
.pin.weed { background: var(--brand); }

.leaflet-container { font-family: inherit; }
.leaflet-bar {
  border: 0 !important;
  border-radius: 14px !important;
  overflow: hidden;
  box-shadow: var(--shadow) !important;
}

.hero-cover {
  width: 100%;
  height: 180px;
  border-radius: 20px;
  overflow: hidden;
  background: #f3dce2;
}
.hero-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.map-pop {
  width: 220px;
  font-family: inherit;
}
.map-pop img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  margin-bottom: 8px;
}
.map-pop b { display: block; font-size: 14px; }
.map-pop span { font-size: 12px; color: var(--muted); }

.leaflet-popup-content-wrapper {
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.leaflet-popup-content { margin: 10px 12px; }

@media (min-width: 960px) {
  .top, .toolbar { padding-left: 32px; padding-right: 32px; }
  .tabs {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    width: calc(100% - 48px);
  }
  .stage {
    grid-template-rows: none;
    grid-template-columns: minmax(420px, 1.35fr) minmax(380px, 460px);
    gap: 0;
    column-gap: 0;
  }
  .map-wrap { min-height: 0; }
  .panel {
    border-top: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    padding: 20px 22px 28px;
  }
  .card .cover, .card .cover img { height: 148px; }
  .app.has-shop .stage { grid-template-rows: none; }
  .page, .chat {
    max-width: 920px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 32px;
    padding-right: 32px;
  }
  .hero-cover { height: 220px; }
}

@media (max-width: 959px) {
  .stat { display: none; }
  .app.has-shop #view-map .stage { grid-template-rows: 32% 1fr; }
}

.admin-app {
  overflow: auto;
  height: auto;
  min-height: 100%;
}
.admin-app .page {
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
}
.admin-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 18px 0;
}
.admin-tabs button[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand);
}
.kpis, .kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 8px 0 18px;
}
.kpi, .kpi {
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
}
.kpi b { display: block; font-size: 26px; letter-spacing: -0.03em; }
.kpi span { font-size: 12px; color: var(--muted); }
.grid-table, .grid-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid-table th, .grid-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.grid-table th { color: var(--muted); font-weight: 550; }
.row-actions, .row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions .btn { min-height: 32px; padding: 4px 10px; font-size: 12px; }
.danger { background: #2a2224 !important; box-shadow: none !important; }
