/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
}
button { border: none; background: none; font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(255, 109, 31, 0.35);
  outline-offset: 2px;
}

/* ===== Page Container ===== */
.page-container {
  padding: calc(24px + env(safe-area-inset-top))
    calc(16px + env(safe-area-inset-right))
    calc(48px + env(safe-area-inset-bottom))
    calc(16px + env(safe-area-inset-left));
}
.page-title {
  text-align: center;
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  color: #1a1a1a;
  margin-bottom: 24px;
}
.private-test-notice {
  margin: -12px auto 24px;
  width: fit-content;
  max-width: 100%;
  padding: 7px 14px;
  border: 1px solid #ffb98f;
  border-radius: 999px;
  background: #fff8f3;
  color: #b84b10;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

/* ===== Sections ===== */
.section { margin-bottom: 32px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.section-title { font-size: 1.125rem; font-weight: bold; color: #1a1a1a; }
.section-hint { font-size: 0.875rem; color: #999; display: block; margin-bottom: 10px; }
.required { color: #e53935; }

/* ===== Header Actions ===== */
.header-actions { display: flex; align-items: center; gap: 8px; }
.clear-btn {
  font-size: 0.8rem; color: #999;
  border: 1px solid #ccc; border-radius: 20px;
  min-height: 44px; padding: 4px 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.clear-btn:active { background: #f5f5f5; }
.addr-book-btn {
  font-size: 0.8rem; color: #ff6d1f;
  border: 1px solid #ff6d1f; border-radius: 20px;
  min-height: 44px; padding: 4px 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.addr-book-btn:active { background: #fff8f3; }

/* ===== Input Fields ===== */
.input-field {
  width: 100%; height: 48px;
  font-size: 1rem; color: #333;
  background: #fff; border: 1px solid #e0e0e0; border-radius: 10px;
  padding: 0 14px; outline: none;
  -webkit-appearance: none;
}
.input-field:focus { border-color: #ff6d1f; }

/* ===== Suggest List ===== */
.suggest-list {
  background: #fff;
  border: 1px solid #e0e0e0; border-top: none;
  border-radius: 0 0 10px 10px;
  overflow: hidden;
}
.suggest-item {
  display: flex; flex-direction: column;
  width: 100%; min-height: 56px; text-align: left;
  padding: 11px 16px; border-top: 1px solid #f0f0f0;
  cursor: pointer;
}
.suggest-item:active { background: #f5f5f5; }
.suggest-main { font-size: 0.95rem; color: #333; font-weight: 500; }
.suggest-sub { font-size: 0.8rem; color: #999; margin-top: 2px; }

/* ===== Time ===== */
.time-toggle { display: flex; gap: 10px; margin-bottom: 14px; }
.time-opt {
  flex: 1; text-align: center; padding: 14px;
  background: #fff; border: 1px solid #e0e0e0; border-radius: 10px;
  font-size: 0.95rem; color: #666; cursor: pointer; white-space: nowrap;
}
.time-opt.active {
  border-color: #ff6d1f; color: #ff6d1f;
  background: #fff8f3; font-weight: bold;
}
.datetime-row { display: flex; gap: 10px; }

/* Scheduled date chips */
.date-scroll {
  display: flex; gap: 8px; overflow-x: auto;
  margin-bottom: 10px; padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.date-chip {
  flex: 0 0 auto; text-align: center; min-width: 64px;
  padding: 8px 14px; background: #fff;
  border: 1px solid #e0e0e0; border-radius: 10px; cursor: pointer;
}
.date-chip-active { border-color: #ff6d1f; background: #fff8f3; }
.date-chip-label { display: block; font-size: 0.95rem; font-weight: bold; color: #333; }
.date-chip-active .date-chip-label { color: #ff6d1f; }
.date-chip-sub { display: block; font-size: 0.75rem; color: #999; margin-top: 2px; }
.date-chip-active .date-chip-sub { color: #ff6d1f; }
.picker-box {
  flex: 1; background: #fff; border: 1px solid #e0e0e0;
  border-radius: 10px; padding: 14px 16px;
}
.picker-label { font-size: 0.75rem; color: #999; display: block; }
.picker-input {
  border: none; background: none; font-size: 1rem; color: #333;
  width: 100%; padding: 4px 0; outline: none;
  -webkit-appearance: none;
}
.time-selects {
  display: flex; align-items: center; gap: 4px; margin-top: 4px;
}
.time-selects select {
  font-size: 1rem; border: none; background: none;
  color: #333; outline: none; padding: 2px;
  -webkit-appearance: none; text-align: center;
}
.time-colon { font-size: 1rem; color: #333; font-weight: bold; }

/* ===== Phone ===== */
.phone-header { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.phone-row { display: flex; align-items: center; gap: 10px; }
.phone-prefix { font-size: 1.1rem; font-weight: bold; color: #333; white-space: nowrap; }
.phone-input { flex: 1; }
.error-text { font-size: 0.8rem; color: #e53935; margin-top: 8px; display: block; }

/* ===== Payment ===== */
.payment-notice {
  background: #fff; border-radius: 10px; padding: 20px;
  margin-bottom: 32px; text-align: center;
}
.payment-title { font-size: 0.85rem; color: #999; display: block; margin-bottom: 4px; }
.payment-text { font-size: 1rem; color: #333; }
.payment-highlight { color: #ff6d1f; font-weight: bold; }

/* ===== Buttons ===== */
.btn-primary {
  width: 100%; height: 48px; line-height: 48px;
  background: #ff6d1f; color: #fff; font-size: 1rem;
  border-radius: 10px; text-align: center; cursor: pointer;
  display: block; font-weight: bold;
}
.btn-primary:active { background: #e55d10; }
.btn-primary:disabled { background: #ccc; color: #999; cursor: not-allowed; }

.btn-outline {
  width: 100%; height: 48px; line-height: 48px;
  background: #fff; color: #ff6d1f; font-size: 1rem;
  border: 1px solid #ff6d1f; border-radius: 10px;
  text-align: center; cursor: pointer; display: block;
}
.btn-outline:active { background: #fff8f3; }

.btn-save-addr {
  width: 100%; height: 48px; line-height: 48px;
  background: #ff6d1f; color: #fff; font-size: 1rem;
  border-radius: 10px; text-align: center; cursor: pointer;
}
.btn-save-addr:active { background: #e55d10; }
.btn-save-addr:disabled { background: #ccc; color: #999; cursor: not-allowed; }

.btn-outline-danger {
  width: 100%; height: 48px; line-height: 48px;
  background: #fff; color: #e53935; font-size: 1rem;
  border: 1px solid #e53935; border-radius: 10px;
  text-align: center; cursor: pointer; display: block;
}

.btn-secondary {
  width: 100%; height: 48px; line-height: 48px;
  background: #f5f5f5; color: #666; font-size: 1rem;
  border-radius: 10px; text-align: center; cursor: pointer;
  display: block;
}

/* ===== Submit ===== */
.submit-section { margin-bottom: 32px; }

/* ===== Loading ===== */
.loading-mask {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); display: flex;
  align-items: center; justify-content: center;
  color: #fff; font-size: 1.1rem; z-index: 9999;
}

/* ===== Modals ===== */
.modal-mask {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 5000;
  display: flex; align-items: center; justify-content: center;
  max-width: 480px; margin: 0 auto;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Confirm Modal */
.confirm-panel {
  background: #fff; border-radius: 16px;
  width: 90%; max-width: 360px; padding: 32px 24px 24px;
  max-height: calc(100dvh - 32px); overflow-y: auto;
}
.confirm-title { font-size: 1.25rem; font-weight: bold; display: block; text-align: center; margin-bottom: 4px; }
.confirm-desc { font-size: 0.8rem; color: #999; display: block; text-align: center; margin-bottom: 20px; }
.confirm-card { background: #f8f8f8; border-radius: 10px; padding: 14px 18px; margin-bottom: 20px; }
.confirm-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid #eee; }
.confirm-row:last-child { border-bottom: none; }
.confirm-label { font-size: 0.85rem; color: #999; white-space: nowrap; margin-right: 10px; }
.confirm-val { font-size: 0.85rem; color: #333; text-align: right; word-break: break-all; }
.confirm-proceed-btn { width: 100%; }
.confirm-back {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 44px; text-align: center;
  font-size: 0.85rem; color: #777; margin-top: 6px; cursor: pointer;
}

/* Verify Modal */
.verify-panel {
  background: #fff; border-radius: 16px;
  width: 90%; max-width: 340px; padding: 32px 24px 24px;
  text-align: center;
  max-height: calc(100dvh - 32px); overflow-y: auto;
}
.verify-title { font-size: 1.25rem; font-weight: bold; display: block; margin-bottom: 8px; }
.verify-desc { font-size: 0.85rem; color: #999; display: block; margin-bottom: 20px; }
.verify-input-row { margin-bottom: 14px; }
.verify-code-input {
  border: 1px solid #e0e0e0; border-radius: 8px;
  height: 48px; padding: 0 14px; font-size: 1.2rem;
  text-align: center; letter-spacing: 6px; width: 100%;
  outline: none;
}
.verify-code-input:focus { border-color: #ff6d1f; }
.verify-btn { margin-top: 10px; }
.verify-cancel {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 44px; font-size: 0.85rem;
  color: #777; margin-top: 6px; cursor: pointer;
}

/* Bottom Sheet (Address Book / Phone Book / Trip Book) */
.addr-book-panel {
  background: #f5f5f5; border-radius: 20px 20px 0 0;
  width: 100%; max-height: 80vh; overflow-y: auto;
  padding: 0 calc(20px + env(safe-area-inset-right))
    calc(32px + env(safe-area-inset-bottom))
    calc(20px + env(safe-area-inset-left));
  position: fixed; bottom: 0;
  max-width: 480px;
}
.addr-book-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 0 16px; position: sticky; top: 0; background: #f5f5f5;
  z-index: 1;
}
.addr-book-title { font-size: 1.25rem; font-weight: bold; }
.addr-book-close {
  min-width: 44px; min-height: 44px; display: inline-flex;
  align-items: center; justify-content: flex-end;
  font-size: 1rem; color: #ff6d1f; cursor: pointer;
}

.addr-book-empty { text-align: center; padding: 40px 0; color: #999; font-size: 0.9rem; }

.addr-item {
  background: #fff; border-radius: 10px; padding: 14px 18px;
  margin-bottom: 10px; display: flex; align-items: center; gap: 10px;
}
.addr-item:active { background: #f9f9f9; }
.addr-label {
  background: #ff6d1f; color: #fff; font-size: 0.8rem;
  font-weight: bold; border-radius: 6px; padding: 3px 10px;
  white-space: nowrap; min-width: 44px; text-align: center;
}
.addr-text { flex: 1; font-size: 0.85rem; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addr-del {
  min-width: 44px; min-height: 44px; display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 0.75rem; color: #999; padding: 4px; cursor: pointer;
}
.addr-del:active { color: #e53935; }

/* Add Address Section */
.addr-add-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid #e0e0e0; }
.addr-add-title { font-size: 0.95rem; font-weight: bold; margin-bottom: 10px; display: block; }
.addr-add-row { display: flex; gap: 8px; margin-bottom: 10px; }
.addr-label-input {
  width: 110px; height: 48px; font-size: 0.9rem;
  border: 1px solid #e0e0e0; border-radius: 10px;
  padding: 0 11px; background: #fff; outline: none;
}
.addr-label-input:focus { border-color: #ff6d1f; }
.addr-text-input {
  flex: 1; height: 48px; font-size: 0.9rem;
  border: 1px solid #e0e0e0; border-radius: 10px;
  padding: 0 11px; background: #fff; outline: none;
}
.addr-text-input:focus { border-color: #ff6d1f; }

.addr-suggest-list {
  background: #fff; border: 1px solid #e0e0e0; border-top: none;
  border-radius: 0 0 10px 10px; overflow: hidden; margin-bottom: 10px;
}

/* Trip Chips */
.trip-bar-section { margin-bottom: 20px; }
.save-trip-btn {
  font-size: 0.8rem; color: #ff6d1f;
  border: 1px solid #ff6d1f; border-radius: 20px;
  min-height: 44px; padding: 3px 12px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.save-trip-btn:active { background: #fff8f3; }
.trip-list { display: flex; flex-wrap: wrap; gap: 10px; }
.trip-chip {
  background: #fff; border: 1px solid #e0e0e0; border-radius: 10px;
  padding: 10px 14px; display: flex; flex-direction: column;
  min-width: 80px; cursor: pointer;
}
.trip-chip:active { background: #f9f9f9; }
.trip-chip-active { border-color: #ff6d1f; background: #fff8f3; }
.trip-chip-label { font-size: 0.85rem; font-weight: bold; color: #333; }
.trip-chip-route { font-size: 0.7rem; color: #999; margin-top: 2px; }
.trip-empty { font-size: 0.8rem; color: #999; padding: 10px 0; }

/* Trip Book Form */
.trip-addr-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.trip-addr-label { font-size: 0.85rem; color: #999; width: 48px; white-space: nowrap; }
.trip-addr-input {
  flex: 1; height: 44px; font-size: 0.85rem;
  border: 1px solid #e0e0e0; border-radius: 8px;
  padding: 0 10px; background: #fff; outline: none;
}
.trip-addr-input:focus { border-color: #ff6d1f; }

.addr-tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.addr-tag {
  font-size: 0.75rem; color: #ff6d1f; background: #fff8f3;
  border: 1px solid #ff6d1f; border-radius: 14px;
  min-height: 44px; padding: 3px 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.addr-tag:active { background: #ff6d1f; color: #fff; }

.trip-suggest-list {
  background: #fff; border: 1px solid #e0e0e0; border-top: none;
  border-radius: 0 0 8px 8px; overflow: hidden; margin-bottom: 8px;
}

.trip-fill-hint {
  display: block; text-align: center; font-size: 0.8rem;
  color: #999; margin-top: 12px;
}
.trip-fill-btn {
  width: 100%; min-height: 44px; display: flex;
  align-items: center; justify-content: center; text-align: center; font-size: 0.85rem;
  color: #ff6d1f; margin-top: 4px; cursor: pointer;
}

/* ===== Result Page ===== */
.result-header { text-align: center; padding: 24px 0; }
.result-icon { font-size: 3rem; }
.success-icon { color: #4caf50; }
.error-icon { color: #e53935; }
.result-title { font-size: 1.4rem; font-weight: bold; display: block; margin-top: 8px; }
.result-desc { display: block; text-align: center; color: #999; font-size: 0.95rem; padding: 0 20px; }

.card { background: #fff; border-radius: 10px; padding: 16px 18px; margin-bottom: 14px; }
.booking-id-card { text-align: center; }
.booking-id-label { font-size: 0.8rem; color: #999; display: block; }
.booking-id-value { font-size: 1.5rem; font-weight: bold; color: #ff6d1f; display: block; margin-top: 4px; }

.detail-row { display: flex; justify-content: space-between; padding: 12px 0; }
.detail-label { font-size: 0.85rem; color: #999; }
.detail-value { font-size: 0.85rem; color: #333; text-align: right; }
.pickup-value { color: #ff6d1f; }
.divider { height: 1px; background: #f0f0f0; }

.sms-card { text-align: center; }
.sms-text { font-size: 0.8rem; color: #999; }

.tip-card { text-align: center; }
.tip-title { font-size: 0.8rem; color: #999; display: block; margin-bottom: 4px; }
.tip-text { font-size: 0.9rem; color: #333; display: block; }
.tip-phone { font-size: 0.8rem; color: #666; margin-top: 6px; display: block; }
.phone-link { color: #ff6d1f; font-weight: bold; }

.cancelled-card { text-align: center; }
.cancelled-text { font-size: 1rem; color: #e53935; }

.button-group { padding: 0 0 24px; display: flex; flex-direction: column; gap: 10px; }

/* ===== Bookings Page ===== */
.booking-card {
  background: #fff; border-radius: 10px; padding: 16px 18px;
  margin-bottom: 12px; cursor: pointer;
}
.booking-card:active { background: #f9f9f9; }
.booking-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.booking-id { font-size: 1rem; font-weight: bold; color: #ff6d1f; }
.booking-status { font-size: 0.8rem; color: #4caf50; background: #e8f5e9; padding: 2px 8px; border-radius: 4px; }
.booking-route { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 0.85rem; }
.booking-pickup { color: #333; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.booking-arrow { color: #999; }
.booking-dropoff { color: #333; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.booking-footer { display: flex; justify-content: space-between; font-size: 0.78rem; color: #999; }
.booking-driver { font-size: 0.78rem; color: #666; margin-top: 6px; display: flex; gap: 12px; }

.empty-state { text-align: center; padding: 60px 20px; }
.empty-text { font-size: 1rem; color: #999; display: block; margin-bottom: 4px; }
.empty-hint { font-size: 0.85rem; color: #ccc; display: block; }
.hint-text { text-align: center; font-size: 0.8rem; color: #ccc; padding: 16px 0; }

/* ===== Toast ===== */
.toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75); color: #fff; font-size: 0.9rem;
  padding: 12px 24px; border-radius: 8px; z-index: 9999;
  pointer-events: none; white-space: nowrap;
}

/* ===== Back button ===== */
.back-header {
  display: flex; align-items: center; padding: 12px 0 20px; gap: 12px;
}
.back-btn {
  min-height: 44px; display: inline-flex; align-items: center;
  font-size: 1rem; color: #ff6d1f; cursor: pointer; padding: 4px 8px;
}
.back-title { font-size: 1.2rem; font-weight: bold; }
