/* ============================================================
 * base.css —— H5 版全局基础样式（对齐小程序 app.wxss）
 * rpx → 以 iPhone 6（750rpx）为基准换算：1rpx = 0.5px（在 375 宽屏）
 * 这里统一以 vw 换算：1rpx = 100/750 vw = 0.1333vw
 * ============================================================ */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  background: #f5f5f5;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: #333;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: contain;
}

body {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
input, textarea { font: inherit; color: inherit; outline: none; border: none; background: transparent; }

/* ===== 工具类 ===== */
.flex-row { display: flex; flex-direction: row; align-items: center; }
.flex-col { display: flex; flex-direction: column; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }

.text-primary { color: #1a6eff; }
.text-orange { color: #ff6600; }
.text-red { color: #ff3333; }
.text-gray { color: #999; }
.text-white { color: #fff; }
.text-bold { font-weight: bold; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-small { font-size: 12px; }
.text-normal { font-size: 14px; }
.text-large { font-size: 16px; }
.text-xlarge { font-size: 18px; }

.bg-primary { background-color: #1a6eff; }
.bg-white { background-color: #fff; }

.mt-5 { margin-top: 5px; }
.mt-10 { margin-top: 10px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-5 { margin-bottom: 5px; }
.mb-10 { margin-bottom: 10px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.ml-5 { margin-left: 5px; }
.ml-10 { margin-left: 10px; }
.mr-5 { margin-right: 5px; }
.mr-10 { margin-right: 10px; }
.p-10 { padding: 10px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.px-16 { padding-left: 16px; padding-right: 16px; }
.py-10 { padding-top: 10px; padding-bottom: 10px; }

/* 通用卡片 */
.card {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  height: 44px;
  line-height: 44px;
  padding: 0 22px;
  font-size: 16px;
  font-weight: bold;
  user-select: none;
  transition: opacity .2s;
}
.btn:active { opacity: .75; }
.btn[disabled], .btn.is-disabled {
  opacity: .5;
  pointer-events: none;
}
.btn-block { width: 100%; display: flex; }

.btn-primary {
  background: linear-gradient(135deg, #1a6eff, #4d8eff);
  color: #fff;
}
.btn-orange {
  background: linear-gradient(135deg, #ff6600, #ff9933);
  color: #fff;
}
.btn-red {
  background: linear-gradient(135deg, #ff4d4f, #ff7875);
  color: #fff;
}
.btn-green {
  background: linear-gradient(135deg, #52c41a, #73d13d);
  color: #fff;
}
.btn-gray {
  background: #f2f2f2;
  color: #666;
}
.btn-outline {
  background: #fff;
  color: #1a6eff;
  border: 1px solid #1a6eff;
}

.btn-sm {
  height: 32px;
  line-height: 32px;
  font-size: 13px;
  padding: 0 14px;
  border-radius: 16px;
}

/* 价格样式 */
.price {
  color: #ff3333;
  font-weight: bold;
  font-size: 16px;
}
.price::before {
  content: '¥';
  font-size: 12px;
  margin-right: 1px;
}

/* 标签 */
.badge {
  background: #ff3333;
  color: #fff;
  font-size: 10px;
  padding: 1px 8px;
  border-radius: 10px;
  display: inline-block;
}
.badge-primary { background: #1a6eff; }
.badge-green { background: #52c41a; }
.badge-orange { background: #ff6600; }
.badge-gray { background: #999; }

.divider {
  height: 1px;
  background: #eee;
  margin: 10px 0;
}

/* 头像占位 */
.avatar-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
}

/* 表单 */
.form-group {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}
.form-group:last-child { border-bottom: none; }
.form-label {
  display: block;
  font-size: 14px;
  color: #333;
  margin-bottom: 6px;
}
.form-label.required::before {
  content: '*';
  color: #ff3333;
  margin-right: 4px;
}
.form-input, .form-textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  color: #333;
  background: #f7f7f7;
  border-radius: 6px;
  border: 1px solid transparent;
}
.form-input:focus, .form-textarea:focus {
  border-color: #1a6eff;
  background: #fff;
}
.form-textarea {
  height: 96px;
  padding: 10px 12px;
  line-height: 1.6;
  resize: none;
}
.form-inline {
  display: flex;
  align-items: center;
}
.form-inline .form-label {
  flex: 0 0 90px;
  margin-bottom: 0;
}

.form-row {
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
}
.form-row-label {
  flex: 0 0 90px;
  color: #999;
  font-size: 14px;
}
.form-row-value {
  flex: 1;
  color: #333;
  font-size: 14px;
}
.form-row:last-child { border-bottom: none; }

/* 空状态 */
.empty {
  padding: 60px 30px;
  text-align: center;
  color: #999;
}
.empty .empty-icon {
  font-size: 60px;
  opacity: .3;
  margin-bottom: 10px;
}
.empty-text {
  font-size: 13px;
  color: #999;
}

/* section */
.section {
  padding: 0 12px;
  margin-bottom: 12px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
}
.section-title {
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: bold;
  color: #333;
}
.section-title-bar {
  width: 4px;
  height: 18px;
  background: #ff3333;
  border-radius: 2px;
  margin-right: 6px;
}
.section-more {
  font-size: 13px;
  color: #1a6eff;
}

/* 悬浮按钮 */
.fab {
  position: fixed;
  right: 16px;
  bottom: 80px;
  width: 52px;
  height: 52px;
  border-radius: 26px;
  background: #1a6eff;
  color: #fff;
  box-shadow: 0 4px 16px rgba(26, 110, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
}

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

/* 滚动 */
.scroll-y { overflow-y: auto; -webkit-overflow-scrolling: touch; }
