/* 云卡栈统一公共样式 v2.0 */
:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #3b82f6;
  --primary-gradient: linear-gradient(135deg, #1e40af, #3b82f6);
  --orange: #f97316;
  --orange-dark: #ea580c;
  --green: #10b981;
  --red: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --bg: #f0f2f5;
  --card-shadow: 0 2px 12px rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-lg: 16px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--gray-900);
  line-height: 1.5;
}

/* 通用页面头部 */
.page-header {
  background: var(--primary-gradient);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.page-header .back {
  font-size: 22px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-header .title {
  font-size: 17px;
  font-weight: 600;
  flex: 1;
  text-align: center;
}
.page-header .action {
  font-size: 14px;
  cursor: pointer;
  min-width: 32px;
  text-align: right;
}

/* 通用卡片 */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--card-shadow);
  margin-bottom: 12px;
}

/* 通用按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary-gradient); color: #fff; }
.btn-orange { background: linear-gradient(135deg, #f97316, #ea580c); color: #fff; }
.btn-green { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.btn-red { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 8px; }

/* 通用表单 */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 14px;
  color: var(--gray-700);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.tag-blue { background: #dbeafe; color: #1e40af; }
.tag-green { background: #dcfce7; color: #15803d; }
.tag-orange { background: #ffedd5; color: #c2410c; }
.tag-red { background: #fee2e2; color: #b91c1c; }
.tag-gray { background: #f3f4f6; color: #6b7280; }

/* 空状态 */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
}
.empty .empty-icon { font-size: 56px; margin-bottom: 16px; }
.empty .empty-text { font-size: 14px; line-height: 1.6; }

/* 列表项 */
.list-item {
  background: #fff;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.list-item:active { background: #f8fafc; }
.list-item:last-child { border-bottom: none; }

/* 底部安全区 */
.safe-bottom { padding-bottom: env(safe-area-inset-bottom); }

/* 隐藏滚动条 */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* 动画 */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.fade-in { animation: fadeIn 0.3s; }
.slide-up { animation: slideUp 0.3s; }

/* 通用tab切换 */
.tabs {
  background: #fff;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid #f0f0f0;
}
.tab {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  background: #f1f5f9;
  color: #64748b;
  white-space: nowrap;
  border: none;
  font-weight: 500;
  transition: all 0.2s;
}
.tab.active {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

/* 通用弹窗 */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: flex-end;
  justify-content: center;
}
.modal.show { display: flex; animation: fadeIn 0.2s; }
.modal-content {
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px;
  width: 100%;
  max-width: 500px;
  max-height: 70vh;
  overflow-y: auto;
  animation: slideUp 0.3s;
}
.modal-handle {
  width: 40px; height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  margin: 0 auto 16px;
}

/* 价格 */
.price { color: #ef4444; font-weight: 800; }
.price small { font-size: 12px; font-weight: 500; }

/* 提示条 */
.tip {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-left: 4px solid #2563eb;
  padding: 12px 16px;
  margin: 12px;
  font-size: 13px;
  color: #1e40af;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
