/* Box For Post - Minimal UI */
:root{
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: rgba(17,24,39,.08);
  --brand: #d7263d;
  --brand2: #ff4d6d;
  --shadow: 0 10px 30px rgba(17,24,39,.12);
  --radius: 16px;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC","Hiragino Sans GB","Microsoft YaHei", Arial, sans-serif;
}

a{ color: inherit; text-decoration: none; }
.map{ height: 100vh; width: 100%; }

/* Topbar */
.topbar{
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  right: 10px;
  display:flex;
  gap: 10px;
  align-items:center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(17,24,39,.08);
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 160px;
}
.logo{
  width: 34px;
  height: 34px;
  display:grid;
  place-items:center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff;
  font-size: 18px;
  box-shadow: 0 10px 20px rgba(215,38,61,.22);
}
.name{
  font-weight: 700;
  letter-spacing: .2px;
}

.search{
  flex: 1;
  display:flex;
  gap: 8px;
  align-items:center;
  max-width: 740px;
}
.actions{
  display:flex;
  gap: 8px;
  align-items:center;
}

/* Inputs & Buttons */
.input{
  width:100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  font-size: 14px;
}
.input:focus{
  border-color: rgba(215,38,61,.35);
  box-shadow: 0 0 0 4px rgba(215,38,61,.10);
}

.btn{
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  cursor:pointer;
  transition: transform .04s ease, box-shadow .12s ease, border-color .12s ease;
  white-space: nowrap;
}
.btn:hover{ box-shadow: 0 8px 18px rgba(17,24,39,.08); }
.btn:active{ transform: translateY(1px); }
.btn:disabled{ opacity:.65; cursor:not-allowed; }

.btn-primary{
  border-color: rgba(215,38,61,.25);
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color:#fff;
  box-shadow: 0 12px 22px rgba(215,38,61,.22);
}
.btn-ghost{
  background: transparent;
}
.w100{ width:100%; }

/* HUD */
.hud{
  position: fixed;
  z-index: 900;
  left: 18px;
  bottom: 18px;
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pill{
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(17,24,39,.10);
  font-size: 13px;
}
.pill.subtle{ color: var(--muted); }

/* Marker */
.mailbox-icon{ background: transparent; border: none; }
.mailbox-pin{
  width: 30px;
  height: 30px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff;
  box-shadow: 0 12px 20px rgba(215,38,61,.28);
  border: 2px solid rgba(255,255,255,.92);
}

/* Bottom Sheet */
.sheet{
  position: fixed;
  inset: 0;
  z-index: 1200;
  display:none;
  background: rgba(17,24,39,.20);
}
.sheet.show{ display:block; }
.sheet-panel{
  position:absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  width: min(720px, calc(100% - 20px));
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 12px;
  animation: rise .16s ease-out;
}
@keyframes rise{
  from{ transform: translateX(-50%) translateY(16px); opacity: .6;}
  to{ transform: translateX(-50%) translateY(0); opacity: 1;}
}
.sheet-handle{
  width: 46px;
  height: 5px;
  border-radius: 999px;
  background: rgba(17,24,39,.12);
  margin: 4px auto 10px;
}
.sheet-head{
  display:flex;
  justify-content: space-between;
  gap: 12px;
  align-items:flex-start;
  padding: 0 4px 8px;
}
.sheet-title{ font-weight: 800; font-size: 18px; }
.sheet-subtitle{ color: var(--muted); font-size: 13px; margin-top: 2px; line-height: 1.35; }
.icon-btn{
  border: 1px solid var(--line);
  background: #fff;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  cursor: pointer;
}

.photoWrap{ padding: 0 4px 10px; }
.photoWrap.hidden{ display:none; }
.photo{
  width:100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.kv{
  margin: 0 4px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow:hidden;
}
.kv-row{
  display:flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.kv-row:first-child{ border-top: none; }
.kv-k{ color: var(--muted); font-size: 13px; }
.kv-v{ font-size: 13px; text-align: right; max-width: 70%; word-break: break-word; }

.sheet-actions{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 4px 6px;
}
.sheet-footnote{
  padding: 4px 6px 0;
  color: var(--muted);
  font-size: 12px;
}

/* Submit page */
.submit-sheet{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  width: min(920px, calc(100% - 20px));
  z-index: 1100;
}
.card{
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 14px;
}
.card-title{
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 10px;
}
.form .grid{
  display:flex;
  flex-direction: column;
  gap: 10px;
}
.field .label{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.textarea{ resize: vertical; min-height: 60px; }
.row{
  display:flex;
  gap: 8px;
  align-items:center;
}
.row-end{ justify-content: flex-end; }
.row-between{ justify-content: space-between; }

.coords{
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(17,24,39,.04);
  border: 1px dashed rgba(17,24,39,.12);
  font-size: 13px;
  color: var(--muted);
}
.preview{
  margin-top: 8px;
  width: 100%;
  max-height: 170px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
}
.preview.hidden{ display:none; }
.hint{
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}
.input.small{ padding: 8px 10px; border-radius: 10px; }

/* Admin */
.admin-wrap{
  padding: 88px 14px 60px;
  max-width: 980px;
  margin: 0 auto;
}
.stats{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.stat{
  background: rgba(255,255,255,.9);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(17,24,39,.08);
}
.stat-k{ color: var(--muted); font-size: 12px; }
.stat-v{ font-size: 22px; font-weight: 900; margin-top: 4px; }

.panel{
  margin-top: 12px;
  background: rgba(255,255,255,.9);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 10px 24px rgba(17,24,39,.08);
  padding: 14px;
}
.panel-head{
  display:flex;
  justify-content: space-between;
  align-items:flex-end;
  gap: 10px;
  margin-bottom: 10px;
}
.panel h2{ margin:0; font-size: 16px; }
.muted{ color: var(--muted); font-size: 12px; }

.cards{ display:flex; flex-direction: column; gap: 10px; }
.item{
  display:flex;
  gap: 12px;
  align-items: flex-start;
}
.item-left{ width: 84px; }
.thumb{
  width: 84px;
  height: 84px;
  border-radius: 16px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #fff;
}
.thumb.ph{
  display:grid;
  place-items:center;
  font-size: 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
}
.item-body{ flex:1; }
.item-title{ font-weight: 900; }
.item-sub{ color: var(--muted); font-size: 13px; margin-top: 2px; }
.item-meta{ color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.35; }
.item-note{
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px dashed rgba(17,24,39,.16);
  border-radius: 14px;
  background: rgba(17,24,39,.03);
  font-size: 13px;
}
.item-actions{
  margin-top: 10px;
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}
.inline{ display:flex; gap: 8px; align-items:center; }

.empty{
  padding: 14px 6px;
  color: var(--muted);
}

/* Login */
.center{
  display:grid;
  place-items:center;
  min-height: 100vh;
  padding: 16px;
}
.login-card{
  width: min(420px, 100%);
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.brandline{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-bottom: 12px;
}
.logoBig{
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display:grid;
  place-items:center;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color:#fff;
  font-size: 22px;
}
.title{ font-weight: 900; font-size: 18px; }
.subtitle{ color: var(--muted); font-size: 12px; margin-top: 2px; }

.alert{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(215,38,61,.25);
  background: rgba(215,38,61,.08);
  color: #7a0b19;
  margin-bottom: 10px;
  font-size: 13px;
}
.alert.ok{
  border-color: rgba(16,185,129,.25);
  background: rgba(16,185,129,.10);
  color: #065f46;
}

/* Toast */
.toast{
  position: fixed;
  z-index: 2000;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  background: rgba(17,24,39,.92);
  color: #fff;
  padding: 10px 12px;
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(0,0,0,.22);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

/* Responsive */
@media (max-width: 860px){
  .topbar{ flex-wrap: wrap; }
  .brand{ min-width: auto; }
  .search{ width: 100%; order: 3; }
  .actions{ width: 100%; justify-content: flex-end; order: 2; }
  .stats{ grid-template-columns: 1fr; }
}
