/* =============================================
   灵眸 - 盲人智能出行软件 Web Demo
   全局样式表
   ============================================= */

/* --- CSS Variables --- */
:root {
  --primary: #4A90D9;
  --primary-light: #6BA3E0;
  --primary-dark: #3A7BC8;
  --primary-bg: rgba(74, 144, 217, 0.08);
  --success: #52C41A;
  --success-light: #95DE64;
  --success-bg: rgba(82, 196, 26, 0.08);
  --danger: #FF6B6B;
  --danger-light: #FF9999;
  --danger-bg: rgba(255, 107, 107, 0.08);
  --warning: #FFA940;
  --warning-light: #FFC069;
  --warning-bg: rgba(255, 169, 64, 0.08);

  --bg: #F5F7FA;
  --bg-white: #FFFFFF;
  --bg-card: #FFFFFF;

  --text-primary: #333333;
  --text-secondary: #666666;
  --text-hint: #999999;
  --text-white: #FFFFFF;

  --border: #E8ECF0;
  --border-light: #F0F2F5;
  --divider: #F0F2F5;

  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.12);
  --shadow-primary: 0 4px 16px rgba(74, 144, 217, 0.3);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 50%;

  --font-xs: 11px;
  --font-sm: 12px;
  --font-base: 14px;
  --font-md: 16px;
  --font-lg: 18px;
  --font-xl: 20px;
  --font-2xl: 24px;
  --font-3xl: 28px;
  --font-4xl: 36px;

  --nav-height: 60px;
  --header-height: 50px;
  --max-width: 430px;

  --transition: all 0.3s ease;
  --transition-fast: all 0.15s ease;
}

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

html {
  font-size: 14px;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-primary);
  background: #E8ECF0;
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

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

img {
  max-width: 100%;
  display: block;
}

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

ul, ol {
  list-style: none;
}

/* --- App Container --- */
#app {
  width: 100%;
  max-width: var(--max-width);
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* --- Page System --- */
.page {
  display: none;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + 20px);
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

.page.no-nav {
  padding-bottom: 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes ripple {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 144, 217, 0.4); }
  50% { box-shadow: 0 0 0 15px rgba(74, 144, 217, 0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* --- Page Header --- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  height: var(--header-height);
  background: var(--bg-white);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-light);
}

.page-header .back-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.page-header .back-btn:active {
  background: var(--bg);
}

.page-header .title {
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--text-primary);
}

.page-header .action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

/* --- Bottom Navigation --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  height: var(--nav-height);
  background: var(--bg-white);
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-top: 1px solid var(--border-light);
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 0;
  color: var(--text-hint);
  transition: var(--transition-fast);
  position: relative;
}

.bottom-nav .nav-item.active {
  color: var(--primary);
}

.bottom-nav .nav-item .nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav .nav-item .nav-icon svg {
  width: 22px;
  height: 22px;
}

.bottom-nav .nav-item .nav-label {
  font-size: var(--font-xs);
  font-weight: 500;
}

.bottom-nav .nav-item.sos-tab {
  position: relative;
}

.bottom-nav .nav-item.sos-tab .nav-icon {
  width: 40px;
  height: 40px;
  background: var(--danger);
  border-radius: var(--radius-full);
  margin-top: -12px;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}

.bottom-nav .nav-item.sos-tab .nav-icon svg {
  color: white;
  width: 20px;
  height: 20px;
}

.bottom-nav .nav-item.sos-tab.active {
  color: var(--danger);
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 16px 12px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:active {
  transform: scale(0.98);
}

.card-title {
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.card-desc {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: var(--font-base);
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--primary);
  color: var(--text-white);
  box-shadow: var(--shadow-primary);
}

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

.btn-success {
  background: var(--success);
  color: var(--text-white);
}

.btn-danger {
  background: var(--danger);
  color: var(--text-white);
}

.btn-warning {
  background: var(--warning);
  color: var(--text-white);
}

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

.btn-ghost {
  color: var(--text-secondary);
  background: var(--bg);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-lg {
  padding: 14px 32px;
  font-size: var(--font-md);
  border-radius: var(--radius-xl);
}

.btn-sm {
  padding: 8px 16px;
  font-size: var(--font-sm);
}

.btn-round {
  border-radius: var(--radius-xl);
}

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

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

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--font-base);
  color: var(--text-primary);
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--primary);
  background: var(--bg-white);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.form-input::placeholder {
  color: var(--text-hint);
}

.input-group {
  position: relative;
}

.input-group .form-input {
  padding-right: 44px;
}

.input-group .input-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-hint);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Toggle Switch --- */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #D9D9D9;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  background: var(--bg-white);
  border-radius: var(--radius-full);
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.toggle input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* --- Setting Item --- */
.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--divider);
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-item .setting-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.setting-item .setting-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.setting-item .setting-icon.blue { background: var(--primary-bg); color: var(--primary); }
.setting-item .setting-icon.green { background: var(--success-bg); color: var(--success); }
.setting-item .setting-icon.red { background: var(--danger-bg); color: var(--danger); }
.setting-item .setting-icon.orange { background: var(--warning-bg); color: var(--warning); }

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

.setting-item .setting-name {
  font-size: var(--font-base);
  color: var(--text-primary);
  font-weight: 500;
}

.setting-item .setting-desc {
  font-size: var(--font-xs);
  color: var(--text-hint);
  margin-top: 2px;
}

.setting-item .setting-arrow {
  color: var(--text-hint);
  flex-shrink: 0;
  margin-left: 8px;
}

/* --- Tags / Badges --- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: var(--font-xs);
  font-weight: 500;
}

.tag-primary { background: var(--primary-bg); color: var(--primary); }
.tag-success { background: var(--success-bg); color: var(--success); }
.tag-danger { background: var(--danger-bg); color: var(--danger); }
.tag-warning { background: var(--warning-bg); color: var(--warning); }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: var(--text-white);
  font-size: 10px;
  font-weight: 600;
}

/* --- Status Indicator --- */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.status-dot.active { background: var(--success); }
.status-dot.inactive { background: var(--text-hint); }
.status-dot.warning { background: var(--warning); }
.status-dot.danger { background: var(--danger); }

/* --- Toast Notification --- */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  width: 100%;
  max-width: var(--max-width);
  padding: 0 16px;
  pointer-events: none;
}

.toast {
  background: rgba(51, 51, 51, 0.92);
  color: var(--text-white);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  animation: slideDown 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
}

.toast.toast-success { background: rgba(82, 196, 26, 0.92); }
.toast.toast-danger { background: rgba(255, 107, 107, 0.92); }
.toast.toast-warning { background: rgba(255, 169, 64, 0.92); }

.toast.toast-exit {
  animation: fadeOutUp 0.3s ease forwards;
}

@keyframes fadeOutUp {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-20px); }
}

/* --- Modal / Overlay --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 340px;
  padding: 24px;
  animation: scaleIn 0.3s ease;
}

.modal-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.modal-icon.blue { background: var(--primary-bg); color: var(--primary); }
.modal-icon.green { background: var(--success-bg); color: var(--success); }
.modal-icon.red { background: var(--danger-bg); color: var(--danger); }
.modal-icon.orange { background: var(--warning-bg); color: var(--warning); }

.modal-title {
  font-size: var(--font-lg);
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

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

/* --- Bottom Sheet --- */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 5000;
  display: none;
}

.bottom-sheet-overlay.active {
  display: block;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  background: var(--bg-white);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 5001;
  padding: 20px;
  animation: slideUp 0.3s ease;
  max-height: 70vh;
  overflow-y: auto;
}

.bottom-sheet .sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.bottom-sheet .sheet-title {
  font-size: var(--font-md);
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
}

/* --- Section Headers --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
}

.section-title {
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--text-primary);
}

.section-action {
  font-size: var(--font-sm);
  color: var(--primary);
  font-weight: 500;
}

/* --- Grid --- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px;
  margin-bottom: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  padding: 0 16px;
  margin-bottom: 12px;
}

.grid-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
}

.grid-item:active {
  transform: scale(0.96);
}

.grid-item .grid-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-item .grid-label {
  font-size: var(--font-sm);
  color: var(--text-primary);
  font-weight: 500;
  text-align: center;
}

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

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state .empty-text {
  font-size: var(--font-base);
  margin-bottom: 12px;
}

/* --- List Item --- */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  transition: var(--transition-fast);
  cursor: pointer;
}

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

.list-item + .list-item {
  border-top: 1px solid var(--divider);
}

.list-item .item-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.list-item .item-content {
  flex: 1;
  min-width: 0;
}

.list-item .item-title {
  font-size: var(--font-base);
  font-weight: 500;
  color: var(--text-primary);
}

.list-item .item-subtitle {
  font-size: var(--font-xs);
  color: var(--text-hint);
  margin-top: 2px;
}

.list-item .item-extra {
  flex-shrink: 0;
  color: var(--text-hint);
}

/* --- Progress Bar --- */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar .progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.progress-fill.blue { background: var(--primary); }
.progress-fill.green { background: var(--success); }

/* --- Onboarding Page --- */
.onboarding-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
}

.onboarding-progress {
  padding: 16px 20px;
  display: flex;
  gap: 6px;
}

.onboarding-progress .dot {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  transition: var(--transition);
}

.onboarding-progress .dot.active {
  background: var(--primary);
}

.onboarding-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 24px;
  text-align: center;
}

.onboarding-icon {
  width: 120px;
  height: 120px;
  background: var(--primary-bg);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.onboarding-icon svg {
  width: 56px;
  height: 56px;
  color: var(--primary);
}

.onboarding-icon.green { background: var(--success-bg); }
.onboarding-icon.green svg { color: var(--success); }
.onboarding-icon.orange { background: var(--warning-bg); }
.onboarding-icon.orange svg { color: var(--warning); }
.onboarding-icon.red { background: var(--danger-bg); }
.onboarding-icon.red svg { color: var(--danger); }

.onboarding-title {
  font-size: var(--font-2xl);
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.onboarding-desc {
  font-size: var(--font-base);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 300px;
  margin-bottom: 32px;
}

.onboarding-footer {
  padding: 16px 24px 32px;
}

.onboarding-footer .btn {
  width: 100%;
}

/* --- Login Page --- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
  padding: 0 24px;
}

.login-header {
  padding-top: 60px;
  text-align: center;
  margin-bottom: 40px;
}

.login-logo {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: var(--shadow-primary);
}

.login-logo svg {
  width: 40px;
  height: 40px;
  color: white;
}

.login-app-name {
  font-size: var(--font-3xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: var(--font-sm);
  color: var(--text-hint);
}

.login-form {
  margin-bottom: 24px;
}

.login-tabs {
  display: flex;
  margin-bottom: 24px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.login-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: var(--transition);
  cursor: pointer;
}

.login-tab.active {
  background: var(--bg-white);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.login-footer {
  text-align: center;
  padding: 16px 0;
}

.login-footer a {
  font-size: var(--font-xs);
  color: var(--text-hint);
}

/* --- Main Page (Home) --- */
.main-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: var(--font-xs);
  color: var(--text-hint);
  background: var(--bg-white);
}

.main-hero {
  margin: 16px;
  padding: 24px;
  background: linear-gradient(135deg, var(--primary), #6BA3E0);
  border-radius: var(--radius-lg);
  color: var(--text-white);
  position: relative;
  overflow: hidden;
}

.main-hero::after {
  content: '';
  position: absolute;
  width: 150px;
  height: 150px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  top: -40px;
  right: -30px;
}

.main-hero .hero-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-sm);
  margin-bottom: 12px;
  opacity: 0.9;
}

.main-hero .hero-status .pulse-dot {
  width: 8px;
  height: 8px;
  background: #52C41A;
  border-radius: var(--radius-full);
  animation: pulse 2s infinite;
}

.main-hero .hero-location {
  font-size: var(--font-lg);
  font-weight: 600;
  margin-bottom: 4px;
}

.main-hero .hero-detail {
  font-size: var(--font-sm);
  opacity: 0.85;
}

.main-action-btn {
  margin: 20px 16px;
  display: flex;
  justify-content: center;
}

.main-action-btn .action-circle {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  box-shadow: var(--shadow-primary);
  cursor: pointer;
  transition: var(--transition);
  animation: breathe 3s infinite;
  position: relative;
}

.main-action-btn .action-circle:active {
  transform: scale(0.92);
}

.main-action-btn .action-circle svg {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
}

.main-action-btn .action-circle span {
  font-size: var(--font-xs);
  font-weight: 500;
}

.main-quick-actions {
  padding: 0 16px;
  margin-bottom: 16px;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.quick-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.quick-action-item .qa-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-action-item .qa-icon svg {
  width: 20px;
  height: 20px;
}

.quick-action-item .qa-label {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  font-weight: 500;
}

/* --- Obstacle Page --- */
.camera-preview {
  margin: 12px 16px;
  height: 200px;
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-preview .camera-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  display: none;
  z-index: 1;
}

.camera-preview .camera-video.active {
  display: block;
}

.camera-preview .camera-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--font-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 2;
}

.camera-preview .camera-label svg {
  width: 32px;
  height: 32px;
}

.camera-preview .detection-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.camera-preview .detection-box {
  position: absolute;
  border: 2px solid var(--success);
  border-radius: 4px;
  animation: fadeIn 0.5s ease;
}

.camera-preview .detection-label {
  position: absolute;
  background: var(--success);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 2px;
  top: -16px;
  left: -2px;
  white-space: nowrap;
}

.obstacle-list {
  margin: 0 16px 12px;
}

.obstacle-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}

.obstacle-item .obs-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.obstacle-item .obs-info {
  flex: 1;
}

.obstacle-item .obs-name {
  font-size: var(--font-base);
  font-weight: 500;
}

.obstacle-item .obs-distance {
  font-size: var(--font-xs);
  color: var(--text-hint);
  margin-top: 2px;
}

.obstacle-item .obs-level {
  font-size: var(--font-xs);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

/* --- Traffic Light Card --- */
.traffic-light-card {
  margin: 0 16px 12px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
}

.traffic-lights {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: #333;
  border-radius: 6px;
}

.traffic-light {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: #555;
  transition: var(--transition);
}

.traffic-light.red-on { background: #FF4444; box-shadow: 0 0 8px rgba(255, 68, 68, 0.6); }
.traffic-light.yellow-on { background: #FFBB33; box-shadow: 0 0 8px rgba(255, 187, 51, 0.6); }
.traffic-light.green-on { background: #00C851; box-shadow: 0 0 8px rgba(0, 200, 81, 0.6); }

.traffic-info .traffic-status {
  font-size: var(--font-md);
  font-weight: 600;
  margin-bottom: 4px;
}

.traffic-info .traffic-countdown {
  font-size: var(--font-sm);
  color: var(--text-secondary);
}

/* --- Navigation Page --- */
.search-box {
  margin: 12px 16px;
  position: relative;
}

.search-box .form-input {
  padding-left: 40px;
  padding-right: 44px;
  height: 44px;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-hint);
}

.search-box .voice-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.route-overview {
  margin: 0 16px 12px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.route-overview .route-endpoints {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.route-overview .endpoint {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.route-overview .endpoint-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.route-overview .endpoint-dot.start { background: var(--primary); }
.route-overview .endpoint-dot.end { background: var(--danger); }

.route-overview .route-line {
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-hint);
}

.route-stats {
  display: flex;
  justify-content: space-around;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
}

.route-stat {
  text-align: center;
}

.route-stat .stat-value {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--primary);
}

.route-stat .stat-label {
  font-size: var(--font-xs);
  color: var(--text-hint);
  margin-top: 2px;
}

/* --- Turn Instruction --- */
.turn-instruction {
  margin: 0 16px 12px;
  padding: 14px 16px;
  background: var(--primary);
  color: var(--text-white);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-primary);
}

.turn-instruction svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.turn-instruction .turn-text {
  font-size: var(--font-base);
  font-weight: 500;
}

.turn-instruction .turn-distance {
  font-size: var(--font-xs);
  opacity: 0.85;
  margin-top: 2px;
}

/* --- SOS Page --- */
.sos-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 16px;
}

.sos-button {
  width: 160px;
  height: 160px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--danger), #FF4444);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  box-shadow: 0 8px 32px rgba(255, 107, 107, 0.4);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  margin-bottom: 16px;
}

.sos-button::before {
  content: '';
  position: absolute;
  inset: -8px;
  border: 2px solid rgba(255, 107, 107, 0.3);
  border-radius: var(--radius-full);
  animation: ripple 2s infinite;
}

.sos-button:active {
  transform: scale(0.92);
}

.sos-button svg {
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
}

.sos-button .sos-text {
  font-size: var(--font-2xl);
  font-weight: 700;
  letter-spacing: 4px;
}

.sos-button .sos-hint {
  font-size: var(--font-xs);
  opacity: 0.8;
  margin-top: 4px;
}

.sos-info {
  text-align: center;
  color: var(--text-hint);
  font-size: var(--font-sm);
  margin-bottom: 24px;
}

/* --- Route Card --- */
.route-card {
  margin: 0 16px 12px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}

.route-card:active {
  transform: scale(0.98);
}

.route-card .route-name {
  font-size: var(--font-md);
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.route-card .route-path {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.route-card .route-path .path-arrow {
  color: var(--text-hint);
}

.route-card .route-meta {
  display: flex;
  gap: 16px;
  font-size: var(--font-xs);
  color: var(--text-hint);
}

/* --- Object Recognition --- */
.recognition-result {
  margin: 0 16px 12px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
}

.recognition-result .result-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.recognition-result .result-info {
  flex: 1;
}

.recognition-result .result-name {
  font-size: var(--font-md);
  font-weight: 600;
}

.recognition-result .result-detail {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-top: 4px;
}

/* --- Profile Page --- */
.profile-header {
  padding: 24px 16px;
  background: var(--bg-white);
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  font-size: var(--font-2xl);
  font-weight: 700;
  flex-shrink: 0;
}

.profile-info .profile-name {
  font-size: var(--font-lg);
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-info .profile-id {
  font-size: var(--font-xs);
  color: var(--text-hint);
}

.profile-menu-group {
  margin: 0 16px 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.profile-menu-item + .profile-menu-item {
  border-top: 1px solid var(--divider);
}

.profile-menu-item .menu-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-menu-item .menu-icon svg {
  width: 18px;
  height: 18px;
}

.profile-menu-item .menu-label {
  flex: 1;
  font-size: var(--font-base);
  font-weight: 500;
}

.profile-menu-item .menu-arrow {
  color: var(--text-hint);
}

/* --- Color Recognition Display --- */
.color-display {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
}

/* --- Fall Detection Banner --- */
.fall-detection-banner {
  margin: 0 16px 12px;
  padding: 12px 16px;
  background: var(--success-bg);
  border: 1px solid rgba(82, 196, 26, 0.2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 10px;
}

.fall-detection-banner.inactive {
  background: var(--bg);
  border-color: var(--border);
}

.fall-detection-banner .fdb-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--success);
  flex-shrink: 0;
}

.fall-detection-banner.inactive .fdb-dot {
  background: var(--text-hint);
}

.fall-detection-banner .fdb-text {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  flex: 1;
}

/* --- Contact Card --- */
.contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}

.contact-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 600;
  font-size: var(--font-base);
  flex-shrink: 0;
}

.contact-info {
  flex: 1;
}

.contact-name {
  font-size: var(--font-base);
  font-weight: 500;
}

.contact-phone {
  font-size: var(--font-xs);
  color: var(--text-hint);
  margin-top: 2px;
}

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

.contact-actions button {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-hint);
  background: var(--bg);
  transition: var(--transition-fast);
}

.contact-actions button:active {
  background: var(--border);
}

/* --- Voice Input Animation --- */
.voice-animation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 32px;
}

.voice-bar {
  width: 3px;
  background: var(--primary);
  border-radius: 2px;
  animation: voiceBar 1s ease-in-out infinite;
}

.voice-bar:nth-child(1) { height: 12px; animation-delay: 0s; }
.voice-bar:nth-child(2) { height: 20px; animation-delay: 0.1s; }
.voice-bar:nth-child(3) { height: 28px; animation-delay: 0.2s; }
.voice-bar:nth-child(4) { height: 20px; animation-delay: 0.3s; }
.voice-bar:nth-child(5) { height: 12px; animation-delay: 0.4s; }

@keyframes voiceBar {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1); }
}

/* --- Preference Chips --- */
.preference-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px;
  margin-bottom: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  font-size: var(--font-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.chip.active {
  background: var(--primary-bg);
  border-color: var(--primary);
  color: var(--primary);
}

.chip svg {
  width: 14px;
  height: 14px;
}

/* --- Scroll Container --- */
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.scroll-x::-webkit-scrollbar {
  display: none;
}

/* --- Sub Page --- */
.sub-page {
  display: none;
  position: fixed;
  inset: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: var(--max-width);
  width: 100%;
  background: var(--bg);
  z-index: 3000;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.sub-page.active {
  display: block;
}

/* --- Text Reader Card --- */
.text-reader-card {
  margin: 0 16px 12px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.text-reader-card .reader-text {
  font-size: var(--font-base);
  line-height: 1.8;
  color: var(--text-primary);
  min-height: 60px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

/* --- Responsive --- */
@media (max-width: 430px) {
  #app {
    max-width: 100%;
  }

  .bottom-nav {
    max-width: 100%;
  }

  .toast-container {
    max-width: 100%;
  }

  .bottom-sheet {
    max-width: 100%;
  }
}

@media (min-width: 768px) {
  body {
    padding: 20px 0;
    align-items: flex-start;
  }

  #app {
    border-radius: var(--radius-lg);
    min-height: 90vh;
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* --- Utilities --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 600; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.px-16 { padding-left: 16px; padding-right: 16px; }
.py-12 { padding-top: 12px; padding-bottom: 12px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* --- Search Suggestions --- */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 4px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: var(--shadow);
  z-index: 1000;
}

.suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: var(--primary-bg);
}

.suggestion-item svg {
  color: var(--text-hint);
  flex-shrink: 0;
}

.suggestion-content {
  flex: 1;
}

.suggestion-name {
  font-size: var(--font-base);
  color: var(--text-primary);
  font-weight: 500;
}

.suggestion-address {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}
.flex-1 { flex: 1; }
.hidden { display: none !important; }
