/* ============ 本地生活商家活动推广 SaaS · 通用样式 ============ */
:root {
  --brand: #ff4d29;
  --brand-2: #ff8f2e;
  --brand-grad: linear-gradient(135deg, #ff4d29 0%, #ff7a45 60%, #ff9a2e 100%);
  --gold: #ffb700;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1d2129;
  --sub: #86909c;
  --line: #eef0f3;
  --green: #00b42a;
  --blue: #165dff;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(0, 0, 0, .06);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font-family: inherit; font-size: 14px; outline: none; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #d8dade; border-radius: 6px; }

.flex { display: flex; } .flex-c { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; }
.mt8 { margin-top: 8px } .mt12 { margin-top: 12px } .mt16 { margin-top: 16px } .mt24 { margin-top: 24px }
.mr8 { margin-right: 8px } .mb8 { margin-bottom: 8px } .mb16 { margin-bottom: 16px }
.center { text-align: center } .right { text-align: right }
.sub { color: var(--sub) } .bold { font-weight: 600 }
.small { font-size: 12px } .tiny { font-size: 11px }
.price { color: var(--brand); font-weight: 700 }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ellip2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hidden { display: none !important; }
.tag {
  display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 11px; line-height: 18px;
}
.tag-red { background: rgba(255, 77, 41, .1); color: var(--brand); }
.tag-green { background: rgba(0, 180, 42, .1); color: var(--green); }
.tag-blue { background: rgba(22, 93, 255, .1); color: var(--blue); }
.tag-gold { background: rgba(255, 183, 0, .14); color: #a35c00; }
.tag-gray { background: #f2f3f5; color: #86909c; }

.btn {
  border: none; cursor: pointer; border-radius: 22px; padding: 9px 18px; font-size: 14px;
  background: var(--brand-grad); color: #fff; font-weight: 600; transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(.97); opacity: .9; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid rgba(255, 77, 41, .4); }
.btn.gray { background: #f2f3f5; color: #4e5969; }
.btn.green { background: linear-gradient(135deg, #00b42a, #27c93f); }
.btn.blue { background: linear-gradient(135deg, #165dff, #4080ff); }
.btn.sm { padding: 5px 12px; font-size: 12px; border-radius: 14px; }
.btn.block { display: block; width: 100%; text-align: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- 表单（后台通用） ---------- */
.form-item { margin-bottom: 16px; }
.form-item > label { display: block; font-size: 13px; color: #4e5969; margin-bottom: 6px; font-weight: 500; }
.form-item > label .req { color: var(--brand); }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #e5e6eb; border-radius: 8px; background: #fff;
  transition: border-color .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); }
.textarea { min-height: 90px; resize: vertical; }
.input-group { display: flex; align-items: center; gap: 4px; }
.input-group span { color: var(--sub); font-size: 12px; }

/* ---------- 表格（后台通用） ---------- */
.table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
.table th {
  text-align: left; padding: 10px 12px; background: #f7f8fa; color: #4e5969; font-weight: 600;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: #fafbfc; }
.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- 弹窗 / 提示 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 900; display: flex;
  align-items: center; justify-content: center; padding: 16px; animation: fade .2s;
}
.mask .dialog {
  background: #fff; border-radius: 16px; width: 100%; max-width: 420px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .2); animation: pop .22s;
}
.dialog-head { padding: 14px 18px; font-weight: 600; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.dialog-body { padding: 18px; max-height: 70vh; overflow: auto; }
.dialog-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; background: #fff; z-index: 901;
  border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 82vh; overflow-y: auto; -webkit-overflow-scrolling: touch; animation: up .25s;
}
.sheet::before {
  content: ''; display: block; width: 40px; height: 4px; border-radius: 4px;
  background: #e5e6eb; margin: -8px auto 10px;
}
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { transform: scale(.9); opacity: 0 } }
@keyframes up { from { transform: translateY(100%) } }
.toast-wrap { position: fixed; top: 20%; left: 0; right: 0; z-index: 9999; pointer-events: none; text-align: center; }
.toast {
  display: inline-block; background: rgba(0, 0, 0, .8); color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 13px; margin: 6px auto; animation: fade .2s; max-width: 80%;
}

/* ---------- 空 / 加载 状态 ---------- */
.empty { padding: 48px 16px; text-align: center; color: var(--sub); }
.empty .icon { font-size: 40px; margin-bottom: 8px; opacity: .5; }
.loading { padding: 32px; text-align: center; color: var(--sub); }

/* ---------- 分页 / tabs ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; background: #fff; padding: 8px 12px; }
.tabs::-webkit-scrollbar { display: none }
.tabs .tab {
  padding: 6px 14px; border-radius: 16px; font-size: 13px; color: #4e5969; white-space: nowrap; cursor: pointer;
  background: #f4f5f7;
}
.tabs .tab.on { background: var(--brand-grad); color: #fff; font-weight: 600; }

/* ---------- 富文本编辑器 ---------- */
.editor-bar { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px; background: #f7f8fa; border: 1px solid #e5e6eb; border-bottom: none; border-radius: 8px 8px 0 0; }
.editor-bar button { border: 1px solid #e5e6eb; background: #fff; border-radius: 6px; padding: 3px 9px; cursor: pointer; font-size: 12px; }
.editor { border: 1px solid #e5e6eb; border-radius: 0 0 8px 8px; padding: 12px; min-height: 180px; background: #fff; }
.editor:focus { border-color: var(--brand); }
.editor img { max-width: 100%; border-radius: 6px; margin: 6px 0; }
.editor h3 { margin: 12px 0 6px; font-size: 15px; }
.editor ul { padding-left: 20px; margin: 6px 0; }
.editor p { margin: 6px 0; }

/* ---------- 图片上传 ---------- */
.uploader { display: flex; gap: 8px; flex-wrap: wrap; }
.uploader .box {
  width: 76px; height: 76px; border: 1px dashed #d9d9d9; border-radius: 8px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; cursor: pointer; color: var(--sub); background: #fafbfc; position: relative;
}
.uploader .box .rm {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0, 0, 0, .6);
  color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; z-index: 2;
}
.uploader .box img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
