/* ========== CSS Variables ========== */
:root {
  --primary: #FF6B6B;
  --primary-light: #FFF1F0;
  --primary-dark: #E85555;
  --accent: #FFB347;
  --accent-light: #FFF8EE;
  --success: #22C55E;
  --success-light: #ECFDF5;
  --warning: #F59E0B;
  --warning-light: #FFFBEB;
  --danger: #F87171;
  --danger-light: #FEF2F2;
  --text: #2D2D2D;
  --text-secondary: #6B7280;
  --text-light: #9CA3AF;
  --bg: #FAF8F5;
  --bg-white: #FFFFFF;
  --border: #EDE8E3;
  --shadow: 0 1px 3px rgba(140,100,60,0.08);
  --shadow-md: 0 4px 12px rgba(140,100,60,0.1);
  --shadow-lg: 0 8px 24px rgba(140,100,60,0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 56px;
  --tabbar-h: 60px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ========== Reset ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

input, textarea, button, select {
  font-family: inherit;
  font-size: inherit;
}

a { color: var(--primary); text-decoration: none; }

/* ========== Utilities ========== */
.hidden { display: none !important; }

/* ========== App Layout ========== */
#app {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg-white);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 641px) {
  body { display: flex; justify-content: center; background: #F5F0EB; }
  #app { border-radius: 0; }
}

#app-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.page { display: none; flex-direction: column; height: 100%; overflow-y: auto; }
.page.active { display: flex; }

/* ========== Login Page ========== */
#page-login {
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* Floating decorative circles */
#page-login .login-decor-1,
#page-login .login-decor-2,
#page-login .login-decor-3,
#page-login .login-decor-4,
#page-login .login-decor-5 {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

#page-login .login-decor-1 {
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.1);
  top: -60px;
  right: -40px;
  animation: loginFloat1 8s ease-in-out infinite;
}

#page-login .login-decor-2 {
  width: 140px;
  height: 140px;
  background: rgba(255,255,255,0.08);
  bottom: 80px;
  left: -50px;
  animation: loginFloat2 10s ease-in-out infinite;
}

#page-login .login-decor-3 {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.12);
  top: 40%;
  right: 10%;
  animation: loginFloat3 7s ease-in-out infinite;
}

#page-login .login-decor-4 {
  width: 50px;
  height: 50px;
  background: rgba(255,255,255,0.07);
  bottom: 20%;
  right: 5%;
  animation: loginFloat4 9s ease-in-out infinite;
}

#page-login .login-decor-5 {
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,0.1);
  top: 15%;
  left: 15%;
  animation: loginFloat5 6s ease-in-out infinite;
}

@keyframes loginFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-15px, 20px) scale(1.05); }
  50% { transform: translate(10px, 35px) scale(0.95); }
  75% { transform: translate(-10px, 15px) scale(1.02); }
}

@keyframes loginFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  30% { transform: translate(25px, -15px) scale(1.08); }
  60% { transform: translate(15px, -30px) scale(0.94); }
  80% { transform: translate(5px, -10px) scale(1.03); }
}

@keyframes loginFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.12; }
  50% { transform: translate(-20px, 25px) scale(1.15); opacity: 0.2; }
}

@keyframes loginFloat4 {
  0%, 100% { transform: translate(0, 0); opacity: 0.07; }
  40% { transform: translate(-10px, -20px); opacity: 0.14; }
  70% { transform: translate(5px, -35px); opacity: 0.09; }
}

@keyframes loginFloat5 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.1; }
  35% { transform: translate(12px, 15px) scale(1.3); opacity: 0.18; }
  65% { transform: translate(-8px, 25px) scale(0.9); opacity: 0.08; }
}

/* Login card entrance animation */
.login-container {
  width: 100%;
  max-width: 380px;
  position: relative;
  z-index: 1;
  animation: loginCardIn 0.6s ease-out;
}

@keyframes loginCardIn {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

.login-logo {
  text-align: center;
  color: #fff;
  margin-bottom: 32px;
}

.logo-icon {
  font-size: 48px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon i[data-lucide] {
  width: 48px;
  height: 48px;
}

.login-logo h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
}

.login-subtitle {
  margin-top: 4px;
  font-size: 14px;
  opacity: 0.85;
}

.login-form {
  background: var(--bg-white);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 8px 32px rgba(140,100,60,0.18);
}

/* ========== Login Mode Tabs ========== */
.login-mode-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
}

.login-mode-tab {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.login-mode-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ========== Code Input Row ========== */
.code-input-row {
  display: flex;
  gap: 8px;
}

.code-input-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text);
  background: var(--bg-white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.code-input-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,107,0.12);
}

.btn-send-code {
  white-space: nowrap;
  padding: 10px 14px;
  font-size: 13px;
  flex-shrink: 0;
}

.btn-send-code:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: var(--border);
  color: var(--text-secondary);
  background: var(--bg);
}

.login-hint {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.login-hint p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.hint-accounts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hint-tag {
  display: inline-block;
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.hint-tag:hover { background: #FFE0DE; }

.login-switch {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.login-switch a {
  color: var(--primary);
  font-weight: 500;
  margin-left: 4px;
}

/* ========== Form Elements ========== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.required { color: var(--danger); }

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text);
  background: var(--bg-white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,107,0.12);
}

.form-group textarea { resize: vertical; }

/* Field error highlight */
.field-error input,
.field-error textarea,
.field-error select,
.field-error .custom-select-trigger {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(248,113,113,0.15) !important;
}
.field-error .radio-label {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 2px rgba(248,113,113,0.12);
}

/* Custom Select Dropdown */
.custom-select { position: relative; }
.custom-select-trigger {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; color: var(--text); background: var(--bg-white);
  cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s;
  user-select: none;
}
.custom-select-trigger:hover { border-color: #ccc; }
.custom-select.open .custom-select-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,107,0.12);
}
.custom-select.open .custom-select-trigger i { transform: rotate(180deg); }
.custom-select-trigger i { transition: transform 0.2s; color: var(--text-secondary); }
.custom-select-text.placeholder { color: var(--text-secondary); }
.custom-select-dropdown {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg-white); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 100; max-height: 240px; overflow-y: auto;
  animation: selectDropIn 0.15s ease-out;
}
@keyframes selectDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.custom-select.open .custom-select-dropdown { display: block; }
.custom-select-option {
  padding: 10px 14px; font-size: 14px; cursor: pointer;
  transition: background 0.15s;
}
.custom-select-option:hover { background: #FFF1F1; }
.custom-select-option.selected { color: var(--primary); font-weight: 600; background: #FFF5F5; }
.custom-select-dropdown::-webkit-scrollbar { width: 4px; }
.custom-select-dropdown::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group { flex: 1; }

.radio-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  transition: all 0.2s;
  flex: 1;
  min-width: 150px;
}

.radio-label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

.radio-label input[type="radio"] {
  accent-color: var(--primary);
}

.radio-custom { display: none; }

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,107,107,0.3);
}

.btn-primary:hover {
  box-shadow: 0 4px 14px rgba(255,107,107,0.4);
  opacity: 0.95;
}
.btn-primary:active { transform: scale(0.98); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover { background: var(--primary-light); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}

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

.btn-small {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-block { width: 100%; }

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-icon:hover { background: var(--bg); }

/* ========== Header ========== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 16px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
  position: relative;
}

.app-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #FF6B6B, #FF8E53, #FFB347);
  opacity: 0.6;
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-balance {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  background: #FFF8EE;
  color: #FF8E53;
  font-weight: 600;
}

.header-user-menu {
  position: relative;
}

.user-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  min-width: 140px;
  z-index: 100;
  overflow: hidden;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.dropdown-item:hover {
  background: var(--bg-light);
}

.dropdown-item-danger {
  color: var(--danger);
}

.balance-hint {
  text-align: center;
  font-size: 14px;
  color: #FF8E53;
  font-weight: 500;
  margin-bottom: 8px;
}

/* ========== Wallet ========== */
.wallet-content { padding: 16px; }
.wallet-balance-card {
  background: linear-gradient(135deg, #FF6B6B, #FF8E53);
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  color: #fff;
  margin-bottom: 20px;
}
.wallet-balance-label { font-size: 14px; opacity: 0.9; }
.wallet-balance-amount { font-size: 36px; font-weight: 700; margin: 8px 0; }
.wallet-recharge-hint { font-size: 12px; opacity: 0.8; }
.wallet-transactions h4 { font-size: 15px; margin-bottom: 12px; }
.wallet-empty { text-align: center; color: #999; padding: 30px 0; font-size: 14px; }
.wallet-tx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}
.wallet-tx-type { font-size: 14px; font-weight: 500; }
.wallet-tx-detail { font-size: 12px; color: #999; margin-top: 2px; }
.wallet-tx-right { text-align: right; }
.wallet-tx-amount { font-size: 15px; font-weight: 600; }
.wallet-tx-amount.income { color: #52c41a; }
.wallet-tx-amount.expense { color: #FF6B6B; }
.wallet-tx-time { font-size: 11px; color: #bbb; margin-top: 2px; }
.wallet-pending { margin-bottom: 20px; }
.wallet-pending h4 { font-size: 15px; margin-bottom: 12px; color: #FF8E53; }

/* ========== Payment Modal ========== */
.payment-modal { text-align: center; }
.payment-info { margin-bottom: 16px; }
.payment-type { font-size: 14px; color: #666; }
.payment-amount { font-size: 32px; font-weight: 700; color: #FF6B6B; margin-top: 4px; }
.payment-qr { margin: 16px 0; }
.payment-qr-img { max-width: 220px; border-radius: 12px; border: 1px solid #eee; }
.payment-qr-placeholder { padding: 40px 20px; background: #f9f9f9; border-radius: 12px; color: #999; font-size: 14px; }
.payment-tips { text-align: left; font-size: 13px; color: #666; line-height: 1.8; margin: 16px 0; padding: 12px; background: #FFF8EE; border-radius: 8px; }
.payment-tips strong { color: #FF6B6B; }
.payment-upload { margin-top: 12px; }
.payment-upload-btn { cursor: pointer; }
.payment-qr-tabs { display: flex; justify-content: center; gap: 0; margin-bottom: 12px; border-radius: 8px; overflow: hidden; border: 1px solid #eee; width: fit-content; margin-left: auto; margin-right: auto; }
.payment-qr-tab { padding: 8px 24px; border: none; background: #f5f5f5; cursor: pointer; font-size: 14px; font-weight: 500; color: #666; transition: all .2s; }
.payment-qr-tab.active { background: #FF6B6B; color: #fff; }
.payment-qr-tab:first-child { border-right: 1px solid #eee; }

/* ========== Main Content ========== */
.app-main {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.app-main > .page {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.page-header {
  padding: 16px 16px 0;
  background: var(--bg-white);
  position: sticky;
  top: 0;
  z-index: 5;
}

.page-header h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

/* ========== Page Banner ========== */
.page-banner {
  margin: 10px 16px 6px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid;
}

.page-banner.browse-banner {
  background: #FFF5F2;
  border-color: #FFE0D6;
}

.page-banner.publish-banner {
  background: #FFF8EE;
  border-color: #FFE8C8;
}

.page-banner.myroutes-banner {
  background: #FFF1F0;
  border-color: #FFDAD8;
}

.page-banner.messages-banner {
  background: #F0F7FF;
  border-color: #D0E4FF;
}

.page-banner-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.browse-banner .page-banner-icon {
  background: #FFDED6;
  color: #E85555;
}

.publish-banner .page-banner-icon {
  background: #FFE4B8;
  color: #D48A00;
}

.myroutes-banner .page-banner-icon {
  background: #FFD4D2;
  color: #E85555;
}

.messages-banner .page-banner-icon {
  background: #C8DEFF;
  color: #3B7BDB;
}

.page-banner-icon i[data-lucide] {
  width: 20px;
  height: 20px;
}

.page-banner-text {
  flex: 1;
  min-width: 0;
}

.page-banner-text h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.page-banner-text p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* ========== Type Tabs ========== */
.type-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 10px; }
.type-tab { flex: 1; padding: 10px 0; border: none; background: transparent; font-size: 15px; font-weight: 600; color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; text-align: center; transition: all 0.2s; }
.type-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ========== Search & Filter ========== */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.search-bar input {
  flex: 1;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.search-bar input:focus { border-color: var(--primary); }

.search-btn {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #FF6B6B, #FF8E53) !important;
  color: #fff !important;
  border-radius: 50% !important;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.filter-tab {
  padding: 6px 16px;
  border: none;
  background: var(--bg);
  color: var(--text-secondary);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab.active {
  background: linear-gradient(135deg, #FF6B6B, #FF8E53);
  color: #fff;
}

/* ========== Route Cards ========== */
.route-list {
  padding: 12px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.route-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: box-shadow 0.25s, border-color 0.25s;
}

@media (hover: hover) {
  .route-card:hover {
    box-shadow: 0 4px 16px rgba(140,100,60,0.1);
    border-color: rgba(140,100,60,0.15);
  }
}

.route-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.route-direction {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.route-direction i[data-lucide] {
  width: 12px;
  height: 12px;
}

.route-direction.to-china {
  background: var(--success-light);
  color: #16A34A;
}

.route-direction.from-china {
  background: var(--warning-light);
  color: #D97706;
}

.route-direction.domestic {
  background: #EDE9FE;
  color: #7C3AED;
}

.route-date {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.route-date i[data-lucide] {
  width: 13px;
  height: 13px;
}

.route-cities {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.route-city {
  font-size: 17px;
  font-weight: 700;
}

.route-arrow {
  color: var(--primary);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0.6;
}

.route-arrow::before,
.route-arrow::after {
  content: '';
  width: 16px;
  height: 1.5px;
  background: var(--primary);
  opacity: 0.4;
  border-radius: 1px;
}

.route-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.route-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.route-meta-item i[data-lucide] {
  width: 14px;
  height: 14px;
}

.route-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.route-publisher {
  font-size: 13px;
  color: var(--text-secondary);
}

.route-actions {
  display: flex;
  gap: 8px;
}

/* ========== Route Card Tags ========== */
.route-card-tags { display: flex; align-items: center; gap: 6px; }
.route-type-tag.demand { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: #FEF3C7; color: #D97706; }

/* ========== Publish Form ========== */
.publish-form {
  padding: 16px;
  padding-bottom: 32px;
}

.publish-form .form-group label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.publish-form .form-group label i[data-lucide] {
  width: 15px;
  height: 15px;
  color: var(--primary);
  opacity: 0.7;
}

/* ========== Empty State ========== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  color: var(--text-secondary);
}

.empty-icon {
  margin-bottom: 12px;
}

.empty-icon svg {
  width: 120px;
  height: 120px;
}

.empty-state p {
  font-size: 15px;
  margin-bottom: 16px;
}

/* ========== Route Detail ========== */
.detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.detail-header h3 {
  font-size: 17px;
  font-weight: 600;
}

.detail-content {
  padding: 16px;
}

.detail-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.detail-route-visual {
  background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
  color: #fff;
  padding: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Decorative circle in detail header */
.detail-route-visual::before {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  top: -40px;
  right: -20px;
  pointer-events: none;
}

.detail-route-visual::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  bottom: -20px;
  left: 10%;
  pointer-events: none;
}

.detail-route-cities {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.detail-city {
  font-size: 24px;
  font-weight: 700;
}

.detail-arrow {
  font-size: 20px;
  opacity: 0.8;
}

.detail-direction-tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.2);
  position: relative;
  z-index: 1;
}

.detail-info {
  padding: 16px;
}

.detail-info-row {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.detail-info-row:last-child { border-bottom: none; }

.detail-info-label {
  width: 80px;
  flex-shrink: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.detail-info-value {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  word-break: break-all;
}

.detail-actions {
  padding: 16px;
  display: flex;
  gap: 12px;
}

.detail-actions .btn { flex: 1; }

/* ========== Conversations List ========== */
.conversation-list {
  padding: 8px 16px;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.conversation-item:active { background: var(--bg); }

.conversation-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFF1F0, #FFF8EE);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  border: 2px solid var(--primary-light);
}

.conversation-info {
  flex: 1;
  min-width: 0;
}

.conversation-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.conversation-last {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-meta {
  text-align: right;
  flex-shrink: 0;
}

.conversation-time {
  font-size: 12px;
  color: var(--text-light);
}

.conversation-unread {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 18px;
  padding: 0 5px;
  margin-top: 4px;
}

/* ========== Chat ========== */
.chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.chat-header-info { flex: 1; }

.chat-header-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.chat-header-route {
  font-size: 12px;
  color: var(--text-secondary);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
}

.chat-msg {
  max-width: 78%;
  display: flex;
  flex-direction: column;
}

.chat-msg.sent {
  align-self: flex-end;
}

.chat-msg.received {
  align-self: flex-start;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.chat-msg.sent .chat-bubble {
  background: linear-gradient(135deg, #FF6B6B, #FF8E53);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg.received .chat-bubble {
  background: #FFF9F7;
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-time {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
  padding: 0 4px;
}

.chat-msg.sent .chat-time { text-align: right; }

.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  padding-bottom: calc(10px + var(--safe-bottom));
  background: var(--bg-white);
  border-top: 1px solid var(--border);
}

.chat-input-bar input {
  flex: 1;
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  outline: none;
}

.chat-input-bar input:focus { border-color: var(--primary); }

.btn-send {
  border-radius: 24px !important;
  padding: 10px 20px !important;
}

/* ========== Tab Bar ========== */
.tab-bar {
  display: flex;
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  flex-shrink: 0;
  z-index: 10;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s;
  position: relative;
}

.tab-item.active { color: var(--primary); }
.tab-item svg,
.tab-item i[data-lucide] { stroke: currentColor; }

.tab-item i[data-lucide] {
  width: 22px;
  height: 22px;
}

/* Active tab dot indicator */
.tab-item.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
}

.badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 20px);
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  line-height: 16px;
  padding: 0 4px;
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(45,45,45,0.85);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 1000;
  pointer-events: none;
  animation: toastFade 2s ease forwards;
}

@keyframes toastFade {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; }
}

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(45,45,45,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.modal {
  background: var(--bg-white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h4 { font-size: 16px; }

.modal-close {
  font-size: 22px;
  width: 32px;
  height: 32px;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ========== Responsive ========== */
@media (max-width: 380px) {
  .form-row { flex-direction: column; gap: 0; }
  .radio-group { flex-direction: column; gap: 8px; }
  .detail-city { font-size: 20px; }
}

@media (min-width: 641px) {
  #app { height: 100vh; }
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ========== Date Expired ========== */
.route-card.expired { opacity: 0.55; }
.expired-tag {
  font-size: 11px;
  color: var(--text-light);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ========== Legal & Compliance ========== */
.legal-banner {
  background: #FFF7ED;
  border: 1px solid #FDBA74;
  color: #9A3412;
  font-size: 12px;
  padding: 10px 16px;
  margin: 12px 16px 0;
  border-radius: var(--radius-sm);
  line-height: 1.5;
  text-align: center;
}

.legal-disclaimer {
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.6;
  text-align: center;
  padding: 8px 16px;
}

.login-legal {
  margin-top: 16px;
  color: rgba(255,255,255,0.7);
}

.legal-checkbox {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.legal-checkbox label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.5;
}

.legal-checkbox input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--primary);
}

/* ========== Locked Fields & Unlock ========== */
.locked-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-light);
  font-size: 14px;
  font-style: italic;
}

.locked-field i[data-lucide] {
  width: 14px;
  height: 14px;
}

.unlock-buttons {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.unlock-buttons .btn {
  width: 100%;
  padding: 12px 20px;
  font-size: 15px;
}

.unlock-buttons .btn i[data-lucide] {
  width: 18px;
  height: 18px;
}

.btn-unlock {
  background: linear-gradient(135deg, #FFB347 0%, #FF6B6B 100%);
  color: #fff;
  border: none;
}

.btn-unlock:hover {
  opacity: 0.9;
}

.btn-member {
  background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
  color: #fff;
  border: none;
}

.btn-member:hover {
  opacity: 0.9;
}

/* ========== Content Warning ========== */
.content-warning {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  padding-left: 2px;
}

/* ========== Chat Disclaimer ========== */
.chat-disclaimer {
  font-size: 11px;
  color: var(--text-light);
  text-align: center;
  padding: 6px 16px 0;
  background: var(--bg-white);
}

/* ========== Notifications ========== */
.notification-section-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 12px 16px 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.notification-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.notification-item.unread {
  background: var(--primary-light);
}

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.notification-icon i[data-lucide] {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.notification-body {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.notification-content {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 4px;
}

.notification-time {
  font-size: 12px;
  color: var(--text-light);
}

/* ========== Detail Disclaimer ========== */
.detail-legal {
  font-size: 11px;
  color: var(--text-light);
  text-align: center;
  padding: 12px 16px;
  line-height: 1.6;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}
