/* referral-rental-h5/css/style.css */
:root {
  --primary: #1677ff;
  --primary-light: #e6f0ff;
  --success: #52c41a;
  --warning: #faad14;
  --danger: #ff4d4f;
  --text-primary: #262626;
  --text-secondary: #595959;
  --text-muted: #8c8c8c;
  --border: #d9d9d9;
  --bg: #f5f5f5;
  --bg-white: #ffffff;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(60px + var(--safe-bottom));
}

/* 卡片 */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 8px 12px;
  box-shadow: var(--shadow);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.2s;
}
.btn:active { opacity: 0.8; }
.btn-primary {
  background: linear-gradient(135deg, #1677ff, #4096ff);
  color: #fff;
}
.btn-success {
  background: linear-gradient(135deg, #52c41a, #73d13d);
  color: #fff;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 金额 */
.money { font-family: 'DIN Alternate', 'DIN', -apple-system, monospace; font-weight: 700; }
.money-primary { color: var(--primary); }
.money-success { color: var(--success); }
.money-warning { color: var(--warning); }

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}
.tag-primary { background: var(--primary-light); color: var(--primary); }
.tag-success { background: #f6ffed; color: var(--success); }
.tag-warning { background: #fffbe6; color: var(--warning); }
.tag-danger { background: #fff2f0; color: var(--danger); }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--text-primary); }
.form-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: #fafafa;
  -webkit-appearance: none;
}
.form-input:focus { outline: none; border-color: var(--primary); background: #fff; }

/* 底部导航 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  display: flex;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  padding-bottom: var(--safe-bottom);
  z-index: 100;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  color: #999;
  text-decoration: none;
  font-size: 11px;
  transition: color 0.2s;
}
.nav-item .nav-icon { font-size: 22px; margin-bottom: 2px; }
.nav-item.active { color: var(--primary); }

/* Banner */
.banner {
  background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
  padding: 32px 16px;
  color: #fff;
  text-align: center;
}
.banner-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.banner-subtitle { font-size: 13px; opacity: 0.9; }

/* 统计栏 */
.stats-bar {
  display: flex;
  background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
  padding: 20px 0;
}
.stat-box { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; color: #fff; }
.stat-box:not(:last-child) { border-right: 1px solid rgba(255,255,255,0.2); }
.stat-num { font-size: 24px; font-weight: 700; }
.stat-label { font-size: 12px; opacity: 0.9; }

/* 菜单网格 */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  text-decoration: none;
  color: var(--text-primary);
}
.menu-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 6px;
}
.menu-icon-blue { background: var(--primary-light); }
.menu-icon-green { background: #f6ffed; }
.menu-icon-orange { background: #fffbe6; }
.menu-icon-purple { background: #f9f0ff; }
.menu-text { font-size: 12px; font-weight: 500; }

/* 列表 */
.list-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}
.list-item:last-child { border-bottom: none; }

/* 步骤 */
.step-item { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.step-content { display: flex; flex-direction: column; gap: 2px; }
.step-title { font-size: 14px; font-weight: 500; }
.step-desc { font-size: 12px; color: var(--text-secondary); }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state .empty-icon { font-size: 60px; margin-bottom: 12px; }
.empty-state .empty-text { color: var(--text-muted); font-size: 14px; }

/* 筛选栏 */
.filter-bar {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-item {
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  background: #f5f5f5;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
}
.filter-item.active { background: var(--primary); color: #fff; }

/* 客户卡片 */
.customer-card { margin-bottom: 8px; }
.customer-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #f0f0f0; }
.customer-info { display: flex; align-items: center; gap: 10px; }
.customer-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #1677ff, #4096ff); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; }
.customer-name { font-size: 15px; font-weight: 600; }
.customer-phone { font-size: 12px; color: var(--text-muted); }
.customer-body { display: flex; flex-direction: column; gap: 8px; }
.info-row { display: flex; justify-content: space-between; font-size: 13px; }
.info-label { color: var(--text-secondary); }
.info-value { font-weight: 500; }

/* 佣金卡片 */
.commission-card { margin-bottom: 8px; }
.commission-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #f0f0f0; }
.commission-month { font-size: 15px; font-weight: 600; }
.commission-customer { font-size: 12px; color: var(--text-secondary); }
.commission-body { display: flex; flex-direction: column; gap: 6px; }
.commission-row { display: flex; justify-content: space-between; font-size: 13px; }
.commission-total { margin-top: 4px; padding-top: 6px; border-top: 1px dashed #f0f0f0; }
.commission-total .info-value { font-size: 16px; font-weight: 700; }

/* 提现 */
.balance-section {
  background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
  padding: 24px 16px;
  text-align: center;
  color: #fff;
}
.balance-label { font-size: 13px; opacity: 0.9; margin-bottom: 6px; }
.balance-value { font-size: 36px; font-weight: 700; margin-bottom: 4px; }
.balance-tip { font-size: 12px; opacity: 0.8; }

.amount-input-row { display: flex; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 6px; }
.amount-symbol { font-size: 28px; font-weight: 700; margin-right: 6px; }
.amount-input { flex: 1; border: none; background: transparent; font-size: 24px; font-weight: 700; height: 40px; }
.amount-input:focus { outline: none; }
.amount-all { color: var(--primary); font-size: 14px; padding: 4px 10px; cursor: pointer; }

/* 历史记录 */
.history-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #f0f0f0; }
.history-left { display: flex; flex-direction: column; gap: 2px; }
.history-amount { font-size: 15px; font-weight: 600; }
.history-time { font-size: 12px; color: var(--text-muted); }

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.toast.show { opacity: 1; }

/* Loading */
.loading-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.8);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
}
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid #f0f0f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 二维码 */
.qrcode-box {
  width: 200px; height: 200px;
  margin: 16px auto;
  background: #fafafa;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border);
  font-size: 80px;
}

/* 通知 */
.notice-box {
  background: #fafafa;
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 12px;
}
.notice-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.notice-list { display: flex; flex-direction: column; gap: 4px; }
.notice-item { font-size: 12px; color: var(--text-secondary); line-height: 1.8; }
