* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.modal-content.photo-modal {
  max-width: 80%;
  max-height: 80%;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.form-group button {
  width: 100%;
  padding: 10px;
  background-color: #40a9ff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin-top: 5px;
}

.form-group button:hover {
  background-color: #1890ff;
}

#loginError {
  color: #f5222d;
  font-size: 12px;
}

#app {
  display: none;
}

header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 20px;
  font-weight: 600;
}

#userInfo {
  display: flex;
  align-items: center;
  gap: 10px;
}

#logoutBtn {
  padding: 8px 16px;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#logoutBtn:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

#mainNav {
  display: flex;
  background-color: #fff;
  border-bottom: 1px solid #e8e8e8;
}

#mainNav button {
  flex: 1;
  padding: 12px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  border-bottom: 2px solid transparent;
}

#mainNav button.active {
  color: #40a9ff;
  border-bottom-color: #40a9ff;
}

#mapContainer {
  position: relative;
  height: 500px;
  background-color: #fff;
  margin: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
}

#mapControls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

#mapControls button {
  padding: 8px 12px;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#mapControls button:hover {
  background-color: #fff;
}

#searchBox {
  display: flex;
  gap: 5px;
}

#searchInput {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  width: 150px;
}

#routeInfo {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background-color: rgba(255, 255, 255, 0.95);
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-width: 300px;
}

#routeInfo h4 {
  margin-bottom: 8px;
  color: #1890ff;
}

#routeInfo p {
  font-size: 13px;
  margin-bottom: 4px;
}

#managePanel {
  margin: 10px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 20px;
}

.panel-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e8e8e8;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: #40a9ff;
  border-bottom-color: #40a9ff;
}

.tab-content {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tab-content h3 {
  margin-bottom: 15px;
  color: #333;
}

.tab-content button {
  padding: 8px 16px;
  background-color: #40a9ff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 15px;
}

.tab-content button:hover {
  background-color: #1890ff;
}

.tab-content table {
  width: 100%;
  border-collapse: collapse;
}

.tab-content th,
.tab-content td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #e8e8e8;
}

.tab-content th {
  background-color: #fafafa;
  font-weight: 600;
}

.tab-content .action-btn {
  padding: 5px 10px;
  margin-right: 5px;
  font-size: 12px;
  border-radius: 3px;
  cursor: pointer;
  border: none;
}

.tab-content .edit-btn {
  background-color: #52c41a;
  color: white;
}

.tab-content .delete-btn {
  background-color: #f5222d;
  color: white;
}

#commentsSection {
  margin: 10px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 20px;
}

#commentsSection h3 {
  margin-bottom: 15px;
  color: #333;
}

#commentForm textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
  margin-bottom: 10px;
}

#commentForm button {
  padding: 10px 20px;
  background-color: #40a9ff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#commentsList {
  margin-top: 20px;
}

.comment-item {
  display: flex;
  gap: 12px;
  padding: 15px;
  background-color: #fafafa;
  border-radius: 8px;
  margin-bottom: 10px;
  border-left: 4px solid #40a9ff;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
  font-size: 18px;
  flex-shrink: 0;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-item .comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.comment-item .comment-nickname {
  font-weight: 600;
  color: #333;
}

.comment-item .comment-time {
  font-size: 12px;
  color: #999;
}

.comment-item .comment-content {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
  word-break: break-word;
}

.comment-item .like-btn {
  padding: 5px 12px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  color: #666;
}

.comment-item .like-btn:hover {
  background-color: #f0f0f0;
}

.comment-item .like-btn.liked {
  background-color: #fff0f0;
  border-color: #f5222d;
  color: #f5222d;
}

#photosContainer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.photo-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.photo-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.photo-item .photo-caption {
  padding: 8px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 12px;
}

#uploadPhotoSection {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

#photoUpload {
  padding: 5px;
}

#photoCaption {
  flex: 1;
  min-width: 150px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.cancel-btn {
  background-color: #f5f5f5 !important;
  color: #666 !important;
}

.cancel-btn:hover {
  background-color: #e8e8e8 !important;
}

@media (max-width: 768px) {
  #mapContainer {
    height: 400px;
    margin: 5px;
  }
  
  #mapControls {
    top: 5px;
    right: 5px;
  }
  
  #searchBox {
    flex-direction: column;
  }
  
  #searchInput {
    width: 100%;
  }
  
  header h1 {
    font-size: 16px;
  }
  
  #userInfo {
    flex-direction: column;
    gap: 5px;
  }
  
  .panel-tabs {
    flex-wrap: wrap;
  }
  
  .tab-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .tab-content table {
    display: block;
    overflow-x: auto;
  }
  
  #uploadPhotoSection {
    flex-direction: column;
  }
}

@media (orientation: landscape) and (max-width: 768px) {
  #mapContainer {
    height: 350px;
  }
}

@media (min-width: 1024px) {
  #mapContainer {
    height: 600px;
  }
}