:root {
  --primary-color: #ff6b6b;
  --secondary-color: #4ecdc4;
  --accent-color: #45b7d1;
  --dark-bg: #0f1419;
  --card-bg: #1a1f2e;
  --text-light: #ffffff;
  --text-muted: #8b9bb4;
}
  
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
  
body {
  background: linear-gradient(135deg, var(--dark-bg) 0%, #16202d 100%);
  color: var(--text-light);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
  
.container {
  display: flex;
  min-height: 100vh;
  gap: 16px;
  padding: 16px;
  flex-wrap: wrap;
}
  
.panel-left {
  width: 380px;
  min-width: 280px;
  background: transparent;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: visible;
  gap: 16px;
  flex-shrink: 0;
}
  
.panel-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
}
  
.visitor-welcome {
  flex: 4;
  background: transparent;
  border-radius: 12px;
  padding: 20px;
  animation: pulse 2s infinite;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
  
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}
  
.visitor-welcome h3 {
  font-size: clamp(16px, 2vw, 20px);
  margin-bottom: 16px;
  color: white;
  text-align: center;
  line-height: 1.4;
  word-break: break-word;
}
  
.visitor-welcome p {
  font-size: clamp(14px, 1.8vw, 18px);
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.5;
}
  
.visitor-stats {
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
}
  
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
  
.stat-number {
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: bold;
  color: var(--secondary-color);
  margin-bottom: 4px;
}
  
.stat-label {
  font-size: clamp(10px, 1.2vw, 12px);
  color: var(--text-muted);
}
  
.visitor-location {
  color: var(--primary-color);
}
  
.visitor-number {
  color: var(--secondary-color);
}
  
.control-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
  
.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
  
.controls button {
  padding: clamp(10px, 2vw, 12px) clamp(8px, 1.5vw, 12px);
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: white;
  font-weight: 600;
  font-size: clamp(12px, 1.5vw, 14px);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
  
.controls button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}
  
.controls button:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.15);
}
  
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
  
.stat-card {
  background: transparent;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
}
  
.stat-value {
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: bold;
  color: var(--secondary-color);
  margin-bottom: 4px;
}
  
.stat-card .stat-label {
  font-size: clamp(10px, 1.2vw, 12px);
  color: var(--text-muted);
}
  
.map-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 80%;
  height: 100%;
  background: transparent;
  border-radius: 16px;
  padding: 12px;
  overflow: hidden;
  min-height: 400px;
}
  
.side-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 20%;
  min-width: 200px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 12px;
}
  
.chart-card {
  background: transparent;
  border-radius: 16px;
  padding: 12px;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
}
/* 移除未使用的 .chart-container 样式（原结构未引用） */
#mapChart, #pieChart, #barChart {
  width: 100%;
  height: 100%;
  position:relative;
}
.pie-chart-wrapper, .bar-chart-wrapper {
  width: 100%;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}
.chart-info {
  position: static;
  text-align: center;
  font-size: clamp(10px, 1.2vw, 12px);
  color: var(--text-muted);
  padding: 0 10px;
  margin-top: 6px;
}

/* 平板设备优化 */
@media (max-width: 1400px) {
  .side-panel {
    width: 25%;
    min-width: 200px;
  }
  
  .map-box {
    width: 75%;
  }
}

@media (max-width: 1200px) {
  .container {
    padding: 12px;
    gap: 12px;
  }
  
  .panel-left {
    width: 320px;
    min-width: 280px;
  }
  
  .side-panel {
    width: 28%;
    min-width: 180px;
  }
  
  .map-box {
    width: 72%;
  }
}

/* 平板横屏 */
@media (max-width: 1024px) and (orientation: landscape) {
  .panel-left {
    width: 300px;
  }
  
  .side-panel {
    width: 30%;
    min-width: 200px;
  }
  
  .map-box {
    width: 70%;
  }
}

/* 移动端优化 */
@media (max-width: 768px) {
  body {
    overflow-y: auto;
  }
  
  .container {
    flex-direction: column;
    padding: 8px;
    gap: 12px;
    min-height: auto;
  }
  
  .panel-left {
    width: 100%;
    height: auto;
    min-height: auto;
    padding: 16px;
    order: 1;
  }
  
  .visitor-welcome {
    flex: none;
    padding: 16px;
    min-height: auto;
  }
  
  .panel-right {
    height: auto;
    min-height: 500px;
    order: 2;
    position: relative;
  }
  
  .map-box {
    position: relative;
    width: 100%;
    height: 400px;
    min-height: 400px;
    padding: 8px;
  }
  
  .side-panel {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 300px;
    flex-direction: column;
    padding: 8px;
    gap: 12px;
    order: 3;
    margin-bottom: 60px;
  }
  
  .chart-card {
    min-height: 250px;
    height: 250px;
  }
  
  .controls {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .stats-grid {
    gap: 8px;
  }
  
  .visitor-stats {
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
  }
  
  .refresh-status {
    margin-top: 12px;
    font-size: 11px;
  }
  
  .data-time, .next-refresh {
    display: block;
    margin: 4px 0;
  }
}

/* 小屏手机优化 */
@media (max-width: 480px) {
  .container {
    padding: 6px;
    gap: 8px;
  }
  
  .panel-left {
    padding: 12px;
  }
  
  .visitor-welcome {
    padding: 12px;
  }
  
  .visitor-welcome h3 {
    font-size: 16px;
    margin-bottom: 12px;
  }
  
  .visitor-welcome p {
    font-size: 14px;
    margin-bottom: 12px;
  }
  
  .map-box {
    height: 350px;
    min-height: 350px;
    padding: 6px;
  }
  
  .side-panel {
    padding: 6px;
    gap: 8px;
  }
  
  .chart-card {
    min-height: 220px;
    height: 220px;
    padding: 8px;
  }
  
  .controls {
    gap: 6px;
  }
  
  .controls button {
    padding: 10px 6px;
    font-size: 12px;
  }
  
  .stats-grid {
    gap: 6px;
  }
  
  .stat-card {
    padding: 12px 8px;
  }
  
  .info-bar {
    padding: 8px 6px;
    font-size: 10px;
    position: relative;
    bottom: auto;
  }
  
  .info-bar div {
    font-size: 10px;
    line-height: 1.5;
    word-break: break-word;
  }
  
  .info-bar a {
    display: inline-block;
    margin: 0 2px;
  }
}

/* 横屏手机优化 */
@media (max-width: 768px) and (orientation: landscape) {
  .panel-left {
    max-height: 50vh;
    overflow-y: auto;
  }
  
  .map-box {
    height: calc(50vh - 20px);
    min-height: 300px;
  }
  
  .side-panel {
    flex-direction: row;
    height: auto;
    min-height: 200px;
  }
  
  .chart-card {
    flex: 1;
    min-height: 200px;
    height: 200px;
  }
}
.info-bar {
  background: transparent;
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 10;
  pointer-events: none;
}
  
.info-bar a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: opacity 0.3s ease;
  pointer-events: auto;
}
  
.info-bar a:hover,
.info-bar a:active {
  text-decoration: underline;
  opacity: 0.8;
}
  
.glow-text {
  text-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
}

.loading {
  opacity: 0.7;
  pointer-events: none;
}
.refresh-status {
  margin-top: 15px;
  font-size: clamp(10px, 1.2vw, 12px);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.data-time, .next-refresh {
  display: inline-block;
  margin: 0 10px;
}

.refresh-status span {
  color: var(--secondary-color);
  font-weight: bold;
}

/* 改善滚动体验 */
.panel-left {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.panel-left::-webkit-scrollbar {
  width: 6px;
}

.panel-left::-webkit-scrollbar-track {
  background: transparent;
}

.panel-left::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.panel-left::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}


