:root {
  color-scheme: light dark;
  --primary: #2f6b4f;
  --accent: #e08a3c;
  --bg: #f6f4ee;
  --text: #1f2a24;
  --muted: #6b7a71;
  --wetland: #2b7bb9;
  --river: #4aa3a2;
  --forest: #3d8b3d;
  --park: #c98b2b;
  --paper: #fffefa;
  --border: #dce2d8;
  --subtle: #ebefe7;
  --primary-ink: #285b43;
  --muted-ink: #55645b;
  --accent-bg: #faecd8;
  --accent-ink: #794b22;
  --recent-bg: #ffede1;
  --recent-ink: #92351e;
  --recent-border: #c45637;
  --recent-fresh: #a63822;
  --news-social-bg: #ffebee;
  --news-social-ink: #d21b43;
  --header-bg: #244b38;
  --outline: #2f6b4f;
  --shadow: 0 2px 8px #26382a0e, 0 8px 24px #26382a12;
  --radius: 12px;
  --speed: 200ms;
  --sheet-collapsed: 81px;

  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a231e;
    --text: #e8f0e8;
    --muted: #a2b2a7;
    --paper: #24312a;
    --border: #3b4c41;
    --subtle: #2f4035;
    --primary-ink: #a3d4b8;
    --muted-ink: #b4c3b9;
    --accent-bg: #4a3928;
    --accent-ink: #ffd29b;
    --recent-bg: #4c3026;
    --recent-ink: #ffc1a3;
    --recent-border: #e78463;
    --news-social-bg: #512632;
    --news-social-ink: #ffb4c3;
    --header-bg: #1e382b;
    --outline: #a3d4b8;
    --shadow: 0 2px 8px #0004, 0 8px 24px #0002;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.55;
}

h1, h2, h3, p, ul { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--primary-ink); }

:focus-visible {
  outline: 2px solid var(--outline);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.site-header {
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 10px max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left));
  background: var(--header-bg);
  color: #f9fbf5;
  box-shadow: 0 2px 10px #162c2333;
  --outline: #ffe2aa;
}

.header-brand, .season-bar, .local-season, .etiquette-button {
  display: flex;
  align-items: center;
}

.header-brand { gap: 11px; flex: none; }
.brand-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #e4f2d737;
  border-radius: var(--radius);
  background: #e4f2d71c;
  color: #e4f2d7;
}
.brand-icon svg { width: 32px; height: 32px; }
.header-brand h1 { font-size: 1.375rem; font-weight: 720; letter-spacing: .045em; }

.season-bar { gap: clamp(10px, 1.7vw, 24px); min-width: 0; }
.season-controls {
  display: flex;
  flex: none;
  gap: 2px;
  padding: 3px;
  border: 1px solid #ffffff25;
  border-radius: 11px;
  background: #142f246d;
}
.season-controls button {
  flex: none;
  min-width: 39px;
  min-height: 34px;
  padding: 3px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #e7f0e8;
  font-size: .875rem;
  font-weight: 650;
  transition: background-color var(--speed), color var(--speed);
}
.season-controls button:hover { background: #ffffff24; }
.season-controls button[aria-pressed="true"] { background: #e8f1df; color: #244b38; }
.local-season { flex: none; gap: 6px; color: #e0ebe1; font-size: .875rem; white-space: nowrap; }
.local-season button {
  padding: 3px 4px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #ffe0b1;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.local-season button:hover { background: #ffffff20; }
.local-season button:disabled { color: #c4d5c7; text-decoration: none; }
.etiquette-button {
  flex: none;
  gap: 7px;
  min-height: 39px;
  padding: 5px 12px;
  border: 1px solid #f0f6ea5c;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  font-size: .875rem;
  font-weight: 650;
  transition: background-color var(--speed);
}
.etiquette-button:hover { background: #ffffff20; }
.etiquette-button svg, .reset-view svg { width: 18px; height: 18px; flex: none; }

.workspace {
  position: relative;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: 0;
  isolation: isolate;
}
.sidebar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-inline-end: 1px solid var(--border);
  background: var(--bg);
  box-shadow: 2px 0 12px #26382a12;
}
.sheet-toggle, .mobile-settings-toggle, .sheet-quick-tabs, .mobile-settings-panel, .sidebar-footer-note { display: none; }
.search-area { flex: none; padding: 18px 20px 13px; }
.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 45px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--muted-ink);
  transition: border-color var(--speed), box-shadow var(--speed);
}
.search-box:focus-within { border-color: var(--outline); box-shadow: 0 0 0 2px var(--subtle); }
.search-box svg { flex: none; width: 19px; height: 19px; }
.search-box input {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
}
.search-box input::placeholder { color: var(--muted-ink); opacity: 1; }
.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 20px 20px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.sidebar[data-view="detail"] .filters .filter-block { display: none; }
.sidebar[data-view="detail"] .filters { border-bottom: 0; padding-bottom: 0; }
.filters { padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.results-summary { margin-bottom: 12px; color: var(--muted-ink); font-size: .875rem; }
.filter-block + .filter-block { margin-top: 12px; }
.filter-label { font-size: .875rem; font-weight: 700; }
.habitat-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.habitat-chip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  min-height: 35px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  color: var(--muted-ink);
  font-size: .8125rem;
  text-align: start;
  transition: background-color var(--speed), border-color var(--speed);
}
.habitat-chip[aria-pressed="true"] {
  border-color: var(--habitat-color);
  border-color: color-mix(in srgb, var(--habitat-color) 48%, var(--border));
  background: var(--paper);
  background: color-mix(in srgb, var(--habitat-color) 9%, var(--paper));
  color: var(--text);
}
.habitat-chip:hover { border-color: var(--habitat-color, var(--outline)); }
.habitat-chip[aria-pressed="false"] .habitat-dot { opacity: .45; }
.habitat-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--habitat-color, var(--primary)); }
.district-filter { display: flex; align-items: center; gap: 12px; }
.district-filter label { flex: none; }
.select-shell { position: relative; flex: 1; min-width: 0; }
.select-shell select {
  appearance: none;
  width: 100%;
  min-height: 36px;
  padding: 5px 30px 5px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper);
  color: var(--text);
  font-size: .875rem;
}
.select-shell svg { position: absolute; top: 50%; right: 10px; width: 15px; height: 15px; color: var(--muted-ink); transform: translateY(-50%); pointer-events: none; }

.browse { padding-top: 14px; }
.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--subtle);
}
.tabs button {
  min-height: 34px;
  padding-inline: 4px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-ink);
  font-size: .875rem;
  font-weight: 700;
  transition: background-color var(--speed), color var(--speed);
}
.tabs button:hover { color: var(--primary-ink); }
.tabs button[aria-selected="true"] { background: var(--paper); box-shadow: 0 1px 3px #253b3020; color: var(--primary-ink); }
.results-panel { margin-top: 12px; border-radius: var(--radius); }
.results-panel ul { padding: 0; list-style: none; }
.results-panel li + li { margin-top: 8px; }
.spot-card {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 2px 8px #253b300a;
  color: var(--text);
  text-align: start;
  transition: border-color var(--speed), box-shadow var(--speed);
}
.spot-card:hover, .spot-card:focus-visible { border-color: var(--outline); box-shadow: var(--shadow); }
.spot-card-title { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 7px; font-weight: 700; }
.spot-card-meta, .detail-meta, .species-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; color: var(--muted-ink); font-size: .8125rem; }
.spot-card-meta { margin: 5px 0 2px; }
.spot-card-species { display: block; color: var(--muted-ink); font-size: .8125rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--subtle);
  color: var(--primary-ink);
  font-size: .75rem;
  font-weight: 650;
}
.badge-current, .badge-protection { background: var(--accent-bg); color: var(--accent-ink); }
.badge-featured {
  border: 1px solid #e6ba52;
  background: #fdf0cc;
  color: #844f00;
  white-space: nowrap;
}
@media (prefers-color-scheme: dark) {
  .badge-featured { border-color: #8a6823; background: #3f3114; color: #ffda7b; }
}
.badge-habitat { background: color-mix(in srgb, var(--habitat-color, var(--primary)) 11%, var(--paper)); color: var(--text); }
.badge-recent { background: var(--recent-bg); color: var(--recent-ink); white-space: nowrap; }
.badge-recent-fresh { background: var(--recent-fresh); color: #fff; white-space: nowrap; }
.badge-migratory { background: #dff2f3; color: #1d5e68; }
.badge-resident { background: #e9eee8; color: #4a5d51; }
.badge-rare { background: #f5e3ed; color: #81365a; }
.badge-uncommon { background: #ece9f6; color: #594887; }
@media (prefers-color-scheme: dark) {
  .badge-migratory { background: #243f45; color: #aadbe2; }
  .badge-resident { background: #35443a; color: #c4d2c7; }
  .badge-rare { background: #4c2d42; color: #f4bdd6; }
  .badge-uncommon { background: #38324b; color: #d8c9fa; }
}
.recent-summary {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--recent-border);
  border-radius: 9px;
  background: var(--paper);
  font-size: .8125rem;
  line-height: 1.45;
}
.recent-summary h2 { color: var(--recent-ink); font-size: .9375rem; }
.recent-summary-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
}
.recent-summary-header h2 { flex: 1 1 11rem; }
.recent-refresh {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  margin-inline-start: auto;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
  color: var(--recent-ink);
  font-size: .75rem;
  font-weight: 650;
  white-space: nowrap;
}
.recent-refresh:hover:not(:disabled) { border-color: var(--recent-border); background: var(--recent-bg); }
.recent-refresh:disabled { color: var(--muted-ink); }
.recent-refresh svg { width: 1rem; height: 1rem; }
.recent-refresh.is-syncing svg { animation: recent-refresh-spin 900ms linear infinite; }
@keyframes recent-refresh-spin {
  to { transform: rotate(360deg); }
}
.recent-summary-secondary, .recent-summary-status { color: var(--muted-ink); font-size: .75rem; }
.recent-summary a { white-space: nowrap; }
.recent-filters { display: flex; flex-wrap: wrap; gap: 5px; margin: 9px 0 4px; }
.recent-filter {
  min-height: 32px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted-ink);
  font-size: .8125rem;
  font-weight: 650;
  white-space: nowrap;
}
.recent-filter:hover, .recent-filter[aria-pressed="true"], .recent-card[aria-pressed="true"] { border-color: var(--recent-border); }
.recent-filter[aria-pressed="true"], .recent-card[aria-pressed="true"] { background: var(--recent-bg); color: var(--recent-ink); }
.recent-sort-hint { margin-bottom: 8px; color: var(--muted-ink); font-size: .75rem; }
.recent-card {
  display: flex;
  align-items: center;
  gap: 10px;
}
.recent-card-body { flex: 1; min-width: 0; display: block; }
.recent-card .spot-card-title { flex-wrap: wrap; gap: 4px 6px; }
.recent-card .badge { white-space: nowrap; }
.recent-card .species-scientific { overflow-wrap: anywhere; }
.recent-bird-thumb {
  --avatar-fill: #3d6b56;
  --avatar-edge: #fff;
  --avatar-ring: #6a8d7b;
  --avatar-size: 40px;
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: var(--avatar-size);
  height: var(--avatar-size);
  overflow: hidden;
  border: 2px solid var(--avatar-edge);
  border-radius: 50%;
  background: var(--avatar-fill);
  box-shadow: 0 0 0 1.2px var(--avatar-ring), 0 2px 6px #18231d33;
}
.recent-bird-thumb.is-popup { --avatar-size: 52px; }
.recent-bird-thumb.is-level-one {
  --avatar-fill: #c8372d;
  --avatar-edge: #ffd178;
  --avatar-ring: #c8372d;
}
.recent-bird-thumb.is-level-two {
  --avatar-fill: #e06524;
  --avatar-edge: #fff3db;
  --avatar-ring: #e06524;
}
.recent-bird-thumb.is-uncommon {
  --avatar-fill: #724a96;
  --avatar-edge: #fff;
  --avatar-ring: #724a96;
}
.recent-view-bar, .news-toolbar, .news-detail-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}
.recent-view-controls, .news-filters, .news-transfer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.recent-view-controls {
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--subtle);
}
.recent-view-controls button, .news-filters button, .news-transfer button, .news-add-button, .news-delete-button {
  min-height: 32px;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-ink);
  font-size: .8125rem;
  font-weight: 650;
  white-space: nowrap;
}
.recent-view-controls button[aria-pressed="true"] {
  background: var(--paper);
  color: var(--primary-ink);
  box-shadow: 0 1px 3px #253b3019;
}
.news-count {
  display: inline-block;
  min-width: 1.35em;
  padding-inline: .25em;
  border-radius: 4px;
  background: var(--subtle);
  color: var(--primary-ink);
  font-size: .75rem;
  text-align: center;
}
.news-count:empty { display: none; }
.news-filters button, .news-transfer button { border-color: var(--border); background: var(--paper); }
.news-filters button { border-radius: 999px; }
.news-filters button[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--subtle);
  color: var(--primary-ink);
}
.recent-view-controls button:hover, .news-filters button:hover, .news-transfer button:hover, .news-delete-button:hover {
  border-color: var(--outline);
  color: var(--primary-ink);
}
.news-add-button {
  min-height: 34px;
  padding-inline: 9px;
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.news-add-button:hover { background: var(--header-bg); }
.news-card {
  display: grid;
  gap: 6px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 2px 8px #253b300a;
  overflow-wrap: anywhere;
  transition: border-color var(--speed);
}
.news-card.is-locatable { cursor: pointer; }
.news-card.is-locatable:hover, .news-card.is-locatable:focus-within { border-color: var(--outline); }
.news-card-title { color: var(--text); font-size: .9375rem; line-height: 1.4; }
.news-card-locate {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  overflow-wrap: anywhere;
}
.news-card-locate:hover { color: var(--primary-ink); text-decoration: underline; }
.news-card-meta, .news-card-actions, .news-birds, .news-popup-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}
.news-card-meta { color: var(--muted-ink); font-size: .75rem; }
.news-source-name { color: var(--muted-ink); }
.news-card-summary { color: var(--muted-ink); font-size: .8125rem; white-space: pre-line; }
.news-card-actions, .news-popup-actions { font-size: .8125rem; font-weight: 650; }
.news-card-actions a, .news-popup-actions a { padding-block: 3px; }
.news-delete-button { margin-inline-start: auto; color: var(--news-social-ink); }
.news-delete-button:hover { border-color: var(--news-social-ink); background: var(--news-social-bg); color: var(--news-social-ink); }
.news-badge, .news-bird-chip {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--subtle);
  color: var(--muted-ink);
  font-size: .75rem;
  font-weight: 650;
}
.news-badge-official, .badge-news-count {
  background: color-mix(in srgb, var(--primary) 16%, var(--paper));
  color: var(--primary-ink);
}
.news-badge-xiaohongshu { background: var(--news-social-bg); color: var(--news-social-ink); }
.news-bird-chip.is-protected { background: var(--accent-bg); color: var(--accent-ink); }
.badge-news-count { white-space: nowrap; }
.news-detail-heading h3 { margin: 0; }
.news-detail-list { padding: 0; list-style: none; }
.news-detail-list > li + li { margin-top: 7px; }
.news-detail-list .news-card { padding: 8px 10px; gap: 4px; }
.empty-state {
  display: grid;
  justify-items: start;
  gap: 9px;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--muted-ink);
}

.detail-panel { display: grid; gap: 15px; }
.detail-back, .empty-state button, .popup-detail {
  justify-self: start;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--paper);
  color: var(--primary-ink);
  font-size: .875rem;
  font-weight: 650;
}
.detail-back:hover, .empty-state button:hover, .popup-detail:hover { border-color: var(--outline); }
.detail-header h2 { margin: 0 0 5px; font-size: 1.375rem; line-height: 1.3; }
.detail-alias { margin-bottom: 5px; color: var(--muted-ink); font-size: .875rem; }
.detail-section { padding-top: 12px; border-top: 1px solid var(--border); }
.detail-section h3 { margin-bottom: 5px; color: var(--primary-ink); font-size: .9375rem; }
.detail-section p { line-height: 1.7; overflow-wrap: anywhere; }
.detail-season-grid, .species-chips, .detail-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-season { min-width: 43px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px; color: var(--muted-ink); text-align: center; font-size: .875rem; }
.detail-season[data-best="true"] { background: var(--subtle); border-color: var(--outline); color: var(--primary-ink); font-weight: 700; }
.detail-section .detail-season-summary { margin-top: 5px; color: var(--muted-ink); font-size: .875rem; }
.species-chip, .action-button {
  display: inline-flex;
  align-items: center;
  min-height: 35px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper);
  color: var(--primary-ink);
  font-size: .875rem;
  font-weight: 650;
  text-decoration: none;
  transition: border-color var(--speed), background-color var(--speed);
}
.species-chip:hover, .action-button:hover { border-color: var(--outline); }
.recent-chip-dot { flex: none; width: 7px; height: 7px; margin-inline-start: 6px; border-radius: 50%; background: #e85d3f; }
.recent-spot-stats { margin-bottom: 6px; color: var(--muted-ink); font-size: .8125rem; }
.recent-spot-chip { flex-wrap: wrap; gap: 4px; padding-inline: 7px; }
.action-button { min-height: 40px; border-color: var(--primary); background: var(--primary); color: #fff; }
.action-button:hover { background: var(--header-bg); }
.action-secondary, .action-secondary:hover { background: var(--paper); color: var(--primary-ink); }
.species-group { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--paper); }
.species-group + .species-group { margin-top: 8px; }
.species-group summary { padding: 9px 12px; color: var(--primary-ink); font-size: .9375rem; font-weight: 700; cursor: pointer; }
.species-group summary:focus-visible { outline-offset: -3px; }
.species-group-count { margin-inline-start: 6px; color: var(--muted-ink); font-size: .8125rem; font-weight: 400; }
.species-group .species-list > li { margin: 0; }
.species-row { display: block; width: 100%; padding: 8px 12px; border: 0; border-top: 1px solid var(--border); background: var(--paper); color: var(--text); text-align: start; }
.species-row:focus-visible { outline-offset: -3px; }
.species-row:hover, .species-row[aria-pressed="true"] { background: var(--subtle); }
.species-name { font-weight: 700; }
.species-scientific { display: block; margin: 1px 0 4px; color: var(--muted-ink); font-size: .875rem; font-style: italic; }

.map-stage { position: relative; min-width: 0; min-height: 0; isolation: isolate; }
#map {
  --map-canvas: #f3f1ea;
  position: absolute;
  inset: 0;
  color-scheme: light;
  background-color: var(--map-canvas);
}
@media (prefers-color-scheme: dark) {
  #map { --map-canvas: #171f1b; }
}
#map.is-satellite { --map-canvas: #141d18; }
/* Keep the mask and its outline visible beyond Leaflet's SVG viewport while panning. */
#map .wuhan-mask-pane > svg, #map .wuhan-border-pane > svg { overflow: visible; }
.map:focus-visible { outline-offset: -3px; }
.map .leaflet-control-zoom { margin-top: 12px; margin-left: 12px; }
.map .leaflet-control-layers { margin-top: 12px; margin-right: 12px; }
.map .leaflet-control-layers, .map .leaflet-control-zoom { border: 1px solid #c9d5cb; border-radius: 9px; box-shadow: var(--shadow); }
.map .leaflet-control-layers-expanded { padding: 8px 12px; font-size: .875rem; }
.map .roads-control {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  margin-right: 12px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--paper);
  box-shadow: var(--shadow);
  color: var(--text);
  color-scheme: light dark;
  font-size: .875rem;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}
.roads-control input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--primary);
  cursor: inherit;
}
.roads-control:has(input:disabled) { opacity: .65; cursor: default; }
.map .recent-control-panel {
  display: grid;
  gap: 5px;
  margin-top: 6px;
  margin-right: 12px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--paper);
  box-shadow: var(--shadow);
  color: var(--text);
  color-scheme: light dark;
}
.recent-control-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .875rem;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}
.recent-control-toggle input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--primary);
  cursor: inherit;
}
.recent-style-switch {
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--subtle);
}
.recent-style-option {
  min-height: 24px;
  padding: 2px 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted-ink);
  font-size: .75rem;
  font-weight: 650;
  white-space: nowrap;
  transition: background-color var(--speed), color var(--speed), opacity var(--speed);
}
.recent-style-option:hover:not(:disabled) { color: var(--primary-ink); }
.recent-style-option[aria-pressed="true"] {
  background: var(--paper);
  color: var(--primary-ink);
  box-shadow: 0 1px 2px #253b3022;
}
.recent-style-option:disabled { opacity: .52; }
.map .leaflet-control-zoom a { color: #274632; }
.map .leaflet-control-zoom a:first-child { border-top-left-radius: 8px; border-top-right-radius: 8px; }
.map .leaflet-control-zoom a:last-child { border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; }
.map .leaflet-control-attribution { margin: 0; }
.map .leaflet-container a:focus-visible, .map a:focus-visible { outline-offset: -2px; }
.map .wuhan-district-area { cursor: inherit; }
.map .district-tooltip, .map .recent-tooltip {
  padding: 3px 7px;
  border-color: var(--border);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 1px 5px #0002;
  color: var(--text);
}
.map .district-tooltip::before, .map .recent-tooltip::before { display: none; }
.reset-view, .map-warning, .distribution-banner, .map-legend {
  position: absolute;
  z-index: 950;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--text);
  box-shadow: var(--shadow);
}
.reset-view {
  top: 87px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 37px;
  padding: 4px 9px;
  border-radius: 9px;
  font-size: .8125rem;
  font-weight: 700;
  transition: border-color var(--speed);
}
.reset-view:hover { border-color: var(--outline); }
.reset-view svg { color: var(--primary-ink); }
.map-warning, .distribution-banner {
  left: 50%;
  max-width: min(30rem, calc(100% - 120px));
  width: max-content;
  transform: translateX(-50%);
}
.map-warning { top: 59px; padding: 6px 10px; background: var(--accent-bg); color: var(--accent-ink); font-size: .8125rem; }
.distribution-banner {
  top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 37px;
  padding: 2px 3px 2px 10px;
  color: var(--primary-ink);
  font-size: .875rem;
  font-weight: 700;
}
.distribution-banner.is-recent { border-color: var(--recent-border); color: var(--recent-ink); }
.distribution-banner.is-recent button:hover { background: var(--recent-bg); }
.distribution-banner button, .dialog-close {
  display: grid;
  flex: none;
  place-items: center;
  width: 33px;
  height: 33px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
}
.distribution-banner button:hover, .dialog-close:hover { background: var(--subtle); }
.map-legend {
  z-index: 900;
  right: 12px;
  bottom: 25px;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 8px 10px;
  font-size: .75rem;
  line-height: 1.35;
  pointer-events: none;
}
.map-legend h2 { margin-bottom: 4px; font-size: .8125rem; }
.map-legend ul { display: grid; grid-template-columns: repeat(2, auto); gap: 3px 8px; padding: 0; list-style: none; }
.map-legend li, .map-legend p { display: flex; align-items: center; gap: 5px; }
.map-legend .legend-boundaries { margin-top: 4px; }
.map-legend .legend-recent, .map-legend p { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); }
.map-legend p { color: var(--muted-ink); }
.legend-wetland { --habitat-color: var(--wetland); }
.legend-river { --habitat-color: var(--river); }
.legend-forest { --habitat-color: var(--forest); }
.legend-park { --habitat-color: var(--park); }
.legend-boundary-line { width: 15px; flex: none; border-top: 2px solid var(--primary-ink); }
.legend-boundary-dashed { border-top-style: dashed; border-top-color: #e07b24; }
.legend-recent-bird {
  display: grid;
  flex: none;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 1px solid var(--recent-marker-edge);
  border-radius: 50%;
  background: var(--recent-marker-fill);
}
.legend-recent-bird svg { width: 10px; height: 10px; fill: #fff; }
.legend-featured-star {
  display: grid;
  flex: none;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 1.5px solid #f2bc3d;
  border-radius: 50%;
  background: var(--wetland);
}
.legend-featured-star svg { width: 9px; height: 9px; fill: #fff8dc; }
.legend-recommended { width: 10px; height: 10px; flex: none; border: 1px solid var(--primary); border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--primary); }

.recent-marker {
  --recent-marker-fill: #c8372d;
  --recent-marker-edge: #fff;
  --recent-marker-ring: #c8372d;
  --recent-marker-size: 30px;
  --recent-marker-border: 2px;
  --recent-marker-scale: 1;
  --recent-marker-shadow: 0 0 0 1.4px var(--recent-marker-ring), 0 2px 6px #26182e66;
  --recent-label-bg: #fffdf9f2;
  --recent-label-ink: #1f2a24;
  --beacon-color: #e53924;
  --arrow-color: #e53924;
  display: grid;
  grid-template: 100% / 100%;
  place-items: center;
  overflow: visible;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.recent-marker.is-style-icon {
  --recent-marker-size: 24px;
  --recent-marker-shadow: 0 2px 5px #26182e66;
}
.recent-marker.is-level-one, .legend-recent-bird.is-protected {
  --recent-marker-fill: #c8372d;
  --recent-marker-edge: #ffd178;
  --recent-marker-ring: #c8372d;
  --recent-marker-size: 34px;
  --recent-marker-border: 2.4px;
  --recent-marker-shadow: 0 0 0 1.6px #c8372d, 0 3px 8px #3b190d75;
  --recent-label-bg: #fff7e8f7;
  --recent-label-ink: #8b1e16;
}
.recent-marker.is-style-icon.is-level-one {
  --recent-marker-size: 26px;
  --recent-marker-border: 2px;
  --recent-marker-shadow: 0 0 0 1px #ffffffdd, 0 2px 6px #3b190d70;
}
.recent-marker.is-level-two {
  --recent-marker-fill: #e06524;
  --recent-marker-edge: #fff3db;
  --recent-marker-ring: #e06524;
  --recent-marker-size: 32px;
  --recent-marker-border: 2.2px;
  --recent-marker-shadow: 0 0 0 1.5px #e06524, 0 2px 7px #3b190d68;
  --recent-label-bg: #fff9f0f5;
  --recent-label-ink: #8a3610;
}
.recent-marker.is-style-icon.is-level-two {
  --recent-marker-size: 24px;
  --recent-marker-border: 2px;
  --recent-marker-shadow: 0 2px 5px #3b190d66;
}
.recent-marker.is-uncommon, .legend-recent-bird.is-uncommon {
  --recent-marker-fill: #724a96;
  --recent-marker-edge: #fff;
  --recent-marker-ring: #724a96;
  --recent-marker-size: 28px;
  --recent-marker-border: 2px;
  --recent-marker-shadow: 0 0 0 1.2px #724a96, 0 2px 6px #26182e58;
  --recent-label-bg: #fcfafff0;
  --recent-label-ink: #3c2652;
}
.recent-marker.is-style-icon.is-uncommon {
  --recent-marker-size: 21px;
  --recent-marker-border: 1.8px;
  --recent-marker-shadow: 0 2px 5px #26182e58;
}
.recent-marker-chip,
.recent-marker-symbol {
  position: relative;
  z-index: 1;
  width: var(--recent-marker-size);
  height: var(--recent-marker-size);
  transform: scale(var(--recent-marker-scale));
  transition: transform var(--speed);
}
.recent-marker-symbol {
  display: grid;
  place-items: center;
  border: var(--recent-marker-border) solid var(--recent-marker-edge);
  border-radius: 50%;
  background: var(--recent-marker-fill);
  box-shadow: var(--recent-marker-shadow);
}
.recent-marker-symbol svg {
  position: relative;
  display: block;
  width: 84%;
  height: 84%;
  fill: #fff;
}
.recent-marker-thumb {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: var(--recent-marker-border) solid var(--recent-marker-edge);
  border-radius: 50%;
  background: var(--recent-marker-fill);
  box-shadow: var(--recent-marker-shadow);
}
.recent-marker-fallback,
.map .leaflet-pane svg.recent-marker-fallback {
  position: relative;
  z-index: 0;
  display: block;
  width: 72%;
  height: 72%;
  fill: #fff;
}
.recent-marker-img,
.map .leaflet-pane img.recent-marker-img {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 160ms ease;
}
.recent-marker-img.is-loaded,
.map .leaflet-pane img.recent-marker-img.is-loaded { opacity: 1; }
.recent-marker-thumb.has-photo .recent-marker-fallback,
.recent-bird-thumb.has-photo .recent-marker-fallback,
:is(.recent-marker-thumb, .recent-bird-thumb):has(.recent-marker-img.is-loaded) .recent-marker-fallback {
  display: none;
}
.recent-marker-name {
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 1px 5px;
  transform: translateX(-50%);
  border: 1px solid color-mix(in srgb, var(--recent-marker-ring) 48%, #fff);
  border-radius: 999px;
  background: var(--recent-label-bg);
  box-shadow: 0 1px 3px #18231d47;
  color: var(--recent-label-ink);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .01em;
  white-space: nowrap;
  pointer-events: none;
  transition: transform var(--speed), border-color var(--speed);
}
.recent-marker-count { font-size: 9px; font-weight: 700; opacity: .78; }
.recent-marker:where(.is-level-one, .is-level-two):not(.is-selected) :is(.recent-marker-chip, .recent-marker-symbol)::before {
  position: absolute;
  inset: -3px;
  border: 1.5px solid color-mix(in srgb, var(--recent-marker-fill) 52%, transparent);
  border-radius: 50%;
  animation: marker-pulse 2s ease-out infinite;
  pointer-events: none;
  content: "";
}
.recent-marker:hover :is(.recent-marker-chip, .recent-marker-symbol),
.recent-marker:focus-visible :is(.recent-marker-chip, .recent-marker-symbol) { --recent-marker-scale: 1.14; }
.recent-marker:hover .recent-marker-name,
.recent-marker:focus-visible .recent-marker-name {
  transform: translateX(-50%) translateY(2px);
  border-color: var(--recent-marker-ring);
}
.recent-marker.is-selected :is(.recent-marker-chip, .recent-marker-symbol) { --recent-marker-scale: 1.14; }
.recent-marker.is-selected :is(.recent-marker-thumb, .recent-marker-symbol) {
  box-shadow: 0 0 0 2.5px var(--arrow-color), 0 0 0 5px #ffffffdc, 0 4px 12px #3b190d80;
}
.recent-marker.is-selected .recent-marker-name {
  top: calc(100% + 6px);
  border-color: var(--arrow-color);
  background: #fff6f2fa;
  color: #8f1f17;
  font-size: 10.5px;
}
.recent-marker.is-selected.is-entering :is(.recent-marker-chip, .recent-marker-symbol) {
  animation: marker-pop .42s cubic-bezier(.22, 1.45, .45, 1) both;
}
.recent-marker:focus-visible { outline: 2px solid #502012; outline-offset: 0; }

.bird-marker {
  --beacon-color: #e05a24;
  --arrow-color: #e53924;
  display: grid;
  place-items: center;
  overflow: visible;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.bird-marker:focus-visible { outline: 2px solid #153d28; outline-offset: 0; }
.bird-marker-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--habitat-color, var(--primary));
  box-shadow: 0 1px 5px #1832288c;
  transition: opacity var(--speed), transform var(--speed), box-shadow var(--speed);
}
.bird-marker.is-featured .bird-marker-dot {
  width: 22px;
  height: 22px;
  border: 2.5px solid #f3be3f;
  box-shadow: 0 0 0 1.5px #fff, 0 2px 8px #18322899;
}
.featured-star-svg {
  display: block;
  width: 12px;
  height: 12px;
  fill: #fff9df;
  filter: drop-shadow(0 1px 1px #18322870);
}
.bird-marker.is-muted .bird-marker-dot, .bird-marker-dot.is-muted { opacity: .45; }
.bird-marker.is-distribution-other .bird-marker-dot { opacity: .22; }
.bird-marker.is-distribution-match::before {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2.5px solid #173f2c;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px #fff;
  content: "";
}
.bird-marker.has-pointer .bird-marker-dot {
  opacity: 1;
  transform: scale(1.42);
  border-width: 2.5px;
  box-shadow: 0 0 0 3px var(--arrow-color), 0 0 0 5.5px #ffffffe6, 0 4px 12px #1a120d66;
}
.bird-marker.has-pointer.is-entering .bird-marker-dot {
  animation: marker-pop-dot .42s cubic-bezier(.22, 1.45, .45, 1) both;
}
.bird-marker.has-pointer::before { display: none; }
.bird-marker.is-recommended .bird-marker-dot, .bird-marker-dot.is-recommended { transform: scale(1.24); }
.bird-marker.is-recommended.has-pointer .bird-marker-dot { transform: scale(1.45); }
.bird-marker.is-recommended .bird-marker-dot::after, .bird-marker-dot.is-recommended::after {
  position: absolute;
  inset: -3px;
  border: 1px solid var(--habitat-color, var(--primary));
  border-radius: 50%;
  animation: marker-pulse 2s ease-out infinite;
  content: "";
}
.bird-marker:hover .bird-marker-dot, .bird-marker.is-hovered .bird-marker-dot, .bird-marker.is-selected .bird-marker-dot,
.bird-marker-dot.is-hovered, .bird-marker-dot.is-selected { opacity: 1; transform: scale(1.36); box-shadow: 0 0 0 2px #173f2c, 0 2px 7px #173f2c62; }

.marker-beacon, .marker-arrow { display: none; pointer-events: none; }
.bird-marker.has-pointer .marker-beacon,
.recent-marker.is-selected .marker-beacon {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
}
.marker-beacon::before, .marker-beacon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 3px solid var(--beacon-color, #e53924);
  border-radius: 50%;
  background: color-mix(in srgb, var(--beacon-color, #e53924) 22%, transparent);
  animation: target-sonar 1.5s cubic-bezier(.16, .74, .28, 1) infinite;
  content: "";
}
.marker-beacon::after { animation-delay: .75s; }

.bird-marker.has-pointer .marker-arrow,
.recent-marker.has-pointer .marker-arrow {
  position: absolute;
  bottom: calc(100% - 2px);
  left: 50%;
  z-index: 3;
  display: block;
  width: 28px;
  height: 32px;
  margin-left: -14px;
  transform-origin: center bottom;
  animation: marker-arrow-bounce .85s ease-in-out infinite;
}
.recent-marker.has-pointer .marker-arrow { bottom: calc(100% + 5px); }
.marker-arrow svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: var(--arrow-color, #e53924);
  stroke: #fff;
  stroke-width: 2.2;
  stroke-linejoin: round;
  filter: drop-shadow(0 3px 4px #24130b85);
}

@keyframes marker-pulse {
  0% { opacity: .9; transform: scale(.85); }
  75%, 100% { opacity: 0; transform: scale(1.9); }
}
@keyframes target-sonar {
  0% { opacity: .95; transform: scale(.72); }
  100% { opacity: 0; transform: scale(3.15); }
}
@keyframes marker-arrow-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-13px) scale(1.08); }
  78% { transform: translateY(2px) scale(.95, 1.05); }
}
@keyframes marker-pop {
  0% { transform: scale(.45); }
  65% { transform: scale(1.26); }
  100% { transform: scale(var(--recent-marker-scale, 1)); }
}
@keyframes marker-pop-dot {
  0% { transform: scale(.65); }
  65% { transform: scale(1.72); }
  100% { transform: scale(1.42); }
}
.bird-popup { min-width: 145px; padding: 0 8px 0 0; text-align: start; }
.bird-popup .popup-title { color: #1f2a24; font-size: 1rem; font-weight: 700; }
.bird-popup .popup-meta { margin: 5px 0 8px; color: #55645b; font-size: .8125rem; }
.bird-popup .popup-detail { --paper: #f1f5ee; --primary-ink: #285b43; --border: #d8e4da; }
.recent-popup {
  --recent-bg: #ffede1;
  --recent-ink: #92351e;
  --accent-bg: #faecd8;
  --accent-ink: #794b22;
  --muted-ink: #55645b;
  min-width: 195px;
}
.recent-popup-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
}
.recent-popup-info { flex: 1; min-width: 0; }
.recent-popup-info .species-scientific { margin: 2px 0 0; }
.recent-popup p { margin: 4px 0; }
.recent-popup .spot-card-title { flex-wrap: wrap; gap: 4px 6px; }
.recent-popup .popup-meta .badge { margin-inline-start: 6px; }
.recent-popup a { display: inline-block; margin-top: 2px; font-weight: 650; }
.news-popup {
  --text: #1f2a24;
  --muted-ink: #55645b;
  --primary-ink: #285b43;
  --paper: #fffefa;
  --subtle: #ebefe7;
  --accent-bg: #faecd8;
  --accent-ink: #794b22;
  --news-social-bg: #ffebee;
  --news-social-ink: #d21b43;
  display: grid;
  gap: 5px;
  max-width: 250px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.news-popup p { margin: 0; }
.news-popup > .news-badge { justify-self: start; }
.news-popup .news-popup-actions { margin-top: 2px; }
.news-popup .news-popup-actions a { color: var(--primary-ink); }

.site-footer {
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 6px 12px max(6px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--paper);
  color: var(--muted-ink);
  font-size: .75rem;
  text-align: center;
}
.etiquette-dialog {
  width: min(31rem, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 20px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--text);
  box-shadow: var(--shadow);
}
.etiquette-dialog::backdrop { background: #14251ccd; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.dialog-heading h2 { color: var(--primary-ink); font-size: 1.35rem; }
.etiquette-dialog ul { display: grid; gap: 9px; padding-inline-start: 1.4em; }
.etiquette-dialog li::marker { color: var(--primary-ink); }
.news-dialog { width: min(34rem, calc(100% - 24px)); }
.news-form { display: grid; gap: 10px; }
.news-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.news-field { display: grid; align-content: start; gap: 4px; min-width: 0; }
.news-field label { color: var(--text); font-size: .875rem; font-weight: 650; }
.news-field :is(input, select, textarea) {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.news-field textarea { resize: vertical; }
.news-field :is(input, textarea)::placeholder { color: var(--muted-ink); opacity: 1; }
.news-form-hint, .news-form-error { font-size: .8125rem; }
.news-form-hint { color: var(--muted-ink); }
.news-form-error {
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--news-social-bg);
  color: var(--news-social-ink);
}
.news-form-actions { display: flex; justify-content: flex-end; }
.news-form-actions .news-add-button { min-height: 40px; padding-inline: 14px; font-size: .875rem; }
.toast {
  position: fixed;
  z-index: 1200;
  bottom: max(50px, calc(env(safe-area-inset-bottom) + 42px));
  left: 50%;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 9px 14px;
  transform: translateX(-50%);
  border: 1px solid #ffffff45;
  border-radius: 10px;
  background: var(--header-bg);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: .875rem;
  text-align: center;
}

@media (max-width: 899.98px) {
  :root { --sheet-collapsed: calc(106px + env(safe-area-inset-bottom)); }
  body { grid-template-rows: auto minmax(0, 1fr); }
  .site-footer { display: none; }
  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 8px;
    min-height: 0;
    padding: max(6px, env(safe-area-inset-top)) 10px 6px;
  }
  .header-brand { gap: 7px; }
  .brand-icon { width: 32px; height: 32px; border-radius: 9px; }
  .brand-icon svg { width: 24px; height: 24px; }
  .header-brand h1 { font-size: 1.0625rem; letter-spacing: .03em; }
  .etiquette-button {
    grid-column: 2;
    grid-row: 1;
    min-height: 32px;
    gap: 4px;
    padding: 3px 8px;
    font-size: .8125rem;
  }
  .etiquette-button svg { width: 15px; height: 15px; }
  .season-bar {
    grid-column: 1 / -1;
    justify-content: space-between;
    gap: 6px;
    padding: 1px 0 2px;
    margin-inline: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .season-bar::-webkit-scrollbar { display: none; }
  .season-controls { padding: 2px; border-radius: 9px; }
  .season-controls button { min-width: 31px; min-height: 29px; padding: 2px 6px; font-size: .8125rem; }
  .local-season { gap: 3px; font-size: .75rem; }
  .workspace { display: block; }
  .map-stage { position: absolute; inset: 0; }
  /* 手机端保留紧凑 +/- 缩放按钮，其余悬浮控件全部收纳到底部设置，释放最大地图视野。 */
  .map .leaflet-control-layers,
  .map .roads-control,
  .map .recent-control-panel,
  .reset-view,
  .map-legend {
    display: none !important;
  }
  .map .leaflet-control-zoom {
    margin-top: 8px;
    margin-left: 8px;
    border-radius: 8px;
  }
  .map .leaflet-control-zoom a {
    width: 30px;
    height: 30px;
    line-height: 29px;
    font-size: 16px;
  }
  .map .leaflet-control-attribution {
    padding: 0 5px;
    font-size: 10px;
    line-height: 1.4;
    opacity: .78;
  }
  .map .leaflet-popup-close-button {
    width: 30px;
    height: 30px;
    font-size: 18px;
    line-height: 28px;
  }
  .distribution-banner, .map-warning {
    top: 8px;
    left: 46px;
    right: 8px;
    width: auto;
    max-width: none;
    transform: none;
    overflow-wrap: anywhere;
  }
  .distribution-banner {
    justify-content: space-between;
    min-height: 36px;
    padding: 3px 4px 3px 10px;
    font-size: .8125rem;
    line-height: 1.35;
  }
  .distribution-banner span { min-width: 0; }
  .distribution-banner button { width: 32px; height: 32px; }
  .map-stage:has(.distribution-banner:not([hidden])) .map-warning { top: 50px; }

  .sidebar {
    position: absolute;
    inset: calc(100% - var(--sheet-collapsed)) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 18px #243d3026;
    transition: inset-block-start var(--speed);
    overflow: hidden;
  }
  .sidebar[data-sheet="half"] { inset-block-start: 44%; }
  .sidebar[data-sheet="full"] { inset-block-start: 0; border-radius: 0; }
  .sidebar[data-sheet="collapsed"] .sidebar-scroll { visibility: hidden; }
  .sidebar:not([data-sheet="collapsed"]) .sheet-quick-tabs { display: none; }
  .sidebar[data-settings="open"] .sidebar-scroll > :not(#mobile-settings-panel):not(.sidebar-footer-note) {
    display: none;
  }
  .sheet-toggle {
    display: grid;
    flex: none;
    place-items: center;
    width: 100%;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 16px 16px 0 0;
    background: transparent;
    touch-action: none;
  }
  .sheet-toggle span { width: 38px; height: 4px; border-radius: 999px; background: var(--muted); }
  .sheet-toggle:focus-visible { outline-offset: -3px; }
  .search-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px 8px;
  }
  .search-box {
    flex: 1;
    min-width: 0;
    min-height: 38px;
    gap: 7px;
    padding: 0 10px;
    border-radius: 10px;
  }
  .search-box svg { width: 17px; height: 17px; }
  .search-box input { min-height: 36px; font-size: 16px; }
  .mobile-settings-toggle {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--paper);
    color: var(--primary-ink);
    font-size: .8125rem;
    font-weight: 700;
    white-space: nowrap;
    transition: border-color var(--speed), background-color var(--speed), color var(--speed);
  }
  .mobile-settings-toggle svg { width: 16px; height: 16px; flex: none; }
  .mobile-settings-toggle[aria-pressed="true"] {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
  }
  .sheet-quick-tabs {
    display: grid;
    flex: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 0 10px 8px;
  }
  .sheet-quick-tabs button {
    min-height: 30px;
    padding: 3px 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--paper);
    color: var(--muted-ink);
    font-size: .8125rem;
    font-weight: 650;
    white-space: nowrap;
  }
  .sheet-quick-tabs button[aria-pressed="true"] {
    border-color: var(--primary);
    background: var(--subtle);
    color: var(--primary-ink);
  }
  .sidebar-scroll { padding: 0 12px 18px; }
  .select-shell select,
  .news-field :is(input, select, textarea) { font-size: 16px; }
  .mobile-settings-panel:not([hidden]) {
    display: grid;
    gap: 12px;
    padding-top: 2px;
  }
  .mobile-settings-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .mobile-settings-head h2 { color: var(--primary-ink); font-size: 1rem; }
  .mobile-settings-group {
    display: grid;
    gap: 8px;
    padding: 10px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--paper);
  }
  .mobile-settings-group h3 { color: var(--muted-ink); font-size: .8125rem; font-weight: 700; }
  .mobile-segmented {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--subtle);
  }
  .mobile-segmented.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-segmented button {
    min-height: 34px;
    padding: 4px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted-ink);
    font-size: .8125rem;
    font-weight: 650;
    white-space: nowrap;
  }
  .mobile-segmented button[aria-pressed="true"] {
    background: var(--paper);
    color: var(--primary-ink);
    box-shadow: 0 1px 3px #253b301f;
  }
  .mobile-segmented button:disabled { opacity: .48; }
  .mobile-toggle-row, .mobile-style-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 38px;
    font-size: .875rem;
    font-weight: 600;
  }
  .mobile-toggle-row { cursor: pointer; }
  .mobile-toggle-row input {
    width: 19px;
    height: 19px;
    margin: 0;
    flex: none;
    accent-color: var(--primary);
  }
  .mobile-toggle-row:has(input:disabled) { opacity: .6; cursor: default; }
  .mobile-toggle-hint { color: var(--muted-ink); font-size: .75rem; font-weight: 400; }
  .mobile-style-row > span { flex: none; }
  .mobile-style-row .mobile-segmented { min-width: 146px; }
  .mobile-legend-grid { display: grid; gap: 6px; font-size: .75rem; line-height: 1.4; }
  .mobile-legend-grid ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 10px;
    padding: 0;
    list-style: none;
  }
  .mobile-legend-grid ul + ul { padding-top: 6px; border-top: 1px solid var(--border); }
  .mobile-legend-grid li { display: flex; align-items: center; gap: 6px; }
  .mobile-settings-actions { display: grid; }
  .mobile-settings-actions .action-button { justify-content: center; width: 100%; }
  .sidebar-footer-note {
    display: block;
    margin-top: 16px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    color: var(--muted-ink);
    font-size: .75rem;
    line-height: 1.5;
    text-align: center;
  }
  .workspace:has(.sidebar[data-sheet="full"]) .map-stage { visibility: hidden; }
  .map .leaflet-bottom { bottom: var(--sheet-collapsed); }
  .workspace:has(.sidebar[data-sheet="half"]) .map .leaflet-bottom { bottom: 56%; }
  .toast { bottom: calc(var(--sheet-collapsed) + 12px); }
}

@media (min-width: 900px) and (max-width: 1024px) {
  /* Reserve a lane for the layer controls on the right and zoom on the left. */
  .distribution-banner, .map-warning { transform: none; overflow-wrap: anywhere; }
  .distribution-banner { left: 54px; max-width: calc(100% - 184px); }
  .map-stage:has(.leaflet-control-layers-expanded) .distribution-banner { max-width: calc(100% - 234px); }
  .map-warning { top: 130px; left: 12px; max-width: calc(100% - 192px); }
}

@media (max-width: 640px) {
  /* 手机窄屏下按比例缩小地图标记，减少高密度区重叠，同时保留清晰可读性。 */
  .recent-marker { --recent-marker-size: 26px; }
  .recent-marker.is-level-one { --recent-marker-size: 30px; --recent-marker-border: 2px; }
  .recent-marker.is-level-two { --recent-marker-size: 28px; --recent-marker-border: 2px; }
  .recent-marker.is-uncommon { --recent-marker-size: 24px; --recent-marker-border: 1.8px; }
  .recent-marker.is-style-icon { --recent-marker-size: 22px; }
  .recent-marker.is-style-icon.is-level-one { --recent-marker-size: 24px; }
  .recent-marker.is-style-icon.is-level-two { --recent-marker-size: 22px; }
  .recent-marker.is-style-icon.is-uncommon { --recent-marker-size: 19px; }
  .recent-marker-name { padding: 0 4px; font-size: 9.5px; line-height: 1.35; }
  .recent-marker-count { font-size: 8.5px; }
  .bird-marker-dot { width: 13px; height: 13px; }
  .bird-marker.is-featured .bird-marker-dot { width: 19px; height: 19px; border-width: 2px; }
  .featured-star-svg { width: 10px; height: 10px; }
  .recent-bird-thumb { --avatar-size: 36px; }
  .recent-bird-thumb.is-popup { --avatar-size: 44px; }
  .recent-popup { min-width: 170px; }
  .etiquette-dialog, .news-dialog {
    width: min(34rem, calc(100% - 16px));
    max-height: calc(100dvh - 24px);
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .news-form-row { grid-template-columns: 1fr; }
  .detail-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-actions .action-button { justify-content: center; padding-inline: 8px; font-size: .8125rem; }
  .recent-card { gap: 8px; padding: 9px 10px; }
}

@media (pointer: coarse) {
  .recent-marker::after {
    position: absolute;
    inset: -5px;
    content: "";
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --speed: 0ms; }
  .recent-refresh.is-syncing svg { animation: none; }
  .bird-marker.is-recommended .bird-marker-dot::after, .bird-marker-dot.is-recommended::after,
  .recent-marker:where(.is-level-one, .is-level-two):not(.is-selected) :is(.recent-marker-chip, .recent-marker-symbol)::before {
    opacity: .8;
    animation: none;
  }
  .marker-beacon::before {
    opacity: .55;
    transform: scale(1.75);
    animation: none;
  }
  .marker-beacon::after { display: none; }
  .marker-arrow,
  .bird-marker.has-pointer.is-entering .bird-marker-dot,
  .recent-marker.is-selected.is-entering :is(.recent-marker-chip, .recent-marker-symbol) {
    animation: none;
  }
}
