:root {
  --bg: #e7eee8;
  --fg: #142018;
  --muted: #5c6b61;
  --line: rgba(20, 40, 28, 0.1);
  --card: #f7faf7;
  --card-2: #ffffff;
  --primary: #14603c;
  --primary-soft: #e3f3e9;
  --warn: #8a5a12;
  --warn-soft: #f6ead2;
  --hospital: #6b3d7a;
  --hospital-soft: #f3e8f6;
  --gas: #1e4f78;
  --gas-soft: #e4eef6;
  --park: #2d6a3e;
  --park-soft: #e4f3e8;
  --street: #14603c;
  --street-soft: #e3f3e9;
  --ad: #f3efe6;
  --shadow: 0 10px 28px rgba(20, 40, 28, 0.08);
  --radius: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--fg); }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, a { font: inherit; }
button {
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; display: block; }
img.user-shot,
.card-shot,
.hero-shot,
.shot,
.draft,
.comment-shots img,
.draft-shots img,
.shot-box img {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: auto;
  cursor: pointer;
}
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  background: rgba(8, 16, 10, 0.92);
}
.photo-lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  pointer-events: auto;
  border-radius: 10px;
}
.photo-lightbox-close {
  position: absolute;
  top: calc(10px + var(--safe-top));
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 28px;
  line-height: 40px;
  padding: 0;
}
.composer .btn[disabled],
.btn-solid:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.app {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 420px at 50% -80px, #cfe3d4 0%, transparent 70%),
    var(--bg);
}

.shell {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: calc(14px + var(--safe-top)) 16px calc(88px + var(--safe-bot));
}
.detail-shell { padding-bottom: calc(28px + var(--safe-bot)); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.brand-kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 600;
}
.brand {
  margin: 4px 0 0;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex: none;
  background: var(--primary);
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.icon-btn,
.loc-btn,
.report-link {
  height: 40px;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.icon-btn {
  width: 40px;
  padding: 0;
  display: grid;
  place-items: center;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.spin svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.report-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}
.report-link svg { width: 14px; height: 14px; }

.loc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
}
.loc-btn.on { background: var(--primary); color: #fff; border-color: transparent; }
.loc-btn.wait { opacity: 0.7; }
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9d4cc;
  flex: none;
}
.loc-btn.on .dot { background: #b6f0c8; box-shadow: 0 0 0 4px rgba(182, 240, 200, 0.25); }

.status {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.status b { color: var(--fg); font-weight: 700; }

.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  background: linear-gradient(180deg, #1a6842 0%, #14603c 58%, #0f4c30 100%);
  color: #f4fbf6;
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.hero-label {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 12px;
  opacity: 0.78;
  letter-spacing: 0.06em;
}
.hero h2 {
  position: relative;
  z-index: 1;
  margin: 8px 0 0;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
}
.hero p {
  position: relative;
  z-index: 1;
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.55;
  opacity: 0.9;
}
.hero-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  font-size: 12px;
  opacity: 0.9;
}
.hero-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
.hero-shot {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 14px;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: #fff; color: var(--primary); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.btn-solid { background: var(--primary); color: #fff; }
.btn-line {
  background: var(--card-2);
  color: var(--fg);
  border: 1px solid var(--line);
}
.btn-used { background: var(--primary-soft); color: var(--primary); }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 0 16px 12px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.chip.on { background: var(--fg); color: #fff; border-color: var(--fg); }

.list { display: grid; gap: 10px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.kind {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;
}
.kind-pill {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.4;
}
.kind-street { background: var(--street-soft); color: var(--street); }
.kind-park { background: var(--park-soft); color: var(--park); }
.kind-hospital { background: var(--hospital-soft); color: var(--hospital); }
.kind-gas { background: var(--gas-soft); color: var(--gas); }
.kind-mall { background: var(--warn-soft); color: var(--warn); }
.kind-fixed { background: #d8eee0; color: var(--primary); }
.kind-user { background: var(--warn-soft); color: var(--warn); }

.card-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 700;
  min-width: 0;
}
.dist {
  flex: none;
  text-align: right;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}
.dist b {
  display: block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}
.dist span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.note {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: #314338;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.meta svg { width: 12px; height: 12px; flex: none; }
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.card-shot {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 14px;
  margin-top: 10px;
  background: #d5e0d7;
}

.empty {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: center;
  margin-bottom: 14px;
}
.empty h2 { margin: 0 0 6px; font-size: 17px; line-height: 1.3; }
.empty p { margin: 0 auto; max-width: 20em; color: var(--muted); font-size: 13px; line-height: 1.6; }
.empty-report { margin: 14px auto 0; min-width: 200px; }

.report-entry {
  width: 100%;
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px dashed rgba(20, 96, 60, 0.35);
  background: var(--primary-soft);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
}
.report-entry strong { font-size: 14px; font-weight: 700; line-height: 1.4; }
.report-entry span { font-size: 12px; color: var(--muted); font-weight: 500; line-height: 1.4; }

.tiny {
  display: block;
  margin-top: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ad {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ad) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + var(--safe-bot));
}
.ad-inner {
  width: min(440px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.ad-badge {
  flex: none;
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 3px 6px;
  border-radius: 6px;
  background: #efe7d6;
  color: #6d5a32;
  font-weight: 700;
}

.detail-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.detail-bar h1 {
  margin: 4px 0 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
}
.detail-hero {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.detail-hero .hero-actions { margin-top: 14px; }
.detail-hero .go { background: var(--primary); color: #fff; }
.shot, .draft, .comment > img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 14px;
  margin-top: 12px;
  background: #d5e0d7;
}
.comment-shots,
.draft-shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.comment-shots img,
.draft-shots img {
  width: 100%;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
  margin: 0;
  background: #d5e0d7;
}
.draft-shot { position: relative; }
.draft-shot button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(20, 32, 24, 0.72);
  color: #fff;
  font-size: 14px;
  line-height: 22px;
  padding: 0;
}

.comments { margin-top: 18px; }
.comments h2 { margin: 0 0 10px; font-size: 15px; font-weight: 700; }
.comment {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 8px;
}
.comment p { margin: 0; font-size: 14px; line-height: 1.5; }
.comment span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.empty-line { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0; }

.composer { margin-top: 14px; position: relative; }
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.tiny.warn { color: var(--warn); font-weight: 650; }
.tiny.ok { color: var(--primary); font-weight: 700; }
.notice {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #d7efe0;
  color: #14603c;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.55;
}
.shot-box {
  width: 100%;
  min-height: 220px;
  border: 2px dashed #8aa890;
  background: #e7f1ea;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #14603c;
  font: inherit;
  padding: 0;
  overflow: hidden;
  position: relative;
}
.shot-box svg { width: 42px; height: 42px; }
.shot-box b { font-size: 20px; font-weight: 800; }
.shot-box.has-img { border-style: solid; border-color: #14603c; min-height: 240px; }
.shot-box img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}
.shot-flag {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: #14603c;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 10px;
}
.go-btn {
  width: 100%;
  margin-top: 14px;
  min-height: 52px;
  font-size: 18px;
  font-weight: 800;
}
.go-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.shot-box .tiny { margin: 0; color: #5c6b61; }
.shot-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.shot-actions .btn { min-height: 48px; font-size: 16px; font-weight: 800; }
.file-btn {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.file-hit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  font-size: 40px;
  cursor: pointer;
}
.result {
  margin: 14px 0 0;
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 4px;
}
.result.ok { color: #14603c; }
.result.fail { color: #b42318; }
.composer textarea, .field {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card-2);
  border-radius: 16px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--fg);
  resize: vertical;
  line-height: 1.45;
}
.field { min-height: 46px; margin-bottom: 8px; }
.composer-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.cam { position: relative; overflow: hidden; }
.lead {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 14px;
}
.boot-line { color: var(--muted); font-size: 14px; margin: 18px 0 0; line-height: 1.5; }

@media (min-width: 880px) {
  .app { display: grid; place-items: start center; }
  .shell {
    margin-top: 24px;
    margin-bottom: 88px;
    background: rgba(255, 255, 255, 0.28);
    border: 1px solid rgba(20, 40, 28, 0.06);
    border-radius: 28px;
    padding: 22px 18px 22px;
    box-shadow: var(--shadow);
  }
}
