:root {
  --text: #17324d;
  --muted: #71839a;
  --panel: rgba(255, 255, 255, .97);
  --border: #e6edf5;
  --blue: #2367c9;
  --red: #ed3815;
  --point: #e94141;
  --shadow: 0 8px 24px rgba(20, 40, 70, .14);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body,
#map {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--text);
  overscroll-behavior: none;
}

button,
input {
  font: inherit;
}

button {
  touch-action: manipulation;
}

#cover {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(22px, var(--safe-top)) max(22px, var(--safe-right)) max(22px, var(--safe-bottom)) max(22px, var(--safe-left));
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .16), transparent 26%),
    linear-gradient(135deg, #0d2b4c, #1b6192);
  color: #fff;
}

#cover.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}

.cover-card {
  width: min(760px, calc(100vw - 44px));
  padding: 36px 34px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .28);
  backdrop-filter: blur(16px);
}

.cover-card h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 7vw, 58px);
  font-weight: 800;
}

.cover-card p {
  margin: 0;
  line-height: 1.8;
  color: rgba(255, 255, 255, .9);
}

#enterBtn {
  min-height: 44px;
  margin-top: 24px;
  border: 0;
  border-radius: 14px;
  padding: 13px 20px;
  background: #fff;
  color: #12395e;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.topbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 382px;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.title-pill,
.tool-btn,
.search-box {
  pointer-events: auto;
  background: var(--panel);
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.title-pill {
  padding: 11px 14px;
  font-weight: 800;
  white-space: nowrap;
}

.tool-btn {
  min-height: 40px;
  padding: 10px 14px;
  color: #15304b;
  cursor: pointer;
  font-weight: 700;
}

.tool-btn:active {
  transform: translateY(1px);
}

.search-box {
  margin-left: auto;
  width: min(300px, 36vw);
  min-height: 40px;
  padding: 10px 12px;
  outline: none;
  color: var(--text);
}

.search-box:focus {
  border-color: rgba(35, 103, 201, .45);
  box-shadow: 0 0 0 3px rgba(35, 103, 201, .12), var(--shadow);
}

.panel-toggle,
.mobile-mask {
  display: none;
}

#panel {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1200;
  width: 360px;
  height: 100%;
  background: var(--panel);
  border-left: 1px solid rgba(0, 0, 0, .08);
  box-shadow: -8px 0 26px rgba(0, 0, 0, .14);
  display: flex;
  flex-direction: column;
}

.panel-head {
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-size: 18px;
  font-weight: 800;
}

.panel-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.folder-list {
  flex: 1;
  overflow: auto;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}

.folder {
  border: 1px solid var(--border);
  border-radius: 13px;
  margin-bottom: 10px;
  overflow: hidden;
  background: #fff;
}

.folder-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 13px;
  cursor: pointer;
  background: #fbfdff;
}

.folder-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-weight: 800;
}

.folder-title span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-icon {
  flex: 0 0 auto;
  width: 15px;
  height: 12px;
  background: #f2c94c;
  border: 1px solid #d5a300;
  border-radius: 2px;
  position: relative;
}

.folder-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  top: -5px;
  width: 9px;
  height: 5px;
  background: #f6d46d;
  border: 1px solid #d5a300;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
}

.folder-count {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef4fb;
  color: #65788d;
  font-size: 12px;
}

.folder-body {
  display: none;
  padding: 0 10px 10px;
}

.folder.open .folder-body {
  display: block;
}

.resource-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 7px;
  padding: 9px 8px;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  cursor: pointer;
}

.resource-row:hover,
.resource-row.active {
  background: #eff7ff;
  border-color: #cfe3fb;
}

.resource-seq {
  color: #1d5ea5;
  font-weight: 900;
  text-align: center;
}

.resource-name {
  font-weight: 800;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
}

.region-label {
  padding: 7px 10px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 999px;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .14);
  font-weight: 800;
  color: #14314e;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.region-label.active {
  background: #4B5563;
  border-color: rgba(17, 24, 39, .22);
  color: #fff;
}

.asset-marker {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.asset-marker.label-left {
  justify-content: flex-end;
}

.asset-marker.label-left .asset-name {
  text-align: right;
}

.asset-marker.dim {
  opacity: .25;
}

.asset-dot {
  width: 14px;
  height: 14px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--point);
  box-shadow: 0 2px 8px rgba(230, 50, 50, .5);
}

.asset-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 800;
  color: #14314e;
  text-shadow: 0 0 4px #fff, 0 0 10px #fff;
}

.asset-marker.active .asset-dot {
  width: 17px;
  height: 17px;
  background: var(--blue);
}

.popup {
  position: absolute;
  z-index: 1500;
  width: 310px;
  max-width: calc(100vw - 28px);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
  padding: 13px;
  display: none;
}

.popup.open {
  display: block;
}

.popup-close {
  position: absolute;
  right: 8px;
  top: 6px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.popup-close:active {
  background: #f0f4f8;
}

.popup-title {
  font-size: 16px;
  font-weight: 900;
  padding-right: 34px;
  line-height: 1.45;
}

.popup-meta {
  margin-top: 7px;
  display: grid;
  gap: 4px;
  color: #334b65;
  font-size: 12px;
  line-height: 1.5;
}

.popup-desc {
  margin-top: 9px;
  padding: 9px;
  max-height: 130px;
  overflow: auto;
  border-radius: 10px;
  background: #f8fbff;
  border: 1px solid #e8eef7;
  font-size: 12px;
  line-height: 1.6;
  -webkit-overflow-scrolling: touch;
}

.popup img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center center;
  border-radius: 10px;
  margin-top: 10px;
  background: #f8fbff;
}

.loading {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 1600;
  background: rgba(255, 255, 255, .92);
  border-radius: 12px;
  padding: 10px 12px;
  color: #5c6e80;
  font-size: 13px;
  box-shadow: var(--shadow);
}


.quick-filters {
  position: absolute;
  top: 66px;
  left: 14px;
  right: 382px;
  z-index: 1120;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}

.quick-filter-row {
  width: auto;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.region-filter-row,
.outside-area-filter-row {
  display: none;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 7px;
  width: 158px;
  max-height: none;
  overflow: visible;
  padding: 2px 0 6px 2px;
}

.quick-filters.region-menu-open .region-filter-row,
.quick-filters.outside-menu-open .outside-area-filter-row {
  display: flex;
}

.filter-chip {
  --chip-color: #2367c9;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  max-width: 174px;
  padding: 7px 10px;
  border: 1px solid rgba(0, 0, 0, .07);
  border-radius: 999px;
  background: rgba(255, 255, 255, .96);
  color: #16324e;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.region-filter-row .filter-chip,
.outside-area-filter-row .filter-chip {
  justify-content: flex-start;
  width: 150px;
  max-width: 150px;
}

.filter-chip:active {
  transform: translateY(1px);
}

.filter-chip.active {
  border-color: rgba(13, 43, 76, .22);
  background: #0d2b4c;
  color: #fff;
}

.chip-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--chip-color);
  box-shadow: 0 0 0 3px rgba(35, 103, 201, .16);
}

.filter-chip.active .chip-dot {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .24);
}

.chip-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-count {
  flex: 0 0 auto;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(13, 43, 76, .08);
  color: #5f7185;
  font-size: 11px;
  line-height: 1.45;
}

.filter-chip.active .chip-count {
  background: rgba(255, 255, 255, .2);
  color: #fff;
}

.folder-head {
  position: relative;
}

.folder-head::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--region-color, #2367c9);
}

.folder-icon,
.folder-icon::before {
  background: rgba(255, 255, 255, .88);
  border-color: var(--region-color, #d5a300);
}

@media (max-width: 900px) {
  .topbar {
    position: fixed;
    top: calc(10px + var(--safe-top));
    left: calc(10px + var(--safe-left));
    right: calc(10px + var(--safe-right));
    z-index: 1800;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
  }

  .title-pill {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tool-btn {
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 13px;
  }

  .panel-toggle {
    display: inline-block;
  }

  .search-box {
    order: 5;
    display: block;
    flex: 1 0 100%;
    width: 100%;
    min-height: 42px;
    margin-left: 0;
    padding: 10px 12px;
    font-size: 14px;
  }

  #panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: auto;
    width: min(88vw, 390px);
    height: 100vh;
    height: 100dvh;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    border-left: 1px solid rgba(0, 0, 0, .08);
    border-top: 0;
    transform: translateX(105%);
    transition: transform .26s ease;
    z-index: 2200;
  }

  #panel.open {
    transform: translateX(0);
  }

  .panel-head {
    padding: 14px 14px 10px;
  }

  .panel-title {
    font-size: 17px;
  }

  .folder-list {
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px;
  }

  .folder {
    width: 100%;
    min-width: 0;
    margin-bottom: 10px;
  }

  .folder-head {
    min-height: 50px;
  }

  .resource-row {
    min-height: 48px;
    padding: 10px 8px;
  }

  .mobile-mask {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 2100;
    background: rgba(7, 20, 34, .34);
  }

  .mobile-mask.open {
    display: block;
  }

  .region-label {
    padding: 6px 9px;
    font-size: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .14);
  }

  .asset-dot {
    width: 16px;
    height: 16px;
  }

  .asset-name {
    max-width: 112px;
    font-size: 12px;
  }

  .popup {
    position: fixed !important;
    left: calc(12px + var(--safe-left)) !important;
    right: calc(12px + var(--safe-right)) !important;
    top: auto !important;
    bottom: calc(12px + var(--safe-bottom)) !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(70vh, 560px);
    max-height: min(70dvh, 560px);
    overflow: auto;
    z-index: 2400;
  }

  .popup-desc {
    max-height: 28vh;
    max-height: 28dvh;
  }

  .popup img {
    max-height: none;
  }

  .loading {
    left: calc(12px + var(--safe-left));
    right: calc(12px + var(--safe-right));
    bottom: calc(14px + var(--safe-bottom));
    text-align: center;
  }

  .quick-filters {
    position: fixed;
    top: var(--topbar-bottom, calc(112px + var(--safe-top)));
    left: calc(10px + var(--safe-left));
    right: auto;
    z-index: 1750;
    align-items: flex-start;
    gap: 7px;
    max-width: calc(100vw - 20px - var(--safe-left) - var(--safe-right));
  }

  .quick-filter-row {
    justify-content: flex-start;
  }

  .group-filter-row {
    flex-wrap: nowrap;
  }

  .region-filter-row,
  .outside-area-filter-row {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 7px;
    width: 158px;
    max-height: none;
    overflow: visible;
    padding: 2px 0 6px 2px;
  }

  .filter-chip {
    min-height: 36px;
    max-width: 150px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
  }

  .group-filter-row .filter-chip {
    min-width: 86px;
  }

  .region-filter-row .filter-chip,
  .outside-area-filter-row .filter-chip {
    width: 150px;
    max-width: 150px;
    justify-content: flex-start;
  }

}

@media (max-width: 600px) {

  .quick-filters {
    gap: 6px;
  }

  .filter-chip {
    max-width: 132px;
    padding-left: 9px;
    padding-right: 9px;
  }

  .region-filter-row .filter-chip,
  .outside-area-filter-row .filter-chip {
    width: 150px;
    max-width: 150px;
  }

  .chip-count {
    min-width: 20px;
    padding-left: 5px;
    padding-right: 5px;
  }
  .cover-card {
    width: 100%;
    padding: 28px 22px;
    border-radius: 20px;
  }

  .cover-card h1 {
    font-size: clamp(32px, 12vw, 46px);
  }

  .cover-card p {
    font-size: 14px;
  }

  #enterBtn {
    width: 100%;
  }

  .title-pill {
    flex-basis: 100%;
  }

  .tool-btn {
    flex: 1 1 0;
    padding-left: 8px;
    padding-right: 8px;
  }

  .asset-name {
    display: inline-block;
    max-width: 142px;
  }

  #panel {
    width: min(92vw, 390px);
  }
}

@media (orientation: landscape) and (max-width: 900px) {

  .quick-filters {
    top: var(--topbar-bottom, calc(58px + var(--safe-top)));
    left: calc(12px + var(--safe-left));
    right: auto;
  }

  .region-filter-row,
  .outside-area-filter-row {
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: 158px;
    max-height: none;
    overflow: visible;
  }
  .topbar {
    right: calc(12px + var(--safe-right));
  }

  .title-pill {
    flex: 0 1 auto;
  }

  .search-box {
    flex-basis: 260px;
    order: 0;
  }

  .popup {
    left: auto !important;
    width: min(380px, 42vw) !important;
    max-height: calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom));
  }
}
