/*!
 * Font Awesome 4.7.0 with Optimized Font Display - font-display: swap
 * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
 * Optimized for better font loading performance
 */

/* Optimized @font-face with font-display: swap for better performance */
@font-face {
  font-family: 'FontAwesome';
  src: url('https://static.pandatrips.com/icons/font-awesome/fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),
       url('https://static.pandatrips.com/icons/font-awesome/fonts/fontawesome-webfont.woff?v=4.7.0') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap; /* 关键优化：确保文本始终可见 */
}

/* Fallback for older browsers without woff2 support */
@font-face {
  font-family: 'FontAwesome-Fallback';
  src: url('https://static.pandatrips.com/icons/font-awesome/fonts/fontawesome-webfont.eot?v=4.7.0'),
       url('https://static.pandatrips.com/icons/font-awesome/fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Base FontAwesome class with fallback strategy */
.fa {
  display: inline-block;
  font: normal normal normal 14px/1 FontAwesome, FontAwesome-Fallback, sans-serif;
  font-size: inherit;
  text-rendering: optimizeSpeed; /* 优化渲染性能 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Prevent invisible text during font swap period */
.fa:before {
  font-family: FontAwesome, FontAwesome-Fallback, "Arial Unicode MS", sans-serif;
}

/* Size variants */
.fa-lg { font-size: 1.33333333em; line-height: 0.75em; vertical-align: -15%; }
.fa-2x { font-size: 2em; }
.fa-3x { font-size: 3em; }
.fa-4x { font-size: 4em; }
.fa-5x { font-size: 5em; }

/* Fixed width for better alignment */
.fa-fw { width: 1.28571429em; text-align: center; }

/* Rotation and animation */
.fa-spin {
  -webkit-animation: fa-spin 2s infinite linear;
  animation: fa-spin 2s infinite linear;
}

@keyframes fa-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(359deg); }
}

/* Commonly used icons - only include what's actually used on the site */
.fa-home:before { content: "\f015"; }
.fa-search:before { content: "\f002"; }
.fa-user:before { content: "\f007"; }
.fa-envelope:before { content: "\f0e0"; }
.fa-phone:before { content: "\f095"; }
.fa-globe:before { content: "\f0ac"; }
.fa-calendar:before { content: "\f073"; }
.fa-clock-o:before { content: "\f017"; }
.fa-map-marker:before { content: "\f041"; }
.fa-star:before { content: "\f005"; }
.fa-star-o:before { content: "\f006"; }
.fa-heart:before { content: "\f004"; }
.fa-heart-o:before { content: "\f08a"; }
.fa-thumbs-up:before { content: "\f164"; }
.fa-thumbs-down:before { content: "\f165"; }
.fa-share:before { content: "\f064"; }
.fa-facebook:before { content: "\f09a"; }
.fa-twitter:before { content: "\f099"; }
.fa-google-plus:before { content: "\f0d5"; }
.fa-linkedin:before { content: "\f0e1"; }
.fa-instagram:before { content: "\f16d"; }
.fa-youtube:before { content: "\f167"; }
.fa-wechat:before { content: "\f1d7"; }
.fa-weibo:before { content: "\f18a"; }
.fa-train:before { content: "\f238"; }
.fa-plane:before { content: "\f072"; }
.fa-car:before { content: "\f1b9"; }
.fa-bus:before { content: "\f207"; }
.fa-subway:before { content: "\f239"; }
.fa-hotel:before { content: "\f236"; }
.fa-camera:before { content: "\f030"; }
.fa-shopping-cart:before { content: "\f07a"; }
.fa-credit-card:before { content: "\f09d"; }
.fa-money:before { content: "\f0d6"; }
.fa-lock:before { content: "\f023"; }
.fa-unlock:before { content: "\f09c"; }
.fa-key:before { content: "\f084"; }
.fa-check:before { content: "\f00c"; }
.fa-times:before { content: "\f00d"; }
.fa-plus:before { content: "\f067"; }
.fa-minus:before { content: "\f068"; }
.fa-arrow-left:before { content: "\f060"; }
.fa-arrow-right:before { content: "\f061"; }
.fa-arrow-up:before { content: "\f062"; }
.fa-arrow-down:before { content: "\f063"; }
.fa-chevron-left:before { content: "\f053"; }
.fa-chevron-right:before { content: "\f054"; }
.fa-chevron-up:before { content: "\f077"; }
.fa-chevron-down:before { content: "\f078"; }
.fa-caret-down:before { content: "\f0d7"; }
.fa-caret-up:before { content: "\f0d8"; }
.fa-menu:before, .fa-bars:before { content: "\f0c9"; }
.fa-close:before { content: "\f00d"; }
.fa-eye:before { content: "\f06e"; }
.fa-eye-slash:before { content: "\f070"; }
.fa-warning:before { content: "\f071"; }
.fa-info:before { content: "\f129"; }
.fa-question:before { content: "\f128"; }
.fa-exclamation:before { content: "\f12a"; }
.fa-download:before { content: "\f019"; }
.fa-upload:before { content: "\f093"; }
.fa-file:before { content: "\f15b"; }
.fa-folder:before { content: "\f07b"; }
.fa-edit:before { content: "\f044"; }
.fa-trash:before { content: "\f1f8"; }
.fa-refresh:before { content: "\f021"; }
.fa-print:before { content: "\f02f"; }

/* Performance optimizations */
.fa {
  will-change: auto; /* 避免不必要的图层创建 */
}

/* Loading fallback - 在字体加载期间显示替代文本 */
.font-loading .fa:before {
  font-family: Arial, sans-serif;
  content: "•"; /* 简单的点作为加载指示 */
}

/* Accessibility improvements */
.fa[aria-hidden="true"] {
  speak: none;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .fa {
    text-rendering: optimizeSpeed;
  }
}