/* 公共样式 - 光明低空智谷·无人机乐园小程序原型 */

/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #f5f5f5;
  color: #1A2744;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 优雅滚动条样式 */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(26, 39, 68, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(26, 39, 68, 0.3);
}

/* Firefox 滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(26, 39, 68, 0.15) transparent;
}

/* 移动端隐藏滚动条但保持滚动功能 */
@media (max-width: 768px) {
  ::-webkit-scrollbar {
    display: none;
  }
  * {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
}

/* 颜色变量 */
:root {
  --primary-dark: #1A2744;
  --primary-orange: #F59E0B;
  --primary-blue: #2563EB;
  --success-green: #10B981;
  --purple: #7C3AED;
  --coral-orange: #EA580C;
  --bg-gray: #f5f5f5;
  --border-gray: #e5e7eb;
  --text-gray: #6b7280;
  --text-light: #9ca3af;
}

/* 页面容器 */
.page-container {
  min-height: 100vh;
  background: var(--bg-gray);
  padding-bottom: 70px;
}

/* iOS状态栏 */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px 8px;
  background: linear-gradient(135deg, #1A2744 0%, #2d3a5c 100%);
  color: white;
  font-size: 14px;
  font-weight: 600;
}

.status-bar .time {
  font-weight: 600;
}

.status-bar .icons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-bar .signal {
  display: flex;
  gap: 1px;
}

.status-bar .signal span {
  width: 3px;
  background: white;
  border-radius: 1px;
}

.status-bar .signal span:nth-child(1) { height: 4px; }
.status-bar .signal span:nth-child(2) { height: 6px; }
.status-bar .signal span:nth-child(3) { height: 8px; }
.status-bar .signal span:nth-child(4) { height: 10px; }

.status-bar .battery {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
}

.status-bar .battery-icon {
  width: 22px;
  height: 10px;
  border: 1.5px solid white;
  border-radius: 2px;
  position: relative;
}

.status-bar .battery-icon::after {
  content: '';
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 5px;
  background: white;
  border-radius: 0 1px 1px 0;
}

.status-bar .battery-level {
  position: absolute;
  left: 1px;
  top: 1px;
  bottom: 1px;
  width: 80%;
  background: #10B981;
  border-radius: 1px;
}

/* 导航栏 */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #1A2744 0%, #2d3a5c 100%);
  color: white;
}

.nav-bar .nav-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-bar .back-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
}

.nav-bar .back-btn:hover {
  background: rgba(255,255,255,0.1);
}

.nav-bar .title {
  font-size: 17px;
  font-weight: 600;
}

.nav-bar .nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-bar .nav-right i {
  font-size: 18px;
  cursor: pointer;
}

/* 底部Tab Bar */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  display: flex;
  justify-content: space-around;
  padding: 8px 0 20px;
  border-top: 1px solid var(--border-gray);
  z-index: 100;
}

.tab-bar .tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text-gray);
}

.tab-bar .tab-item i {
  font-size: 22px;
}

.tab-bar .tab-item span {
  font-size: 10px;
}

.tab-bar .tab-item.active {
  color: var(--primary-blue);
}

.tab-bar .tab-item.active i {
  color: var(--primary-blue);
}

/* 卡片样式 */
.card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

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

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-dark);
}

.card-more {
  font-size: 12px;
  color: var(--text-gray);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

/* 按钮样式 */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-blue) 0%, #3b82f6 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: white;
  color: var(--primary-blue);
  border: 1.5px solid var(--primary-blue);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-orange {
  background: linear-gradient(135deg, var(--primary-orange) 0%, #fbbf24 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-block {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 标签样式 */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.tag-orange {
  background: rgba(245, 158, 11, 0.1);
  color: var(--primary-orange);
}

.tag-blue {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-blue);
}

.tag-green {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-green);
}

.tag-purple {
  background: rgba(124, 58, 237, 0.1);
  color: var(--purple);
}

/* 头像样式 */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-lg {
  width: 64px;
  height: 64px;
}

.avatar-sm {
  width: 32px;
  height: 32px;
}

/* 搜索框 */
.search-box {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 20px;
  padding: 10px 16px;
  gap: 8px;
  margin: 12px;
}

.search-box i {
  color: var(--text-light);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
}

/* 列表项 */
.list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: white;
  border-bottom: 1px solid var(--border-gray);
  cursor: pointer;
  transition: background 0.2s;
}

.list-item:hover {
  background: #f9fafb;
}

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

.list-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 18px;
}

.list-item-content {
  flex: 1;
}

.list-item-title {
  font-size: 15px;
  color: var(--primary-dark);
  margin-bottom: 2px;
}

.list-item-desc {
  font-size: 12px;
  color: var(--text-gray);
}

.list-item-arrow {
  color: var(--text-light);
  font-size: 14px;
}

/* 进度条 */
.progress-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar .progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-blue), var(--primary-orange));
  border-radius: 3px;
  transition: width 0.3s;
}

/* 徽章 */
.badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

/* 分割线 */
.divider {
  height: 1px;
  background: var(--border-gray);
  margin: 12px 0;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-gray);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 14px;
}

/* 加载动画 */
.loading {
  display: flex;
  justify-content: center;
  padding: 20px;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-gray);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 渐变背景 */
.gradient-blue {
  background: linear-gradient(135deg, var(--primary-blue) 0%, #3b82f6 100%);
}

.gradient-orange {
  background: linear-gradient(135deg, var(--primary-orange) 0%, #fbbf24 100%);
}

.gradient-dark {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #2d3a5c 100%);
}

.gradient-purple {
  background: linear-gradient(135deg, var(--purple) 0%, #8b5cf6 100%);
}

/* 文字样式 */
.text-primary { color: var(--primary-blue); }
.text-orange { color: var(--primary-orange); }
.text-green { color: var(--success-green); }
.text-purple { color: var(--purple); }
.text-gray { color: var(--text-gray); }
.text-light { color: var(--text-light); }

.text-sm { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 20px; }
.text-3xl { font-size: 24px; }

.font-bold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* 价格样式 */
.price {
  color: #ef4444;
  font-weight: 600;
}

.price .currency {
  font-size: 12px;
}

.price .amount {
  font-size: 18px;
}

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 弹窗遮罩 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

/* Swiper轮播样式 */
.swiper {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.swiper-wrapper {
  display: flex;
  transition: transform 0.3s ease;
}

.swiper-slide {
  flex-shrink: 0;
  width: 100%;
}

.swiper-pagination {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.swiper-pagination-bullet {
  width: 6px;
  height: 6px;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
}

.swiper-pagination-bullet-active {
  background: white;
  width: 16px;
  border-radius: 3px;
}

/* 网格布局 */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

/* 弹性布局 */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.flex-1 { flex: 1; }

/* 间距 */
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.m-3 { margin: 12px; }
.m-4 { margin: 16px; }
.m-5 { margin: 20px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.ml-1 { margin-left: 4px; }
.ml-2 { margin-left: 8px; }
.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 8px; }

/* 圆角 */
.rounded { border-radius: 4px; }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 16px; }
.rounded-full { border-radius: 9999px; }

/* 阴影 */
.shadow { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.shadow-lg { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }

/* 文字省略 */
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ellipsis-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}