/* 通辽智慧农牧服务平台 · 共享 GIS 统一设计层
   参考土流平台 TopNavigation.vue 的 58px 玻璃顶栏、34px 官方品牌位、
   荧光绿状态胶囊、OpenDesign 缓动与无障碍降级规则。 */

:root {
  --gis-od-ink: #262626;
  --gis-od-ink-2: #434343;
  --gis-od-muted: #707070;
  --gis-od-pine: #0d5400;
  --gis-od-green: #218c00;
  --gis-od-neon: #5ad11f;
  --gis-od-lime: #87f24c;
  --gis-od-canvas: #fdfff7;
  --gis-od-line: rgba(38, 38, 38, 0.08);
  --gis-od-glass: rgba(255, 255, 255, 0.48);
  --gis-od-ease: cubic-bezier(0.23, 1, 0.32, 1);
  --gis-od-topbar-height: 58px;
}

/* 深色主题：与主平台 OpenDesign 暖墨黑基底保持同一套 token。 */
html:root.dark {
  color-scheme: dark;
  --gis-od-ink: #f2f4ef;
  --gis-od-ink-2: #d7dbd3;
  --gis-od-muted: #a5afa1;
  --gis-od-pine: #a9ff77;
  --gis-od-green: #83ff3b;
  --gis-od-neon: #83ff3b;
  --gis-od-lime: #a9ff77;
  --gis-od-canvas: #0d0f0b;
  --gis-od-line: #30332d;
  --gis-od-glass: rgba(23, 25, 21, 0.82);
}

.gis-od-topbar {
  position: relative;
  isolation: isolate;
  min-height: var(--gis-od-topbar-height);
  overflow: hidden;
  border-bottom: 1px solid var(--gis-od-line);
  background:
    radial-gradient(28% 160% at 8% 100%, rgba(135, 242, 76, 0.19), transparent 72%),
    radial-gradient(30% 170% at 72% 100%, rgba(255, 186, 80, 0.1), transparent 74%),
    radial-gradient(28% 150% at 94% 100%, rgba(87, 185, 255, 0.16), transparent 74%),
    var(--gis-od-glass);
  box-shadow:
    inset 0 0 2px 1px rgba(255, 255, 255, 0.64),
    inset 0 0 14px 4px rgba(255, 255, 255, 0.26),
    0 7px 24px rgba(17, 17, 26, 0.06);
  -webkit-backdrop-filter: blur(16px) saturate(1.55);
  backdrop-filter: blur(16px) saturate(1.55);
  transition:
    background 350ms var(--gis-od-ease),
    border-color 350ms var(--gis-od-ease),
    box-shadow 350ms var(--gis-od-ease);
}

html:root.dark .gis-od-topbar {
  border-bottom-color: var(--gis-od-line);
  background:
    radial-gradient(28% 160% at 8% 100%, rgba(131, 255, 59, 0.12), transparent 72%),
    radial-gradient(30% 170% at 72% 100%, rgba(255, 186, 80, 0.06), transparent 74%),
    radial-gradient(28% 150% at 94% 100%, rgba(87, 185, 255, 0.08), transparent 74%),
    var(--gis-od-glass);
  box-shadow:
    inset 0 0 2px 1px rgba(242, 244, 239, 0.08),
    inset 0 0 14px 4px rgba(242, 244, 239, 0.04),
    0 7px 24px rgba(0, 0, 0, 0.36);
}

.gis-od-topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.16), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.18)),
    radial-gradient(72% 140% at 50% -58%, rgba(255, 255, 255, 0.58), transparent 64%);
  opacity: 0.8;
  mix-blend-mode: screen;
}

html:root.dark .gis-od-topbar::before {
  opacity: 0.32;
  mix-blend-mode: soft-light;
}

.gis-od-topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  z-index: 1;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(90, 209, 31, 0.4),
    rgba(255, 255, 255, 0.72),
    rgba(87, 185, 255, 0.35),
    transparent
  );
}

.gis-od-sheen,
.statusbar-sheen {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  width: 24%;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 18%,
    rgba(135, 242, 76, 0.24) 48%,
    rgba(255, 255, 255, 0.54) 62%,
    transparent 100%
  );
  filter: blur(10px);
  transform: translateX(-130%) skewX(-16deg);
  animation: gis-od-statusbar-sheen 900ms var(--gis-od-ease) 80ms both;
}

@keyframes gis-od-statusbar-sheen {
  0% {
    opacity: 0;
    transform: translateX(-130%) skewX(-16deg);
  }
  20% {
    opacity: 0.7;
  }
  100% {
    opacity: 0;
    transform: translateX(460%) skewX(-16deg);
  }
}

.gis-od-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: var(--gis-od-ink);
  text-decoration: none;
}

.gis-od-brand-mark,
.gw-brand-mark.brand-mark,
.onemap-brand-mark.brand-mark {
  display: grid;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.gis-od-brand-logo,
.gw-brand-logo,
.onemap-brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gis-od-brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}

.gis-od-brand-copy strong,
.gw-brand-copy strong,
.onemap-brand strong {
  overflow: hidden;
  color: var(--gis-od-ink);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gis-od-brand-copy small,
.gw-brand-copy small,
.onemap-brand small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--gis-od-muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.gis-od-status-chip,
.gw-status-chip,
.onemap-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  padding: 3px 10px;
  border: 1px solid rgba(90, 209, 31, 0.22);
  border-radius: 999px;
  color: var(--gis-od-pine);
  background: linear-gradient(
    135deg,
    rgba(135, 242, 76, 0.16),
    rgba(255, 255, 255, 0.44)
  );
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

html:root.dark .gis-od-status-chip,
html:root.dark .gw-status-chip,
html:root.dark .onemap-status-chip {
  border-color: rgba(131, 255, 59, 0.28);
  background: linear-gradient(
    135deg,
    rgba(131, 255, 59, 0.14),
    rgba(23, 25, 21, 0.72)
  );
  box-shadow: inset 0 1px 0 rgba(242, 244, 239, 0.08);
  color: var(--gis-od-pine);
}

.gis-od-status-dot,
.gw-status-dot,
.onemap-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gis-od-neon);
  box-shadow: 0 0 0 3px rgba(90, 209, 31, 0.14);
}

.gis-od-tab,
.gw-tab {
  transition:
    color 200ms var(--gis-od-ease),
    background 200ms var(--gis-od-ease),
    box-shadow 200ms var(--gis-od-ease),
    transform 200ms var(--gis-od-ease);
}

.gis-od-tab:hover,
.gw-tab:hover:not(.is-active) {
  transform: translateY(-1px);
}

.gis-od-card {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 30px 60px -30px rgba(38, 38, 38, 0.16);
  -webkit-backdrop-filter: blur(26px) saturate(1.6);
  backdrop-filter: blur(26px) saturate(1.6);
  transition:
    border-color 240ms var(--gis-od-ease),
    box-shadow 240ms var(--gis-od-ease),
    transform 240ms var(--gis-od-ease);
}

html:root.dark .gis-od-card {
  border-color: rgba(48, 51, 45, 0.92);
  background: rgba(23, 25, 21, 0.86);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.55);
}

.gis-od-card:hover {
  border-color: rgba(90, 209, 31, 0.28);
  box-shadow: 0 34px 68px -34px rgba(28, 122, 0, 0.28);
  transform: translateY(-2px);
}

html:root.dark .gis-od-card:hover {
  border-color: rgba(131, 255, 59, 0.3);
  box-shadow: 0 34px 68px -34px rgba(0, 0, 0, 0.72);
}

/* 深色地图画布与 Leaflet 控件：避免空底图时出现浅灰方块和白色浮层。 */
html:root.dark .leaflet-container {
  color: var(--gis-od-ink);
  background: #11120f;
}

html:root.dark .leaflet-bar a,
html:root.dark .leaflet-control-layers,
html:root.dark .leaflet-control-layers-expanded,
html:root.dark .leaflet-control-attribution,
html:root.dark .leaflet-control-scale-line {
  border-color: var(--gis-od-line);
  color: var(--gis-od-ink-2);
  background: rgba(23, 25, 21, 0.92);
}

html:root.dark .leaflet-bar a:hover,
html:root.dark .leaflet-bar a:focus {
  color: var(--gis-od-pine);
  background: #20271c;
}

html:root.dark .leaflet-bar a.leaflet-disabled {
  color: var(--gis-od-muted);
  background: #141713;
}

html:root.dark .leaflet-control-zoom {
  border-color: var(--gis-od-line) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.42) !important;
}

html:root.dark .leaflet-control-attribution a,
html:root.dark .leaflet-container a {
  color: var(--gis-od-lime);
}

@media (prefers-reduced-motion: reduce) {
  .gis-od-sheen,
  .statusbar-sheen {
    animation: none !important;
  }

  .gis-od-topbar,
  .gis-od-tab,
  .gw-tab,
  .gis-od-card {
    transition: none !important;
  }
}
