/* =============================================
   APP风格公共样式库 - 简约清新风格
   主题色: #2de370 (绿色)
   辅助色: #1890ff (蓝色), #ff9500 (橙色), #722ed1 (紫色)
   ============================================= */

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  color: #333;
  background: #f5f5f5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== 间距工具类 ===== */
.p-0 { padding: 0 !important; }
.p-10 { padding: 10px !important; }
.p-15 { padding: 15px !important; }
.p-20 { padding: 20px !important; }
.m-0 { margin: 0 !important; }
.mt-10 { margin-top: 10px !important; }
.mt-15 { margin-top: 15px !important; }
.mt-20 { margin-top: 20px !important; }
.mb-10 { margin-bottom: 10px !important; }
.mb-15 { margin-bottom: 15px !important; }
.mb-20 { margin-bottom: 20px !important; }

/* ===== 通用卡片 ===== */
.app-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin: 0 12px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.app-card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #333;
}

.app-card-title .more {
  font-size: 12px;
  color: #999;
  text-decoration: none;
  font-weight: normal;
}

/* ===== 按钮样式 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #2de370 0%, #1dbb5e 100%);
  color: #fff;
}

.btn-primary:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-default {
  background: #f5f5f5;
  color: #666;
}

.btn-outline {
  background: transparent;
  border: 1px solid #ddd;
  color: #666;
}

.btn-danger {
  background: #ff4d4f;
  color: #fff;
}

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

.form-label {
  display: block;
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  font-size: 14px;
  background: #fafafa;
  transition: border-color 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: #2de370;
  background: #fff;
}

.form-control[readonly] {
  background: #f5f5f5;
  color: #999;
}

/* ===== 列表项 ===== */
.list-item {
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
}

.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;
  font-size: 18px;
  margin-right: 12px;
  flex-shrink: 0;
}

.list-item-content {
  flex: 1;
  min-width: 0;
}

.list-item-content h4 {
  font-size: 15px;
  margin-bottom: 4px;
  color: #333;
}

.list-item-content p {
  font-size: 12px;
  color: #999;
}

.list-item-action {
  flex-shrink: 0;
  color: #999;
  font-size: 12px;
}

/* ===== 状态标签 ===== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.tag-success { background: #e8f8ee; color: #2de370; }
.tag-warning { background: #fff7e6; color: #ff9500; }
.tag-info { background: #e6f2ff; color: #1890ff; }
.tag-danger { background: #fff1f0; color: #ff4d4f; }

/* ===== 金额显示 ===== */
.amount {
  font-size: 18px;
  font-weight: 600;
  color: #2de370;
}

.amount-sm {
  font-size: 15px;
  font-weight: 500;
  color: #333;
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

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

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

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

.app-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #999;
  font-size: 11px;
  padding: 4px 0;
  transition: color 0.3s;
}

.app-nav-item .nav-icon {
  font-size: 22px;
  margin-bottom: 2px;
}

.app-nav-item.active {
  color: #2de370;
}

/* ===== 页面头部 ===== */
.app-header {
  background: linear-gradient(135deg, #2de370 0%, #1dbb5e 100%);
  padding: 15px 16px 50px;
  color: #fff;
  position: relative;
}

.app-header .header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-header .header-title {
  font-size: 18px;
  font-weight: 600;
}

.app-header .header-subtitle {
  font-size: 12px;
  opacity: 0.9;
}

/* ===== 用户卡片 ===== */
.user-card {
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
}

.user-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #2de370;
  margin-right: 12px;
}

.user-info h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.user-info p {
  font-size: 12px;
  opacity: 0.9;
}

/* ===== 统计卡片网格 ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-card {
  background: linear-gradient(135deg, #2de370 0%, #1dbb5e 100%);
  border-radius: 12px;
  padding: 16px;
  color: #fff;
}

.stat-card.blue {
  background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
}

.stat-card.orange {
  background: linear-gradient(135deg, #ff9500 0%, #fa541c 100%);
}

.stat-card .stat-num {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 4px;
}

.stat-card .stat-txt {
  font-size: 12px;
  opacity: 0.9;
}

/* ===== 快捷功能 ===== */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #333;
}

.action-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 6px;
}

.action-icon.green { background: #e8f8ee; color: #2de370; }
.action-icon.blue { background: #e6f2ff; color: #1890ff; }
.action-icon.orange { background: #fff7e6; color: #ff9500; }
.action-icon.purple { background: #f5f0ff; color: #722ed1; }

.action-item span {
  font-size: 12px;
  color: #666;
}

/* ===== Tab切换 ===== */
.app-tabs {
  display: flex;
  background: #fff;
  padding: 0 12px;
  margin-bottom: 12px;
  border-radius: 12px;
}

.app-tab {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  font-size: 14px;
  color: #666;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
}

.app-tab.active {
  color: #2de370;
  border-bottom-color: #2de370;
}

/* ===== 订单卡片 ===== */
.order-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

.order-header .order-id {
  font-size: 13px;
  color: #999;
}

.order-body {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.order-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-right: 10px;
}

.order-icon.in { background: #e8f8ee; color: #2de370; }
.order-icon.out { background: #fff7e6; color: #ff9500; }

.order-info h4 {
  font-size: 15px;
  margin-bottom: 2px;
}

.order-info p {
  font-size: 12px;
  color: #999;
}

.order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

.order-amount {
  font-size: 16px;
  font-weight: 600;
  color: #2de370;
}

.order-status {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
}

/* ===== 侧边菜单 ===== */
.side-menu {
  position: fixed;
  top: 0;
  right: -220px;
  width: 220px;
  height: 100%;
  background: #fff;
  z-index: 201;
  transition: right 0.3s;
  box-shadow: -2px 0 12px rgba(0,0,0,0.1);
}

.side-menu.active {
  right: 0;
}

.side-menu-header {
  padding: 20px;
  background: linear-gradient(135deg, #2de370 0%, #1dbb5e 100%);
  color: #fff;
}

.side-menu-item {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  color: #333;
  text-decoration: none;
  border-bottom: 1px solid #f0f0f0;
}

.side-menu-item .icon {
  margin-right: 12px;
  font-size: 18px;
}

.side-menu-item.danger {
  color: #ff4d4f;
}

/* ===== 遮罩层 ===== */
.app-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: none;
}

.app-overlay.active {
  display: block;
}

/* ===== 分页 ===== */
.app-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  gap: 8px;
}

.app-pagination a, .app-pagination span {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
  color: #666;
  background: #fff;
}

.app-pagination a.active {
  background: #2de370;
  color: #fff;
}

/* ===== 加载状态 ===== */
.loading {
  text-align: center;
  padding: 30px;
  color: #999;
}

.loading::after {
  content: '加载中...';
}

/* ===== 安全区域适配 ===== */
.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

/* ===== 页面容器 ===== */
.app-container {
  min-height: 100vh;
  padding-bottom: 80px;
}

/* ===== 渐变背景块 ===== */
.gradient-bg {
  background: linear-gradient(135deg, #2de370 0%, #1dbb5e 100%);
}

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

/* ===== 分割线 ===== */
.divider {
  height: 1px;
  background: #f0f0f0;
  margin: 12px 0;
}

/* ===== 文本工具 ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: #2de370; }
.text-danger { color: #ff4d4f; }
.text-warning { color: #ff9500; }
.text-info { color: #1890ff; }
.text-muted { color: #999; }
.font-bold { font-weight: 600; }
.font-12 { font-size: 12px; }
.font-14 { font-size: 14px; }
.font-16 { font-size: 16px; }
.font-18 { font-size: 18px; }