/* ============================================
   1688风格现代化APP UI - 蓝色调
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #FF6A00;
  --primary-light: #FF8A3D;
  --primary-dark: #E55F00;
  --blue-primary: #1890FF;
  --blue-light: #40A9FF;
  --blue-dark: #096DD9;
  --bg-color: #F5F5F5;
  --card-bg: #FFFFFF;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-color: #E8E8E8;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom);
}

/* 顶部搜索栏 */
.app-header {
  background: linear-gradient(135deg, #1890FF 0%, #096DD9 100%);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(24,144,255,0.3);
}

.search-bar {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.95);
  border-radius: 20px;
  padding: 8px 16px;
  gap: 8px;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  color: var(--text-primary);
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  color: var(--blue-primary);
  font-size: 18px;
}

/* 轮播图 */
.banner {
  margin: 12px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.banner img {
  width: 100%;
  display: block;
}

/* 图标导航 */
.icon-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 16px 12px;
  background: var(--card-bg);
  margin: 0 12px 12px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.icon-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
}

.icon-nav-item img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.icon-nav-item span {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 卡片列表 */
.card-list {
  padding: 0 12px 12px;
}

.card-item {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.card-item:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-md);
}

.card-image {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
}

.card-content {
  padding: 12px;
}

.card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-price {
  color: var(--primary);
  font-size: 18px;
  font-weight: 600;
}

.card-price::before {
  content: '¥';
  font-size: 12px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  margin-right: 4px;
}

.tag-primary {
  background: rgba(24,144,255,0.1);
  color: var(--blue-primary);
}

.tag-orange {
  background: rgba(255,106,0,0.1);
  color: var(--primary);
}

.tag-green {
  background: rgba(82,196,26,0.1);
  color: #52C41A;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue-primary) 0%, var(--blue-dark) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(24,144,255,0.3);
}

.btn-primary:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(24,144,255,0.4);
}

.btn-orange {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(255,106,0,0.3);
}

.btn-outline {
  background: white;
  color: var(--blue-primary);
  border: 1px solid var(--blue-primary);
}

.btn-block {
  width: 100%;
}

/* 输入框 */
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all 0.3s ease;
  background: white;
}

.form-input:focus {
  outline: none;
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 3px rgba(24,144,255,0.1);
}

/* 表单组 */
.form-group {
  margin-bottom: 16px;
}

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

/* 底部导航栏 */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  padding-bottom: calc(8px + constant(safe-area-inset-bottom));
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  z-index: 100;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.3s ease;
}

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

.tab-item img, .tab-item i {
  width: 24px;
  height: 24px;
  font-size: 24px;
}

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

/* 内容区域 */
.content {
  padding-bottom: calc(60px + constant(safe-area-inset-bottom));
  padding-bottom: calc(60px + env(safe-area-inset-bottom));
}

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

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

/* 加载动画 */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--blue-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

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

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

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

/* 模态框 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 90%;
  width: 400px;
  transform: scale(0.9);
  transition: all 0.3s ease;
}

.modal.show .modal-content {
  transform: scale(1);
}

/* 提示消息 */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

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

/* 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  border-radius: 9px;
  position: absolute;
  top: -4px;
  right: -4px;
}

/* 响应式 */
@media (max-width: 375px) {
  .icon-nav {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 滚动优化 */
::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* 下拉刷新提示 */
.pull-refresh {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 13px;
}

/* 上拉加载提示 */
.load-more {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 13px;
}
