* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Noto Sans TC", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #e5e7eb;
  background:
    radial-gradient(circle at top left, rgba(30, 41, 59, 0.35) 0%, transparent 28%),
    radial-gradient(circle at top right, rgba(17, 24, 39, 0.25) 0%, transparent 24%),
    linear-gradient(180deg, #0b1020 0%, #0a0f1a 100%);
}

/* ===== 外層 ===== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 24px 36px;
}

h1 {
  margin: 0 0 14px;
  font-size: 28px;
  font-weight: 800;
  color: #f3f4f6;
}

h2 {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 800;
  color: #f3f4f6;
  text-align: center;
}

/* ===== 上方三欄 ===== */
.top-fields {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 18px;
  align-items: stretch;
  padding: 22px;
  border-radius: 18px;
  background: linear-gradient(180deg, #141a2a 0%, #111827 100%);
  border: 1px solid #1f2937;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label {
  font-size: 14px;
  font-weight: 700;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.field-error {
  font-size: 16px;
  color: #ef4444;
  margin-top: 2px;
}

/* ===== 上方三欄 input / select 統一 ===== */
.field-group input,
.field-group select,
.readonly-input,
.top-fields .readonly-input {
  width: 100%;
  height: 56px;
  min-width: 0;
  margin: 0;
  padding: 0 16px;

  background: transparent !important;
  background-color: transparent !important;
  color: #e5e7eb !important;

  border: none !important;
  outline: none !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08) !important;

  border-radius: 0 !important;

  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* placeholder */
.field-group input::placeholder,
.readonly-input::placeholder {
  color: #6b7280;
}

/* focus 時保持無框 */
.field-group input:focus,
.field-group select:focus,
.readonly-input:focus,
.top-fields .readonly-input:focus {
  background: transparent !important;
  background-color: transparent !important;
  color: #e5e7eb !important;
  border: none !important;
  outline: none !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14) !important;
}s

/* readonly */
.readonly-input,
.top-fields .readonly-input,
.readonly-input:hover,
.readonly-input:focus,
.top-fields .readonly-input:hover,
.top-fields .readonly-input:focus {
  background: transparent !important;
  background-color: transparent !important;
  color: #e5e7eb !important;
  border: none !important;
  outline: none !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08) !important;
  border-radius: 0 !important; 
  cursor: not-allowed;
}

/* select */
.field-group select,
.top-fields select {
  line-height: 56px;
  padding-right: 44px;
  display: block;

  background-color: transparent !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #94a3b8 50%),
    linear-gradient(135deg, #94a3b8 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 2px),
    calc(100% - 14px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* 移除 select 預設無效灰字 */
.field-group select:invalid,
.top-fields select:invalid {
  color: #9ca3af;
}

.field-group option,
.top-fields option {
  color: #e5e7eb;
  background: #111827;
}

.input-error {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.field-group.error .field-label {
  color: #f87171;
}

/* ===== tabs ===== */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 18px;
  justify-content: center;
  flex-direction: row;
}

.tab-btn {
  padding: 10px 18px;
  border: 1px solid #243041;
  border-radius: 12px;
  background: #111827;
  color: #d1d5db;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.tab-btn:hover {
  background: #172033;
  border-color: #334155;
  color: #f3f4f6;
}

.tab-btn.active {
  background: #1b2435;
  border-color: #3b475d;
  color: #ffffff;
}

/* ===== 主版面 ===== */
.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

.main-content {
  min-width: 0;
}

/* ===== 面板 ===== */
.panel {
  display: none;
  background: linear-gradient(180deg, #101827 0%, #0f172a 100%);
  border-radius: 18px;
  padding: 20px;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.panel.active {
  display: block;
}

/* ===== 零售卡片 ===== */
.qty-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 14px;
  margin-bottom: 12px;
}

.qty-info {
  min-width: 0;
}

.item-name {
  font-size: 18px;
  font-weight: 700;
  color: #f3f4f6;

  flex: 1; /* 🔥 這行才是關鍵 */
}

.item-price {
  font-size: 16px;
  color: #cbd5e1;
}

.qty-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.qty-box label,
.qty-label {
  font-size: 15px;
  font-weight: 700;
  color: #cbd5e1;
}

.qty-box input,
.full-maintenance-qty input {
  width: 108px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0b1220;
  color: #f3f4f6;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  outline: none;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease;
}

.qty-box input:hover,
.full-maintenance-qty input:hover {
  border-color: #475569;
}

.qty-box input:focus,
.full-maintenance-qty input:focus {
  border-color: #475569;
  background: #0f172a;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.08);
}

.qty-box input::-webkit-outer-spin-button,
.qty-box input::-webkit-inner-spin-button,
.full-maintenance-qty input::-webkit-outer-spin-button,
.full-maintenance-qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-box input[type="number"],
.full-maintenance-qty input[type="number"] {
  -moz-appearance: textfield;
}

/* ===== checkbox card ===== */
.check-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.check-card:hover {
  background: #172033;
  border-color: #334155;
}

.check-card input[type="checkbox"] {
  pointer-events: none; /* 只鎖checkbox */
}

.check-card input[type="checkbox"] {
  display: none;
}

.check-mark {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 999px;
  border: 2px solid #64748b;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease;
}

.check-card:hover .check-mark {
  border-color: #94a3b8;
}

.check-card input:checked + .check-mark {
  background: #334155;
  border-color: #94a3b8;
}

.check-card input:checked + .check-mark::after {
  content: "✓";
  color: #f8fafc;
  font-size: 13px;
  font-weight: 900;
}

.check-content {
  display: flex;
  align-items: center;
  width: 100%;
}

.check-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.check-card.disabled:hover {
  background: #111827;
  border-color: #1f2937;
  transform: none;
}

/* ===== 分隔線 ===== */
.divider {
  position: relative;
  height: 4px;
  border: none;
  margin: 24px 0;
  overflow: hidden;
  background: transparent;
}

.divider::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  transform: translateY(-50%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(90, 110, 150, 0.35) 12%,
    rgba(90, 110, 150, 0.35) 88%,
    transparent 100%
  );
  box-shadow: 0 0 6px rgba(90, 110, 150, 0.12);
}

.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -22%;
  width: 22%;
  height: 3px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(180, 205, 255, 0.00) 8%,
    rgba(180, 205, 255, 0.35) 28%,
    rgba(210, 225, 255, 0.85) 50%,
    rgba(180, 205, 255, 0.35) 72%,
    rgba(180, 205, 255, 0.00) 92%,
    transparent 100%
  );
  filter: blur(0.2px);
  box-shadow:
    0 0 8px rgba(160, 190, 255, 0.35),
    0 0 16px rgba(160, 190, 255, 0.12);
  animation: dividerSweep 2.8s linear infinite;
}

@keyframes dividerSweep {
  0% {
    left: -22%;
  }
  100% {
    left: 100%;
  }
}

.custom-input-card-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

/* 左邊文字 */
.inline-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: #e5e7eb;
  font-size: 16px;
}

.inline-desc {
  color: #cbd5e1;
  font-size: 15px;
  font-weight: 500;
}

.inline-hint {
  color: #60a5fa;
  font-weight: 600;
  font-size: 15px;
}

/* 右邊輸入 */
.inline-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-right span {
  font-size: 15px;
  color: #cbd5e1;
}

.inline-right input {
  width: 140px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0b1220;
  color: #fff;
  text-align: center;
  font-size: 15px;
}

/* ===== 全保養數量 ===== */
.full-maintenance-qty {
  display: none;
  align-items: center;
  gap: 12px;
  margin: 12px 0 4px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #0f172a;
  border: 1px solid #1f2937;
}

#fullMaintenance:checked ~ #fullMaintenanceQtyBox {
  display: flex;
}

/* ===== 訂單欄 ===== */
.cart-box {
  background: linear-gradient(180deg, #101827 0%, #0f172a 100%);
  border: 1px solid #1f2937;
  border-radius: 18px;
  padding: 18px;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.cart-box-inner {
  background: #111827;
  border: 1px solid #243041;
  border-radius: 16px;
  padding: 18px;
}

.preview-block {
  margin-bottom: 14px;
}

.preview-card {
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 14px;
}

.preview-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #f3f4f6;
}

.preview-line {
  font-size: 14px;
  color: #cbd5e1;
  margin-bottom: 6px;
  word-break: break-word;
}

.preview-subtotal {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #334155;
  font-size: 14px;
  font-weight: 800;
  color: #f3f4f6;
}

.total-line {
  margin: 20px 0 16px;
  font-size: 17px;
  font-weight: 800;
  color: #f3f4f6;
}

#grandTotal {
  font-size: 20px;
  color: #ffffff;
}

.submit-btn {
  width: 100%;
  height: 48px;
  border: 1px solid #374151;
  border-radius: 12px;
  background: #1f2937;
  color: #f9fafb;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.submit-btn:hover {
  background: #2a3444;
  border-color: #4b5563;
}

.submit-btn:active {
  transform: translateY(1px);
}

/* ===== 其他 ===== */
.field-hint {
  font-size: 14px;
  color: #94a3b8;
  font-weight: 600;
}

.top-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  margin-bottom: 14px;
  font-size: 15px;
}

.top-summary b {
  color: #f3f4f6;
}

.top-summary .hint {
  color: #94a3b8;
  font-weight: 700;
}

.top-summary span {
  color: #d1d5db;
}

.item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.item-qty {
  width: 80px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.vehicle-content {
  display: flex;
  align-items: center;
  width: 100%;
}


.vehicle-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.item-qty {
  width: 80px;
  height: 42px;

  font-size: 18px;
  text-align: center;

  color: #fff;
  background: #0f1b2d;

  border: 1px solid #2a3a55;
  border-radius: 10px;

  outline: none;
  transition: 0.2s;
}

.item-qty:focus {
  border-color: #4da3ff;
  box-shadow: 0 0 6px rgba(77, 163, 255, 0.5);
}

.check-content.vehicle-content {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 16px;
}

.item-name {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  color: #f3f4f6;
}

.qty-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.qty-label {
  font-size: 15px;
  font-weight: 700;
  color: #f3f4f6;
  white-space: nowrap;
}

.item-qty {
  width: 72px;
  height: 38px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  color: #fff;
  text-align: center;
  outline: none;
}

.item-qty::-webkit-outer-spin-button,
.item-qty::-webkit-inner-spin-button {
  opacity: 1;
}

.modify-card.active {
  border: 2px solid #00ff99;
  background: rgba(0,255,153,0.1);
}

.notice-box {
  margin-top: 16px;
  padding: 22px 20px;        /* 🔥 內距加大 */
  border-radius: 14px;
  background: #0f1b2d;
  border: 1px solid #2a3a55;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.35);
  width: 100%;
}

.notice-box h3 {
  margin-bottom: 12px;
  font-size: 16px;
  color: #8ab4ff;
}

/* 每一條 */
.notice-item {
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid #4da3ff;
  line-height: 1.6;
}

.check-card.active,
.qty-card.active {
  border: 1px solid #00c3ff;
  box-shadow: 0 0 12px rgba(0, 195, 255, 0.6);
  background: rgba(0, 195, 255, 0.08);
}

/* ===== RWD ===== */
@media (max-width: 1100px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .cart-box {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .top-fields {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .field-group {
    grid-template-rows: auto 18px 56px;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 20px 14px 28px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 19px;
  }

  .panel,
  .cart-box,
  .cart-box-inner,
  .top-fields {
    border-radius: 14px;
  }

  .qty-card {
    flex-direction: column;
    align-items: stretch;
  }

  .qty-box {
    justify-content: space-between;
  }

  .qty-box input,
  .full-maintenance-qty input {
    width: 100px;
  }

  .tab-btn {
    width: 100%;
    justify-content: center;
  }
}