body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #111;
}

* {
  box-sizing: border-box;
}

/* 禁止长按图片保存到相册 / 拖拽 / 选中 */
img {
  -webkit-touch-callout: none; /* iOS Safari 长按菜单 */
  -webkit-user-select: none;   /* iOS 选择 */
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-user-drag: none;     /* 禁止拖拽图片到桌面 */
  pointer-events: none;        /* 图片本身不吃事件，事件落到父容器 */
}

/* 设备码弹层里的文本需要可以长按复制，单独恢复 */
.device-code {
  -webkit-touch-callout: default;
  -webkit-user-select: all;
  user-select: all;
  pointer-events: auto;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 70px;
  background-color: #ffffff;
}

.top-section {
  background: linear-gradient(to bottom, #727272 0%, #a5a5a5 40%, #dddddd 75%, #ffffff 98%);
  padding-top: 70px;
  /* Safe area / status bar padding */
  position: relative;
  padding-bottom: 20px;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  position: relative;
  z-index: 2;
}

.notification-icon {
  position: relative;
  width: 24px;
  height: 24px;
  color: #fff;
}

.notification-icon svg {
  width: 100%;
  height: 100%;
}

.badge {
  position: absolute;
  top: -2px;
  right: -6px;
  background-color: #e53935;
  color: white;
  font-size: 10px;
  font-weight: bold;
  border-radius: 10px;
  padding: 1px 4px;
  border: none;
}

.car-model {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.garage-icon {
  width: 32px;
  height: 32px;
  color: #fff;
}

.garage-icon svg,
.garage-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.car-display {
  width: 90%;
  margin: 185px auto 0 auto;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.car-image {
  width: 95%;
  max-width: 500px;
  height: auto;
  object-fit: contain;
}

.status-section {
  text-align: center;
  margin-top: 5px;
}

.shield-icon {
  display: flex;
  justify-content: center;
  align-items: center;
}

.shield-icon svg,
.shield-icon img {
  width: 28px;
  height: 28px;
  color: #555;
  object-fit: contain;
}

.status-title {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.status-title svg {
  position: absolute;
  right: -18px;
}

.status-time {
  font-size: 12px;
  color: #888;
  margin-top: 6px;
}

.status-time.clickable-time {
  cursor: pointer;
}

.status-time.clickable-time:active {
  opacity: 0.6;
}

.main-content {
  padding: 0 20px 40px 20px;
}

.fuel-container {
  padding-top: 15px;
}

.fuel-progress-bar {
  width: 100%;
  height: 6px;
  /* Keep height for the black bar */
  position: relative;
}

/* Thin grey line for the background (uncompleted) */
.fuel-progress-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: #d8d8d8;
}

.fuel-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background-color: #111;
  width: 0%;
  transition: width 0.5s ease-in-out;
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  z-index: 1;
}

.fuel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5px 40px 5px;
  font-size: 12px;
  font-weight: 500;
}

.fuel-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #000;
  /* slightly lighter gray with semi-transparent feel */
  font-weight: 200;
  /* extremely thin, almost hairline */
}

.fuel-left svg,
.fuel-left img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.fuel-right {
  font-weight: bold;
  font-size: 30px;
  letter-spacing: 0px;
  display: flex;
  align-items: center;
  font-family: Arial, sans-serif;
  color: #111;
}

.fuel-right .val {
  font-weight: 800;
}

.clickable-val {
  cursor: pointer;
}

.clickable-val:active {
  opacity: 0.7;
}

.fuel-right .unit {
  font-size: 14px;
  font-weight: 500;
  margin-left: 2px;
  margin-right: 8px;
  /* Small push upward to achieve visual vertical center */
}



.card {
  background-color: #f4f5f7;
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
}

.controls-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid #eaeaec;
}

.control-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
}

.control-btn svg,
.control-btn img {
  width: 32px;
  height: 32px;
  color: #333;
  object-fit: contain;
}

.remote-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  font-size: 14px;
  font-weight: 600;
}

.remote-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.remote-left svg,
.remote-left img {
  width: 28px;
  height: 28px;
  color: #444;
  object-fit: contain;
}

.blue-text {
  color: #0f5ca1;
  font-size: 14px;
  font-weight: 600;
}

.location-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
}

.location-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.location-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.location-title {
  font-size: 15px;
  font-weight: 600;
}

.location-desc {
  font-size: 12px;
  color: #888;
}

.location-icon svg,
.location-icon img {
  width: 28px;
  height: 28px;
  color: #222;
  object-fit: contain;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background-color: #ffffff;
  display: flex;
  justify-content: space-around;
  padding-top: 10px;
  border-top: 1px solid #eaeaea;
  padding-bottom: 15px;
  z-index: 10;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #888;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
}

.nav-item.active {
  color: #111;
}

.nav-item svg,
.nav-item img {
  width: 26px;
  height: 26px;
  color: currentColor;
  object-fit: contain;
}

/* Modal Styling */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s;
}

.edit-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 85%;
  max-width: 320px;
  background: white;
  border-radius: 24px;
  z-index: 101;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.close-btn {
  font-size: 24px;
  color: #888;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
}

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

.input-group label {
  display: block;
  font-size: 14px;
  color: #555;
  margin-bottom: 5px;
}

.input-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.06);
}

.save-btn {
  width: 100%;
  padding: 12px;
  background: #111;
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  margin-top: 10px;
  cursor: pointer;
}

/* Car Selector Styles */
.color-options {
  display: flex;
  gap: 20px;
  margin-top: 10px;
}

.color-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 10px;
  border-radius: 14px;
  transition: background-color 0.2s, transform 0.15s;
}

.color-option:active {
  transform: scale(0.94);
}

.color-option:hover {
  background-color: #f0f0f0;
}

.color-option.selected {
  background-color: #e0e0e0;
}

.color-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #ddd;
}

.color-circle.white {
  background-color: white;
  border-color: #111;
}

.color-circle.black {
  background-color: black;
  border-color: #111;
}

.color-circle.green {
  background-color: green;
  border-color: #111;
}

.color-circle.blue {
  background-color: blue;
  border-color: #111;
}

.color-circle.gray {
  background-color: gray;
  border-color: #111;
}

select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  background-color: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

select:focus {
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.06);
}

/* ------------------------------------------------------------------ *
 * 设备码弹层（长按 shield 图标出现）
 * ------------------------------------------------------------------ */
.device-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s ease;
  padding: 24px;
}

.device-overlay.show {
  opacity: 1;
}

.device-card {
  width: 100%;
  max-width: 320px;
  background: #fff;
  border-radius: 24px;
  padding: 26px 22px 20px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  transform: scale(0.9) translateY(12px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.device-overlay.show .device-card {
  transform: scale(1) translateY(0);
}

.device-title {
  font-size: 17px;
  font-weight: 700;
  color: #111;
}

.device-desc {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
  line-height: 1.5;
}

.device-code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #0a5cff;
  background: #f2f6ff;
  border: 1px dashed #b9cdfb;
  border-radius: 10px;
  padding: 16px 8px;
  margin: 18px 0;
  -webkit-user-select: all;
  user-select: all;
}

.device-copy {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: #0a5cff;
  cursor: pointer;
}

.device-copy:active {
  opacity: 0.85;
}

.device-close {
  width: 100%;
  border: none;
  background: transparent;
  color: #999;
  font-size: 14px;
  padding: 12px;
  margin-top: 4px;
  cursor: pointer;
}


/* ------------------------------------------------------------------ *
 * 内联颜色切换器（车图下方）
 * ------------------------------------------------------------------ */
.inline-color-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding: 4px 0;
}

.inline-color-toggle .cc {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease;
}

.inline-color-toggle .cc.white   { background: #ffffff; border-color: #bfbfbf; }
.inline-color-toggle .cc.black   { background: #1a1a1a; }
.inline-color-toggle .cc.green   { background: #4a7c59; }
.inline-color-toggle .cc.blue    { background: #1e3a5f; }
.inline-color-toggle .cc.gray    { background: #8c8c8c; }

.inline-color-toggle .cc:active { transform: scale(0.9); }

.inline-color-toggle .cc.active {
  border-color: #0a5cff;
  box-shadow: 0 0 0 2px rgba(10, 92, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* ================================================================ *
 *  全局文字不可复制（输入框除外）
 * ================================================================ */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

input, textarea, [contenteditable], .device-code {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* ================================================================ *
 *  Toast 提示
 * ================================================================ */
.toast {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 9999;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.ok   { background: rgba(46, 125, 50, 0.9); }
.toast.warn { background: rgba(90, 90, 90, 0.9); }
.toast.err  { background: rgba(198, 40, 40, 0.9); }

/* ================================================================ *
 *  公告弹窗
 * ================================================================ */
.announce-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.announce-card {
  background: #fff;
  border-radius: 24px;
  width: 85%;
  max-width: 360px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
  text-align: center;
  animation: announce-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes announce-pop {
  from { transform: scale(0.85) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.announce-header {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 17px;
  font-weight: 600;
  color: #222;
}

.announce-header svg {
  width: 22px;
  height: 22px;
  color: #0a5cff;
}

.announce-content {
  font-size: 15px;
  line-height: 1.6;
  color: #444;
  margin-bottom: 20px;
  white-space: pre-wrap;
}

.announce-btn {
  width: 100%;
  padding: 12px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.announce-btn:active { opacity: 0.8; }

/* ================================================================ *
 *  车库弹窗补充（modal-actions / fetch-btn）
 * ================================================================ */
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.modal-actions .save-btn,
.modal-actions .fetch-btn {
  flex: 1;
  margin: 0;
  height: 46px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
}

.fetch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.fetch-btn:active { opacity: 0.8; }

.fetch-btn svg {
  width: 15px;
  height: 15px;
}

/* ================================================================ *
 *  颜色选项补充
 * ================================================================ */
.color-option.selected {
  border: 2px solid #0a5cff;
  box-shadow: 0 0 0 2px rgba(10, 92, 255, 0.2);
}
