* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
#map { position: absolute; top: 0; left: 0; right: 360px; bottom: 0; background: #f0f4f8; }
#sidebar { position: absolute; top: 0; right: 0; width: 360px; bottom: 0; background: #f8f9fa; border-left: 1px solid #ddd; display: flex; flex-direction: column; }
#sidebar-header { padding: 16px; background: #2c3e50; color: white; display: flex; justify-content: space-between; align-items: center; }
#sidebar-header h1 { font-size: 18px; font-weight: 600; }
#sidebar-header p { font-size: 12px; opacity: 0.7; margin-top: 4px; }
#search-box { padding: 12px 16px; border-bottom: 1px solid #ddd; background: white; }
#search-box input { width: 100%; padding: 8px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; outline: none; }
#search-box input:focus { border-color: #3498db; box-shadow: 0 0 0 2px rgba(52,152,219,0.2); }
#search-results { max-height: 200px; overflow-y: auto; display: none; border-bottom: 1px solid #ddd; background: white; }
#search-results div { padding: 8px 16px; cursor: pointer; font-size: 14px; border-bottom: 1px solid #f0f0f0; }
#search-results div:hover { background: #e8f4fd; }
#search-results div.selected { background: #d4e6f9; }
#search-results div .gb-code { color: #999; font-size: 11px; margin-left: 8px; }
#game-box { padding: 12px 16px; border-bottom: 1px solid #ddd; background: white; display: none; }
#game-box input { width: 100%; padding: 8px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; outline: none; }
#game-box input:focus { border-color: #27ae60; box-shadow: 0 0 0 2px rgba(39,174,96,0.2); }
#game-box input.correct { border-color: #27ae60; background: #eafaf1; }
#game-box input.wrong { border-color: #e74c3c; background: #fdedec; }
.btn { padding: 6px 14px; border: none; border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: 600; }
.btn-start { background: #27ae60; color: white; }
.btn-start:hover { background: #219a52; }
.btn-end { background: #e74c3c; color: white; }
.btn-end:hover { background: #c0392b; }
#detail-panel { flex: 1; overflow-y: auto; padding: 16px; }
#detail-panel .placeholder { color: #999; text-align: center; margin-top: 60px; font-size: 14px; }
#detail-panel .placeholder .icon { font-size: 48px; margin-bottom: 16px; }
.detail-card { background: white; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.detail-card h2 { font-size: 20px; color: #2c3e50; margin-bottom: 4px; }
.detail-card .gb { font-size: 13px; color: #999; margin-bottom: 16px; }
.detail-card .info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.detail-card .info-row:last-child { border-bottom: none; }
.detail-card .info-row .label { color: #666; }
.detail-card .info-row .value { color: #2c3e50; font-weight: 500; }
#stats { padding: 12px 16px; border-top: 1px solid #ddd; background: white; font-size: 12px; color: #666; display: flex; justify-content: space-between; }
#game-city-list { display: none; flex: 1; overflow-y: auto; padding: 8px 16px; }
#game-city-list .city-item { padding: 6px 8px; font-size: 13px; color: #27ae60; border-bottom: 1px solid #f0f0f0; }
#game-city-list .city-item .num { display: inline-block; width: 28px; font-weight: 700; color: #1e8449; }
#game-stats { display: none; padding: 8px 16px; border-top: 1px solid #ddd; background: #eafaf1; font-size: 13px; color: #27ae60; font-weight: 600; justify-content: space-between; }
.leaflet-popup-content { margin: 8px 12px; font-size: 13px; }
.leaflet-popup-content strong { color: #2c3e50; }
.game-highlight { color: #2980b9 !important; weight: 2.5 !important; fillColor: #3498db !important; fillOpacity: 0.45 !important; }
#toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.8); color: white; padding: 10px 24px; border-radius: 8px; font-size: 14px; z-index: 10000; display: none; pointer-events: none; }

@media (max-width: 767px) {
  #map { right: 0; }
  #sidebar { width: 100%; height: auto; max-height: 45vh; top: auto; bottom: 0; left: 0; border-left: none; border-top: 1px solid #ddd; border-radius: 12px 12px 0 0; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); overflow-y: auto; z-index: 1000; }
  #sidebar-header h1 { font-size: 16px; }
  #search-results { max-height: 120px; }
  #detail-panel { max-height: 20vh; }
}
