*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at top, #f0f4ff 0, #f9fafb 38%, #eef2ff 100%);
  color: #111827;
}

body {
  min-height: 100vh;
}

.app {
  max-width: 840px;
  margin: 0 auto;
  padding: 16px 16px 32px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  font-size: 32px;
}

.brand-text h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.03em;
}

.brand-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: #6b7280;
}

.car-id {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.07);
  color: #1d4ed8;
  font-size: 12px;
}

.app-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.app-layout {
  flex-direction: row;
  align-items: flex-start;
}

.sidebar {
  flex: 0 0 260px;
  position: sticky;
  top: 12px;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.cars-subtitle {
  margin: 2px 0 10px;
  font-size: 12px;
  color: #6b7280;
}

.cars-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 540px;
  overflow-y: auto;
  padding-right: 2px;
}

.car-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.car-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.10);
}

.car-item.active {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
}

.car-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.car-item-code {
  font-weight: 600;
  font-size: 13px;
}

.car-item-meta {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

.pill-idle {
  background: rgba(22, 163, 74, 0.10);
  color: #15803d;
}

.pill-using {
  background: rgba(234, 179, 8, 0.12);
  color: #a16207;
}

.pill-error {
  background: rgba(239, 68, 68, 0.10);
  color: #b91c1c;
}

.card {
  background: rgba(255, 255, 255, 0.86);
  border-radius: 18px;
  padding: 16px 18px 14px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.card h2 {
  margin: 0 0 10px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card h2::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #22c55e);
}

.status-card .status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 14px;
}

.status-label {
  color: #6b7280;
}

.status-value {
  font-weight: 500;
}

.status-value.badge {
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
}

.status-value.badge-idle {
  background: rgba(22, 163, 74, 0.08);
  color: #16a34a;
}

.status-value.badge-using {
  background: rgba(234, 179, 8, 0.1);
  color: #ca8a04;
}

.status-value.badge-error {
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.field label {
  font-size: 13px;
  color: #4b5563;
}

.field input {
  border-radius: 10px;
  border: 1px solid #d1d5db;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease;
}

.field input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12);
  background-color: #f9fafb;
}

.tips {
  min-height: 18px;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
}

.tips.error {
  color: #b91c1c;
}

.tips.success {
  color: #15803d;
}

.actions {
  display: flex;
  gap: 10px;
  margin-bottom: 6px;
}

.btn {
  flex: 1;
  border-radius: 999px;
  border: none;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.12s ease,
    background-color 0.12s ease, opacity 0.12s ease;
}

.btn.primary {
  background: linear-gradient(135deg, #2563eb, #22c55e);
  color: white;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.35);
}

.btn.danger {
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: white;
  box-shadow: 0 12px 26px rgba(239, 68, 68, 0.35);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.btn:not(:disabled):active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.2);
}

.hint {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
}

.hint code {
  background: #111827;
  color: #e5e7eb;
  padding: 1px 5px;
  border-radius: 6px;
  font-size: 11px;
}

.history-list {
  max-height: 240px;
  overflow-y: auto;
  padding-right: 2px;
  font-size: 13px;
}

.history-list.empty {
  color: #9ca3af;
  font-size: 12px;
}

.history-item {
  border-bottom: 1px dashed #e5e7eb;
  padding: 6px 0;
}

.history-item:last-child {
  border-bottom: none;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.history-user {
  font-weight: 500;
}

.history-status {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
}

.history-meta {
  color: #6b7280;
  font-size: 12px;
}

.history-meta span + span::before {
  content: " · ";
}

.app-footer {
  margin-top: 14px;
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(150%);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.96);
  color: white;
  font-size: 13px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 50;
}

.toast.show {
  transform: translateX(-50%) translateY(0%);
  opacity: 1;
}

@media (max-width: 640px) {
  .app {
    padding: 12px 10px 24px;
  }

  .app-header {
    align-items: flex-start;
  }

  .brand-text h1 {
    font-size: 18px;
  }

  .card {
    border-radius: 16px;
  }

  .app-layout {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    flex: 1;
  }
}

