/* 酒店民宿展示系统 - 移动端优先样式 */

/* 移动端优先设计变量 */
:root {
  --primary-color: #1a2161;
  --primary-light: #e3f2ed;
  --secondary-color: #f8b400;
  --text-color: #333333;
  --text-light: #666666;
  --text-lighter: #999999;
  --background: #f5f5f5;
  --card-bg: #ffffff;
  --border-color: #e0e0e0;
  --border-light: #f0f0f0;
  
  /* 移动端优化的阴影 */
  --shadow-xs: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  
  /* 移动端友好的圆角 */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  /* 快速动画 */
  --transition-fast: all 0.2s ease;
  --transition-base: all 0.3s ease;
  
  /* 移动端字体大小 */
  --font-xs: 0.7rem;
  --font-sm: 0.8rem;
  --font-base: 0.9rem;
  --font-lg: 1rem;
  --font-xl: 1.1rem;
  --font-2xl: 1.3rem;
  --font-3xl: 1.5rem;
  
  /* 间距系统 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
}

/* 移动端优先基础重置 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

*:focus {
  outline: none;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--background);
  color: var(--text-color);
  line-height: 1.4;
  font-size: 14px;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* 移动端安全区域适配 */
@supports (padding: env(safe-area-inset-top)) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* 链接样式 - 去除下划线 */
a {
  text-decoration: none;
  color: inherit;
}

a:hover {
  text-decoration: none;
}

a:visited {
  text-decoration: none;
}

a:active {
  text-decoration: none;
}

/* 通用工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }

/* 按钮基础样式 */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-base);
  text-align: center;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: #2d4aa7;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background: #e6a200;
  transform: translateY(-2px);
}

/* 卡片样式 */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: var(--transition-base);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  padding: 20px 25px;
  border-bottom: 1px solid #e9ecef;
}

.card-body {
  padding: 25px;
}

.card-footer {
  padding: 15px 25px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

/* 徽章样式 */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 500;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary-color);
}

.badge-secondary {
  background: #fff3cd;
  color: #856404;
}

.badge-success {
  background: #d1ecf1;
  color: #0c5460;
}

/* 评分星星 */
.rating-stars {
  color: var(--secondary-color);
  font-size: 1.2rem;
  letter-spacing: 2px;
}

.rating-stars.large {
  font-size: 1.8rem;
}

/* 价格显示 */
.price {
  font-weight: bold;
  color: #e74c3c;
}

.price.large {
  font-size: 2rem;
}

.price.extra-large {
  font-size: 3rem;
}

/* 特色标签 */
.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 15px 0;
}

.feature-tag {
  background: #f8f9fa;
  color: var(--text-color);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  border: 1px solid #e9ecef;
  transition: var(--transition-base);
}

.feature-tag:hover {
  background: var(--primary-light);
  border-color: var(--primary-color);
}

/* 网格布局 */
.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* 图片样式 */
.img-responsive {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.img-cover {
  object-fit: cover;
}

.img-hover {
  transition: transform 0.4s ease;
}

.img-hover:hover {
  transform: scale(1.05);
}

/* 阴影效果 */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* 圆角 */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: 50%; }

/* 动画类 */
.fade-in {
  animation: fadeIn 0.6s ease-in-out;
}

.slide-up {
  animation: slideUp 0.6s ease-out;
}

.bounce-in {
  animation: bounceIn 0.8s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .container {
    max-width: 100%;
    padding: 0 30px;
  }
}

@media (max-width: 992px) {
  .grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
  
  .grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
  
  h1 {
    font-size: 2rem !important;
  }
  
  h2 {
    font-size: 1.5rem !important;
  }
  
  h3 {
    font-size: 1.2rem !important;
  }
  
  .price.large {
    font-size: 1.5rem;
  }
  
  .price.extra-large {
    font-size: 2rem;
  }
}

@media (max-width: 576px) {
  .container {
    padding: 0 15px;
  }
  
  .card-body {
    padding: 15px;
  }
  
  .feature-tags {
    gap: 5px;
  }
  
  .feature-tag {
    padding: 4px 8px;
    font-size: 0.75rem;
  }
}

/* 可访问性 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 打印样式 */
@media print {
  .btn,
  .search-bar,
  .filter-tabs {
    display: none !important;
  }
  
  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
  
  .price {
    color: #000 !important;
  }
}

/* 焦点样式 */
button:focus,
input:focus,
a:focus {
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
}

/* 选择文本样式 */
::selection {
  background: var(--secondary-color);
  color: white;
}

::-moz-selection {
  background: var(--secondary-color);
  color: white;
}

/* 工具提示 */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 120px;
  background-color: var(--text-color);
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;
  position: absolute;
  z-index: 1;
  bottom: 150%;
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* 图标样式 */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 0.5em;
  vertical-align: middle;
}

.icon.large {
  width: 1.5em;
  height: 1.5em;
}

/* 状态指示 */
.status {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.status.available {
  background: #28a745;
}

.status.busy {
  background: #ffc107;
}

.status.unavailable {
  background: #dc3545;
} 