.modal[hidden] { display: none; }
.modal {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(22,39,32,0.62); backdrop-filter: blur(5px); }
.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(860px, 92dvh);
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.78);
  border-radius: 24px;
  background: rgba(245,247,242,0.98);
  box-shadow: 0 30px 80px rgba(0,0,0,0.32);
  overscroll-behavior: contain;
}
.modal-close {
  position: sticky;
  z-index: 3;
  top: 12px;
  float: right;
  width: 42px;
  height: 42px;
  margin: 12px 12px -54px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: white;
  background: rgba(63,99,60,0.94);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}
.modal-body { padding: clamp(22px, 5vw, 38px); }
.modal-kicker { margin: 0 0 0.4rem; color: var(--brick); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; }
.modal-body h2 { margin: 0 0 0.8rem; padding-right: 48px; font-family: STKaiti, KaiTi, "Microsoft YaHei", sans-serif; font-size: clamp(1.55rem, 5vw, 2.2rem); }
.modal-description { color: var(--ink-soft); line-height: 1.78; white-space: pre-line; }
.baike-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: -0.3rem 0 0.9rem; }
.baike-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.55rem 1rem;
  border: 1px solid rgba(63,99,60,0.32);
  border-radius: 999px;
  color: var(--moss-dark);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}
.baike-button:hover { border-color: rgba(63,99,60,0.6); background: rgba(63,99,60,0.06); }
.baike-button::before {
  content: "百";
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  color: white;
  background: #3156d9;
  font-size: 0.62rem;
  font-weight: 900;
}
.baike-button.is-image::before { content: "图"; background: #25a56a; }
.media-section { margin-top: 1.4rem; }
.media-section h3 { margin-bottom: 0.65rem; font-size: 0.95rem; }
.image-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.image-gallery img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 14px; background: #e2ebdf; }
.media-section audio, .media-section video { display: block; width: 100%; }
.media-section video { max-height: 430px; border-radius: 14px; background: #1b211d; }
.media-note { color: var(--ink-soft); font-size: 0.76rem; }
body.modal-open { overflow: hidden; }

.navigation-sheet[hidden] { display: none; }
.navigation-sheet {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 18px;
}
.navigation-backdrop { position: absolute; inset: 0; background: rgba(22,39,32,0.58); backdrop-filter: blur(5px); }
.navigation-dialog {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(720px, calc(100dvh - 36px));
  overflow-y: auto;
  padding: 22px;
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 24px;
  background: rgba(245,247,242,0.98);
  box-shadow: 0 30px 80px rgba(0,0,0,0.3);
  animation: modal-rise 220ms ease-out both;
}
.navigation-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.navigation-heading p { margin: 0 0 3px; color: var(--brick); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em; }
.navigation-heading h2 { margin: 0; font-family: STKaiti, KaiTi, "Microsoft YaHei", sans-serif; font-size: 1.45rem; }
.navigation-heading > button { width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; color: white; background: var(--moss-dark); font-size: 1.45rem; cursor: pointer; }
.navigation-hint { display: none; }
.navigation-options { display: grid; gap: 8px; }
.navigation-options > button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid rgba(36,52,47,0.12);
  border-radius: 15px;
  color: var(--ink);
  background: rgba(255,255,255,0.62);
  text-align: left;
  cursor: pointer;
}
.navigation-options > button[hidden] { display: none; }
.navigation-options > button:hover { border-color: rgba(63,99,60,0.38); background: white; }
.navigation-options > button.is-unavailable { opacity: 0.64; }
.navigation-options > button > span:nth-child(2) { display: grid; gap: 2px; }
.navigation-options strong { font-size: 0.86rem; }
.navigation-options small { color: var(--ink-soft); font-size: 0.67rem; }
.navigation-options i { color: var(--ink-soft); font-size: 1.35rem; font-style: normal; }
.provider-mark { width: 38px; height: 38px; border-radius: 12px 12px 12px 4px; object-fit: cover; }
.provider-amap { background: #1688e8; }
.provider-baidu { background: #3156d9; }
.provider-tencent { background: #25a56a; }
.provider-apple { background: #252c29; font-family: Arial, sans-serif; }
.copy-place-button { width: 100%; margin-top: 12px; padding: 0.74rem; border: 0; border-radius: 999px; color: var(--moss-dark); background: #e2ebdf; font-size: 0.78rem; font-weight: 800; cursor: pointer; }
.navigation-status { display: block; min-height: 1.4em; margin-top: 10px; color: var(--brick); font-size: 0.76rem; text-align: center; }
body.navigation-open { overflow: hidden; }

@media (max-width: 720px) {
  .navigation-sheet { padding: 0; }
  .navigation-dialog { width: 100%; max-height: 86dvh; padding: 19px 16px calc(16px + env(safe-area-inset-bottom)); border-width: 1px 0 0; border-radius: 24px 24px 0 0; }
  .navigation-dialog::before { content: ""; display: block; width: 42px; height: 4px; margin: -10px auto 10px; border-radius: 999px; background: rgba(36,52,47,0.22); }
}

@media (max-width: 720px) {
  .modal { place-items: end center; padding: 0; }
  .modal-dialog {
    width: 100%;
    max-height: min(78dvh, 760px);
    border-width: 1px 0 0;
    border-radius: 24px 24px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: modal-rise 240ms ease-out both;
  }
  .modal-dialog::before { content: ""; display: block; width: 42px; height: 4px; margin: 8px auto -4px; border-radius: 999px; background: rgba(36,52,47,0.22); }
}

@keyframes modal-rise { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
