/* ===== 一带一路贸易查询系统 - 公共样式 ===== */

:root {
  /* 主色调 */
  --primary: #1E3A8A;
  --primary-light: #3B82F6;
  --primary-dark: #1E40AF;
  
  /* 一带一路特色金色 */
  --secondary: #F59E0B;
  --secondary-light: #FCD34D;
  
  /* 功能色 */
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --info: #06B6D4;
  
  /* 背景色 */
  --background: #F8FAFC;
  --card: #FFFFFF;
  --surface: #F1F5F9;
  
  /* 文字色 */
  --text-primary: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  
  /* 边框 */
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  
  /* iPhone 15 Pro 尺寸 */
  --phone-width: 393px;
  --phone-height: 852px;
  --status-bar-height: 59px;
  --tab-bar-height: 83px;
  --safe-area-bottom: 34px;
  --phone-radius: 47px;
  
  /* 间距 */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Helvetica Neue', sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===== iOS 状态栏 ===== */
.status-bar {
  height: var(--status-bar-height);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 var(--spacing-lg) var(--spacing-sm);
  color: white;
  font-size: 14px;
  font-weight: 600;
}

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

.status-bar-icons {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.status-bar-icons i {
  font-size: 14px;
}

/* ===== 底部 Tab Bar ===== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--tab-bar-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-top: var(--spacing-sm);
  padding-bottom: var(--safe-area-bottom);
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  transition: all 0.2s ease;
}

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

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

.tab-item:hover {
  color: var(--primary-light);
}

/* ===== 导航栏 ===== */
.nav-bar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: var(--spacing-md) var(--spacing-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
}

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

.nav-back {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: white;
  text-decoration: none;
  font-size: 15px;
}

/* ===== 卡片组件 ===== */
.card {
  background: var(--card);
  border-radius: 16px;
  padding: var(--spacing-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-bottom: var(--spacing-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

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

/* ===== 统计数据卡片 ===== */
.stat-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 16px;
  padding: var(--spacing-md);
  color: white;
}

.stat-card.gold {
  background: linear-gradient(135deg, var(--secondary) 0%, #D97706 100%);
}

.stat-card.green {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  font-family: 'DIN Alternate', -apple-system, sans-serif;
}

.stat-label {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 4px;
}

.stat-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  margin-top: 8px;
}

.stat-trend.up {
  color: #86EFAC;
}

.stat-trend.down {
  color: #FCA5A5;
}

/* ===== 搜索框 ===== */
.search-box {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: var(--spacing-sm) var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  color: white;
  font-size: 15px;
  outline: none;
}

.search-box input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.search-box i {
  color: rgba(255, 255, 255, 0.8);
}

/* 白色背景搜索框 */
.search-box-light {
  background: var(--surface);
  border-radius: 12px;
  padding: var(--spacing-sm) var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

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

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

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

/* ===== 列表项 ===== */
.list-item {
  display: flex;
  align-items: center;
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--border-light);
  gap: var(--spacing-md);
}

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

.list-item-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  font-size: 20px;
}

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

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

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

.list-item-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.tag-primary {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-light);
}

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

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

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

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

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
}

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

/* ===== 国家国旗 ===== */
.country-flag {
  width: 40px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.country-flag-lg {
  width: 60px;
  height: 42px;
  border-radius: 6px;
}

/* ===== 内容容器 ===== */
.content {
  padding: var(--spacing-md);
  padding-bottom: calc(var(--tab-bar-height) + var(--spacing-md));
  min-height: calc(100vh - var(--status-bar-height));
  background: var(--background);
}

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-sm);
}

/* ===== 分段控制器 ===== */
.segment-control {
  display: flex;
  background: var(--surface);
  border-radius: 10px;
  padding: 4px;
}

.segment-item {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.segment-item.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ===== 进度条 ===== */
.progress-bar {
  height: 8px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  transition: width 0.3s ease;
}

/* ===== 切换开关 ===== */
.toggle {
  width: 51px;
  height: 31px;
  background: var(--text-muted);
  border-radius: 16px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}

.toggle.active {
  background: var(--success);
}

.toggle::after {
  content: '';
  position: absolute;
  width: 27px;
  height: 27px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.toggle.active::after {
  transform: translateX(20px);
}

/* ===== 动画 ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

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

.pulse {
  animation: pulse 2s ease infinite;
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: var(--spacing-md);
}

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

/* ===== 滚动样式 ===== */
::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* ===== 地图容器 ===== */
.map-container {
  position: relative;
  width: 100%;
  height: 280px;
  background: linear-gradient(180deg, #E0F2FE 0%, #DBEAFE 100%);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: var(--spacing-md);
}

.map-container svg {
  width: 100%;
  height: 100%;
}

/* 地图国家样式 */
.map-country {
  fill: #94A3B8;
  stroke: white;
  stroke-width: 0.5;
  cursor: pointer;
  transition: all 0.2s ease;
}

.map-country:hover {
  fill: var(--primary-light);
}

.map-country.belt-road {
  fill: var(--secondary);
}

.map-country.belt-road:hover {
  fill: #D97706;
}

/* ===== 热门国家卡片 ===== */
.country-card {
  background: white;
  border-radius: 14px;
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all 0.2s ease;
}

.country-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.country-card-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
}

.country-card-value {
  font-size: 11px;
  color: var(--text-secondary);
}
