/* css/main.css - 主要样式文件 */

/* ==========================================================================
   基础样式重置
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   头部样式
   ========================================================================== */
.header {
  background-color: #3E8EDE;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  height: 60px;
  z-index: 1000;
  margin-bottom: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-left img {
  height: 45px;
  margin-right: 15px;
  object-fit: contain;
}

.header-title {
  font-size: 14px;
  font-weight: normal;
  color: white;
  margin-left: 10px;
}

.header-right {
  display: flex;
  align-items: center;
  font-size: 15px;
}

.header-right a {
  color: white;
  text-decoration: none;
  margin-left: 25px;
  font-size: 16px;
  font-weight: 500;
  transition: color 0.3s ease;
}

.header-right a:hover {
  color: #e6f2ff;
}

.header-right a:focus {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  border-radius: 4px;
}

.header-right .active {
  background-color: #2E74B3;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background-color 0.3s ease;
}

.header-right .active:hover {
  background-color: #255F90;
}

.header-right .attribution {
  margin-right: 20px;
  font-size: 14px;
}

.info-button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-left: 15px;
  cursor: pointer;
  color: #0073b7;
  font-weight: bold;
  border: none;
  transition: background-color 0.3s ease;
}

.info-button:hover {
  background-color: #e0e0e0;
}

.info-button:focus {
  outline: 2px solid #0073b7;
  outline-offset: 2px;
}

/* ==========================================================================
   地图容器样式
   ========================================================================== */
.map-container {
  position: relative;
  flex: 1;
  background-color: #f5f5f5;
}

#map {
  width: 100%;
  height: 100%;
  position: relative;
  background-color: #e8e8e8; /* 地图加载前的背景色 */
}

/* ==========================================================================
   地图控件样式
   ========================================================================== */
.map-controls {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 999; /* 低于头部，避免冲突 */
  display: flex;
  flex-direction: column;
}

.map-control-button {
  width: 30px;
  height: 30px;
  background-color: white;
  border: 1px solid #ccc;
  font-size: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 5px;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.map-control-button:hover {
  background-color: #f8f9fa;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.map-control-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.map-control-button:focus {
  outline: 2px solid #0073b7;
  outline-offset: 2px;
}

.map-control-button:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   导航控件样式
   ========================================================================== */
.navigation-controls {
  position: absolute;
  bottom: 30px;
  left: 10px;
  z-index: 900;
  display: flex;
  flex-direction: column;
}

.nav-button {
  width: 30px;
  height: 30px;
  background-color: white;
  border: 1px solid #ccc;
  font-size: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 5px;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.nav-button:hover {
  background-color: #f8f9fa;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.nav-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-button:focus {
  outline: 2px solid #0073b7;
  outline-offset: 2px;
}

.nav-button:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   通用消息样式
   ========================================================================== */
.success-message {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  padding: 15px 20px;
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 500px;
  font-size: 14px;
  animation: slideInDown 0.3s ease-out;
}

.error-message {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  padding: 15px 20px;
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 500px;
  font-size: 14px;
  animation: slideInDown 0.3s ease-out;
}

.info-message {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  padding: 15px 20px;
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 500px;
  font-size: 14px;
  animation: slideInDown 0.3s ease-out;
}

/* ==========================================================================
   动画效果
   ========================================================================== */
@keyframes slideInDown {
  0% {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* ==========================================================================
   加载状态
   ========================================================================== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  flex-direction: column;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3E8EDE;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

.loading-text {
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   工具提示
   ========================================================================== */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 1000;
}

.tooltip::before {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #333;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 1000;
}

.tooltip:hover::after,
.tooltip:hover::before {
  opacity: 1;
  visibility: visible;
}

.corner-image {
  position: absolute;
  top: 5%;
  left: 3%;
  width: auto;      
  height: 40%;
  z-index: 1001;    
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  border-radius: 6px;
}