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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial,
    sans-serif;
  background: #f0f2f5;
  color: #333;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========================================
   顶部导航栏
   ======================================== */
.header {
  background: linear-gradient(135deg, #1a73e8, #1557b0);
  color: #fff;
  padding: 16px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 100;
}

.header h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 1px;
}

.header .subtitle {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 4px;
}

/* ========================================
   图例
   ======================================== */
.legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.legend-color {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.legend-color.available {
  background: #4caf50;
}

.legend-color.queued {
  background: #ff9800;
}

.legend-color.sold {
  background: #999;
}

/* ========================================
   底图容器 - 固定宽度1200px, JS控制transform缩放
   ======================================== */
.map-wrapper {
  padding: 20px 0 40px;
  display: flex;
  justify-content: flex-start;
  overflow: auto;
}

.map-container {
  position: relative;
  width: 1200px;
  height: 1637px;
  background: #e8e8e8;
  border: 2px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  transform-origin: top left;
}

.map-container .map-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ========================================
   车位标记
   ======================================== */
.parking-spot {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  z-index: 10;
  user-select: none;
}

.parking-spot:hover {
  transform: scale(1.15);
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.parking-spot.available {
  background: rgba(76, 175, 80, 0.75);
}

.parking-spot.queued {
  background: rgba(255, 152, 0, 0.75);
}

.parking-spot.sold {
  background: rgba(153, 153, 153, 0.75);
  cursor: not-allowed;
}

/* ========================================
   模态框
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

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

.modal {
  background: #fff;
  border-radius: 12px;
  padding: 28px 32px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: #1a73e8;
}

.modal .spot-info {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
  padding: 10px;
  background: #f5f7fa;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.modal .spot-info .spot-number-badge {
  background: #1a73e8;
  color: #fff;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 600;
}

.modal .spot-info .spot-price {
  color: #e53935;
  font-weight: 600;
}

.modal .unavailable-msg {
  text-align: center;
  padding: 24px 0;
  color: #999;
  font-size: 15px;
}

.modal .unavailable-msg .icon {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
}

/* ========================================
   表单
   ======================================== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.form-group label .required {
  color: #e53935;
  margin-left: 2px;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 15px;
  transition: border-color 0.2s ease;
  outline: none;
}

.form-group input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.form-group input.error {
  border-color: #e53935;
}

.form-group .error-msg {
  color: #e53935;
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

.form-group .error-msg.show {
  display: block;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #1a73e8;
  color: #fff;
  flex: 1;
}

.btn-primary:hover {
  background: #1557b0;
}

.btn-primary:disabled {
  background: #a0c4f1;
  cursor: not-allowed;
}

.btn-cancel {
  background: #f0f0f0;
  color: #666;
}

.btn-cancel:hover {
  background: #e0e0e0;
}

/* ========================================
   成功/错误提示 Toast
   ======================================== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 28px;
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  z-index: 2000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: toastIn 0.3s ease;
}

.toast.success {
  background: #4caf50;
}

.toast.error {
  background: #e53935;
}

@keyframes toastIn {
  from {
    transform: translateX(-50%) translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

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

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e0e0e0;
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   登录页面样式
   ======================================== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 40px 16px;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px 36px;
  width: 380px;
  max-width: 95vw;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.login-card h2 {
  font-size: 22px;
  color: #333;
  margin-bottom: 8px;
}

.login-card .login-desc {
  font-size: 13px;
  color: #999;
  margin-bottom: 28px;
}

.login-card .form-group {
  text-align: left;
}

.login-card .form-group input {
  text-align: center;
  font-size: 16px;
  letter-spacing: 4px;
}

.login-card .form-actions {
  margin-top: 8px;
}

.login-card .error-msg {
  text-align: center;
  margin-top: 6px;
}

/* ========================================
   管理后台样式
   ======================================== */
.admin-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid #e0e0e0;
}

.admin-tab {
  padding: 10px 24px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 15px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: -2px;
}

.admin-tab:hover {
  color: #1a73e8;
}

.admin-tab.active {
  color: #1a73e8;
  border-bottom-color: #1a73e8;
}

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
}

.admin-container {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-header h2 {
  font-size: 20px;
  color: #333;
}

.status-filter select {
  padding: 8px 16px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  cursor: pointer;
}

.status-filter select:focus {
  border-color: #1a73e8;
}

.admin-table-wrapper {
  overflow-x: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table thead {
  background: #f5f7fa;
}

.admin-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
  border-bottom: 2px solid #e0e0e0;
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
}

.admin-table tbody tr:hover {
  background: #fafbfc;
}

.status-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.status-tag.pending {
  background: #fff3e0;
  color: #e65100;
}

.status-tag.contacted {
  background: #e8f5e9;
  color: #2e7d32;
}

.btn-sm {
  padding: 5px 14px;
  font-size: 13px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-success {
  background: #4caf50;
  color: #fff;
}

.btn-success:hover {
  background: #388e3c;
}

.btn-success:disabled {
  background: #a5d6a7;
  cursor: not-allowed;
}

.btn-danger {
  background: #e53935;
  color: #fff;
}

.btn-danger:hover {
  background: #c62828;
}

.btn-warning {
  background: #ff9800;
  color: #fff;
}

.btn-warning:hover {
  background: #ef6c00;
}

.auction-edit-form {
  background: #fff;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.auction-edit-form h3 {
  font-size: 17px;
  color: #1a73e8;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
}

.auction-edit-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  resize: vertical;
}

.auction-edit-form textarea:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.status-tag.active {
  background: #e8f5e9;
  color: #2e7d32;
}

.status-tag.inactive {
  background: #ffebee;
  color: #c62828;
}

.notes-cell {
  min-width: 200px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.notes-textarea {
  flex: 1;
  min-height: 48px;
  padding: 6px 8px;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  line-height: 1.5;
}

.notes-textarea:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.btn-save-notes {
  background: #1a73e8;
  color: #fff;
  border: none;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-save-notes:hover {
  background: #1557b0;
}

.btn-save-notes:disabled {
  background: #a5c8f7;
  cursor: not-allowed;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 12px;
}

/* ========================================
   拍卖侧边栏
   ======================================== */
.auction-sidebar {
  position: fixed;
  left: 0;
  top: 120px;
  z-index: 90;
  background: #fff;
  border-radius: 0 8px 8px 0;
  box-shadow: 2px 2px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
  max-width: 320px;
}

.auction-sidebar.collapsed {
  transform: translateX(-280px);
}

.sidebar-toggle {
  position: absolute;
  right: -44px;
  top: 0;
  width: 44px;
  height: 60px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 12px;
  writing-mode: vertical-rl;
  letter-spacing: 2px;
}

.sidebar-toggle:hover {
  background: #1557b0;
}

.sidebar-toggle .toggle-icon {
  font-size: 16px;
  writing-mode: horizontal-tb;
}

.sidebar-content {
  width: 280px;
  padding: 16px;
  max-height: 60vh;
  overflow-y: auto;
}

.sidebar-header h3 {
  font-size: 16px;
  color: #1a73e8;
  margin-bottom: 4px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e0e0e0;
}

.auction-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.auction-card {
  background: #f8f9ff;
  border: 1px solid #e0e4ff;
  border-radius: 8px;
  padding: 14px;
}

.auction-card .auc-spot-number {
  font-size: 15px;
  font-weight: 700;
  color: #1a73e8;
  margin-bottom: 6px;
}

.auction-card .auc-meta {
  font-size: 12px;
  color: #666;
  line-height: 1.8;
}

.auction-card .auc-meta strong {
  color: #e53935;
}

.auction-card .auc-rules-btn {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: #1a73e8;
  cursor: pointer;
  text-decoration: underline;
}

.auction-card .auc-register-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 7px 0;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.auction-card .auc-register-btn:hover {
  background: #1557b0;
}

.auction-rules-popup {
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: 6px;
  padding: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: #8c6d00;
  line-height: 1.8;
  white-space: pre-line;
  display: none;
}

.auction-rules-popup.show {
  display: block;
}

.no-auction {
  text-align: center;
  color: #999;
  font-size: 13px;
  padding: 16px 0;
}

/* ========================================
   排队人数提示
   ======================================== */
.queue-notice {
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  text-align: center;
}

.queue-notice .queue-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 4px;
}

.queue-notice .queue-text {
  font-size: 14px;
  color: #e65100;
  font-weight: 600;
}

.queue-notice .queue-sub {
  font-size: 12px;
  color: #bf360c;
  margin-top: 4px;
}

/* ========================================
   意向出价输入（可选）
   ======================================== */
.form-group .optional-label {
  font-weight: 400;
  color: #999;
  font-size: 12px;
  margin-left: 4px;
}

.form-group input[name="bidPrice"] {
  border-color: #c8e6c9;
  background: #f9fff9;
}

/* ========================================
   响应式 - 移动端调整
   ======================================== */
@media (max-width: 768px) {
  .header h1 {
    font-size: 18px;
  }

  .modal {
    padding: 20px 24px;
  }

  .admin-table th,
  .admin-table td {
    padding: 8px 10px;
    font-size: 12px;
  }
}
