/* ============ 设计令牌 ============ */
:root {
  --brand: #b3121d;
  --brand-dark: #8a0e16;
  --brand-light: #fdecee;
  --gold: #c9a227;
  --success: #0f9d58;
  --warn: #f4a100;
  --danger: #d93025;
  --info: #1677ff;

  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1f2329;
  --text-2: #646a73;
  --text-3: #8f959e;
  --line: #ebedf0;
  --line-2: #f2f3f5;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;

  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 24px;

  --shadow-sm: 0 1px 2px rgba(31, 35, 41, 0.06);
  --shadow: 0 2px 8px rgba(31, 35, 41, 0.08);
  --shadow-lg: 0 8px 24px rgba(31, 35, 41, 0.12);

  --tabbar-h: 56px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ============ 会员端布局 ============ */
.m-app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}
.m-header {
  position: sticky; top: 0; z-index: 30;
  height: 48px; display: flex; align-items: center; gap: var(--sp-3);
  padding: 0 var(--sp-4);
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
}
.m-header .m-title { font-size: var(--fs-lg); font-weight: 600; flex: 1; text-align: center; }
.m-header .m-back, .m-header .m-hact {
  min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; color: #fff; font-size: var(--fs-xl); cursor: pointer;
}
.m-header .m-hact { font-size: var(--fs-sm); }

.m-body { padding: var(--sp-3) var(--sp-4) var(--sp-5); }

/* 底部标签栏 */
.m-tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; height: var(--tabbar-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #fff; border-top: 1px solid var(--line);
  display: flex; z-index: 40;
}
.m-tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--text-3); font-size: var(--fs-xs); min-height: 44px;
}
.m-tabbar a.active { color: var(--brand); font-weight: 600; }
.m-tabbar .ic { font-size: 20px; line-height: 1; }

/* ============ 卡片 / 列表 ============ */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: var(--sp-4); margin-bottom: var(--sp-3);
}
.card.flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line-2);
  font-weight: 600; font-size: var(--fs-base);
}
.card-head .more { font-size: var(--fs-sm); color: var(--text-3); font-weight: 400; }
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: var(--sp-4) 0 var(--sp-3); font-size: var(--fs-lg); font-weight: 600;
}
.section-title small { font-size: var(--fs-sm); color: var(--text-3); font-weight: 400; }

.row { display: flex; align-items: center; gap: var(--sp-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-2); }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 var(--sp-4);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); font-size: var(--fs-base);
  cursor: pointer; transition: opacity .15s, background .15s;
}
.btn:hover:not(:disabled) { background: var(--line-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #4a3608; font-weight: 600; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--brand); color: var(--brand); }
.btn-sm { min-height: 32px; padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: var(--sp-2); }
.btn-group .btn { flex: 1; }

/* ============ 表单 ============ */
.field { margin-bottom: var(--sp-4); }
.field > label, .field-label {
  display: block; margin-bottom: var(--sp-2); font-size: var(--fs-sm); color: var(--text-2); font-weight: 500;
}
.field .req { color: var(--danger); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  transition: border-color .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); outline: none; }
.textarea { min-height: 88px; resize: vertical; }
.hint { margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--text-3); }
.err { margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--danger); }

/* ============ 标签 / 徽标 ============ */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px var(--sp-2); border-radius: 999px;
  font-size: var(--fs-xs); line-height: 18px; background: var(--line-2); color: var(--text-2);
}
.tag-brand { background: var(--brand-light); color: var(--brand); }
.tag-gold { background: #fdf6e3; color: #8a6d0b; }
.tag-success { background: #e7f6ee; color: var(--success); }
.tag-warn { background: #fef5e5; color: #b26a00; }
.tag-danger { background: #fdeceb; color: var(--danger); }
.tag-info { background: #eaf2ff; color: var(--info); }

.money { font-family: "DIN Alternate", "Helvetica Neue", Arial, sans-serif; font-weight: 700; color: var(--brand); }
.money::before { content: "¥"; font-size: .78em; margin-right: 1px; font-weight: 500; }
.money-plain::before { content: none; }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.strong { font-weight: 600; }
.center { text-align: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrap-any { overflow-wrap: anywhere; word-break: break-word; }

/* ============ 列表项 ============ */
.list-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line-2);
}
.list-item:last-child { border-bottom: 0; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-size: var(--fs-base); font-weight: 500; }
.list-item .li-sub { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }
.list-item .li-right { text-align: right; white-space: nowrap; }

/* ============ 空态 / 加载 ============ */
.empty {
  padding: var(--sp-6) var(--sp-4); text-align: center; color: var(--text-3); font-size: var(--fs-sm);
}
.empty .empty-ic { font-size: 36px; margin-bottom: var(--sp-2); opacity: .5; }
.loading { padding: var(--sp-5); text-align: center; color: var(--text-3); font-size: var(--fs-sm); }
.spinner {
  display: inline-block; width: 16px; height: 16px; margin-right: 6px;
  border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%;
  animation: spin .7s linear infinite; vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2s; }
  * { transition: none !important; }
}

/* ============ 弹层 / 轻提示 ============ */
.toast-wrap {
  position: fixed; left: 50%; top: 64px; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: var(--sp-2); align-items: center;
  pointer-events: none; width: max-content; max-width: 90vw;
}
.toast {
  padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-sm);
  background: rgba(31, 35, 41, .92); color: #fff; font-size: var(--fs-sm);
  box-shadow: var(--shadow); animation: toastIn .2s ease-out;
}
.toast.error { background: rgba(217, 48, 37, .95); }
.toast.success { background: rgba(15, 157, 88, .95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.modal-mask {
  position: fixed; inset: 0; z-index: 150; background: rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center; padding: var(--sp-4);
}
.modal {
  width: 100%; max-width: 400px; max-height: 84vh; overflow: auto;
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4); border-bottom: 1px solid var(--line-2); font-weight: 600;
}
.modal-head button { background: none; border: 0; font-size: var(--fs-xl); cursor: pointer; color: var(--text-3); }
.modal-body { padding: var(--sp-4); }
.modal-foot { padding: var(--sp-3) var(--sp-4) var(--sp-4); display: flex; gap: var(--sp-2); }
.modal-foot .btn { flex: 1; }

/* ============ 表格 ============ */
.table-wrap { width: 100%; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.data th, table.data td {
  padding: var(--sp-3) var(--sp-3); text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle;
}
table.data th {
  background: #fafbfc; color: var(--text-2); font-weight: 500; white-space: nowrap; font-size: var(--fs-xs);
}
table.data tbody tr:hover { background: #fcfcfd; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .nowrap { white-space: nowrap; }

/* ============ 分页 ============ */
.pager { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); padding: var(--sp-3) 0; }
.pager button {
  min-width: 36px; min-height: 36px; border: 1px solid var(--line); background: #fff;
  border-radius: var(--radius-sm); cursor: pointer;
}
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager span { font-size: var(--fs-sm); color: var(--text-2); }

/* ============ 上传 ============ */
.uploader {
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  padding: var(--sp-4); text-align: center; background: #fafbfc; cursor: pointer;
  display: block; width: 100%;
}
.uploader:hover { border-color: var(--brand); }
.uploader input[type="file"] { display: none; }
.upload-preview { max-height: 220px; margin: 0 auto; border-radius: var(--radius-sm); }
.qr-img { width: 180px; height: 180px; margin: 0 auto; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }

/* ============ 会员端专用 ============ */
.hero {
  background: linear-gradient(140deg, var(--brand) 0%, #7d0c14 55%, #5c0a10 100%);
  color: #fff; padding: var(--sp-5) var(--sp-4) var(--sp-6);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin: calc(-1 * var(--sp-3)) calc(-1 * var(--sp-4)) 0;
}
.hero .hero-name { font-size: var(--fs-lg); font-weight: 600; }
.hero .hero-sub { font-size: var(--fs-xs); opacity: .8; margin-top: 2px; }
.hero .hero-cards { display: flex; gap: var(--sp-3); margin-top: var(--sp-4); }
.hero .hero-card {
  flex: 1; background: rgba(255, 255, 255, .14); border-radius: var(--radius);
  padding: var(--sp-3); backdrop-filter: blur(4px);
}
.hero .hero-card b { display: block; font-size: var(--fs-xl); font-family: "DIN Alternate", Arial, sans-serif; }
.hero .hero-card span { font-size: var(--fs-xs); opacity: .85; }

.banner {
  border-radius: var(--radius); overflow: hidden; margin-bottom: var(--sp-3);
  background: linear-gradient(120deg, #2b1216, #6b1017); color: #fff;
  padding: var(--sp-5) var(--sp-4); position: relative;
}
.banner h3 { font-size: var(--fs-xl); margin-bottom: var(--sp-2); }
.banner p { font-size: var(--fs-sm); opacity: .85; }
.banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* 企业介绍 */
.about-hero {
  background: linear-gradient(140deg, #7d1a12 0%, #4a1208 60%, #2b1216 100%);
  color: #fff; border-radius: var(--radius); padding: var(--sp-5) var(--sp-4);
  margin-bottom: var(--sp-3);
}
.about-hero h1 { font-size: var(--fs-xl); margin-bottom: 6px; }
.about-hero p { font-size: var(--fs-sm); opacity: .86; line-height: 1.7; }
.about-sec { margin-bottom: var(--sp-3); }
.about-sec h2 {
  font-size: var(--fs-lg); margin: 0 0 var(--sp-3);
  padding-left: 10px; border-left: 3px solid var(--brand); line-height: 1.2;
}
.about-sec p { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.9; margin-bottom: var(--sp-2); }
.about-sec ul { margin: 0; padding-left: 18px; }
.about-sec li { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.9; }
.about-facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.about-fact { background: #faf7f4; border-radius: var(--radius-sm); padding: var(--sp-3); }
.about-fact b { display: block; color: var(--brand); font-size: var(--fs-base); }
.about-fact span { font-size: var(--fs-xs); color: var(--text-3); }
.about-img { width: 100%; border-radius: var(--radius); margin-bottom: var(--sp-3); }
.detail-img { width: 100%; display: block; border-radius: 6px; margin-bottom: 8px; background: #faf7f2; }

/* 推广海报 */
.poster-stage { display: flex; justify-content: center; margin-bottom: var(--sp-2); }
.poster {
  position: relative; width: 100%; max-width: 330px;
  aspect-ratio: 750 / 1200; background-size: 100% 100%; background-repeat: no-repeat;
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.poster-qr {
  position: absolute; transform: translate(-50%, -50%);
  background: #fff; border-radius: 6px; padding: 2px; box-sizing: content-box;
}
.poster-phone {
  position: absolute; transform: translate(-50%, -50%);
  font-size: 13px; font-weight: 700; letter-spacing: 1px;
  color: #8a0e16; white-space: nowrap;
}

/* 首页轮播图 */
.carousel {
  position: relative; border-radius: var(--radius); overflow: hidden;
  margin-bottom: var(--sp-3); background: #2b1216; box-shadow: var(--shadow-sm);
}
.carousel-track { display: flex; transition: transform .45s cubic-bezier(.4, 0, .2, 1); }
.carousel-slide { flex: 0 0 100%; display: block; height: 150px; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-dots {
  position: absolute; bottom: 8px; left: 0; right: 0;
  display: flex; gap: 6px; justify-content: center;
}
.carousel-dots button {
  width: 6px; height: 6px; border-radius: 50%; border: 0; padding: 0;
  background: rgba(255, 255, 255, .45); cursor: pointer; transition: width .2s, background .2s;
}
.carousel-dots button.active { background: #fff; width: 14px; border-radius: 3px; }

.announce {
  display: flex; gap: var(--sp-2); align-items: center;
  background: #fff8e6; border: 1px solid #ffe6a7; color: #8a6d0b;
  border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm);
  margin-bottom: var(--sp-3); text-decoration: none;
}
.announce .announce-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.announce .announce-more { color: #b5761b; white-space: nowrap; }

.zone-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-2); }
.zone-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: var(--sp-3) 2px; border-radius: var(--radius-sm); background: #fff;
  font-size: var(--fs-xs); color: var(--text-2); text-align: center; box-shadow: var(--shadow-sm);
}
.zone-item .zi { font-size: 22px; line-height: 1.2; }

.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.pcard {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
}
.pcard .pimg {
  height: 132px; display: flex; align-items: center; justify-content: center;
  font-size: 46px; background: linear-gradient(135deg, #faf3f3, #f3e9ea);
}
.pcard .pimg img { width: 100%; height: 100%; object-fit: cover; }
.pcard .pbody { padding: var(--sp-3); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcard .pname { font-size: var(--fs-sm); font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .prow { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); margin-top: auto; }
.pcard .pdel { font-size: var(--fs-xs); color: var(--text-3); text-decoration: line-through; }

.tabs {
  display: flex; gap: var(--sp-1); overflow-x: auto; padding: var(--sp-2) 0;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 0 0 auto; padding: 6px var(--sp-3); border: 1px solid var(--line);
  background: #fff; border-radius: 999px; font-size: var(--fs-sm); color: var(--text-2); cursor: pointer;
}
.tabs button.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

.kv { display: flex; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) 0; font-size: var(--fs-sm); }
.kv .k { color: var(--text-2); }
.kv .v { font-weight: 500; text-align: right; overflow-wrap: anywhere; }

.bottom-bar {
  position: fixed; bottom: var(--tabbar-h); left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; background: #fff; border-top: 1px solid var(--line);
  padding: var(--sp-2) var(--sp-4) calc(var(--sp-2) + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: var(--sp-3); z-index: 35;
}
.bottom-bar.nobar { bottom: 0; }

.auth-wrap { max-width: 420px; margin: 0 auto; padding: var(--sp-6) var(--sp-4); }
.auth-logo {
  width: 64px; height: 64px; border-radius: var(--radius); margin: 0 auto var(--sp-3);
  background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
}
.auth-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: var(--radius); }
.auth-title { text-align: center; font-size: var(--fs-xl); font-weight: 700; margin-bottom: var(--sp-2); }
.auth-sub { text-align: center; color: var(--text-3); font-size: var(--fs-sm); margin-bottom: var(--sp-5); }

.step-hint {
  display: flex; gap: var(--sp-2); align-items: flex-start; padding: var(--sp-3);
  background: var(--brand-light); border-radius: var(--radius-sm); color: var(--brand);
  font-size: var(--fs-xs); line-height: 1.6; margin-bottom: var(--sp-3);
}
