/* RewardGo 原型 - 全站样式 */
:root {
  --primary: #6c3ef4;
  --primary-dark: #5628d6;
  --primary-light: #efe9ff;
  --accent: #ff5a5f;
  --green: #12b76a;
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1f2430;
  --text-2: #6b7280;
  --border: #e6e8f0;
  --shadow: 0 2px 10px rgba(31,36,48,.07);
  --radius: 12px;
  --max-w: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
header.site {
  background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-in { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { font-size: 22px; font-weight: 800; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.logo .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); display: inline-block; }
nav.main { display: flex; gap: 4px; flex: 1; }
nav.main a { padding: 8px 14px; border-radius: 8px; font-weight: 600; color: var(--text-2); }
nav.main a:hover, nav.main a.active { color: var(--primary); background: var(--primary-light); }
.search-box { flex: 0 1 340px; position: relative; }
.search-box input {
  width: 100%; padding: 9px 14px 9px 38px; border: 1.5px solid var(--border);
  border-radius: 999px; font-size: 14px; outline: none; background: var(--bg);
}
.search-box input:focus { border-color: var(--primary); background: #fff; }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--text-2); }
.btn {
  display: inline-block; border: none; cursor: pointer; font-weight: 700; font-size: 14px;
  padding: 10px 22px; border-radius: 999px; transition: .15s; text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-ghost:hover { background: var(--primary-light); }
.btn-sm { padding: 7px 16px; font-size: 13px; }

/* ---------- Carousel ---------- */
.carousel { position: relative; overflow: hidden; border-radius: 0 0 18px 18px; }
.slides { display: flex; transition: transform .5s ease; }
.slide {
  min-width: 100%; min-height: 300px; display: flex; flex-direction: column;
  justify-content: center; align-items: flex-start; padding: 48px 8%; color: #fff; position: relative;
}
.slide h2 { font-size: 38px; font-weight: 800; margin-bottom: 10px; }
.slide p { font-size: 17px; opacity: .92; margin-bottom: 22px; }
.slide .rate-badge {
  position: absolute; right: 8%; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.16); border: 2px solid rgba(255,255,255,.65);
  border-radius: 50%; width: 150px; height: 150px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-weight: 800; font-size: 34px;
}
.slide .rate-badge small { font-size: 12px; font-weight: 600; letter-spacing: 1px; opacity: .9; }
.car-dots { position: absolute; bottom: 16px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.car-dots span { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; transition: .2s; }
.car-dots span.on { background: #fff; width: 26px; border-radius: 5px; }

/* ---------- Sections ---------- */
section.block { padding: 36px 0 8px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.sec-head h3 { font-size: 22px; font-weight: 800; }
.sec-head a { color: var(--primary); font-weight: 600; font-size: 14px; }
.sec-head a:hover { text-decoration: underline; }

/* ---------- Store cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.store-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  transition: .18s; position: relative;
}
.store-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary); }
.store-logo {
  width: 56px; height: 56px; border-radius: 14px; color: #fff; font-weight: 800; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
}
.store-card .name { font-weight: 700; font-size: 14px; text-align: center; }
.store-card .meta { font-size: 12px; color: var(--text-2); }
.store-card .rate { color: var(--primary); font-weight: 800; font-size: 15px; }
.store-card .rate em { font-style: normal; }
.store-card .old { color: #b0b6c3; text-decoration: line-through; font-size: 12px; margin-left: 4px; }
.tag-region {
  position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 700;
  background: var(--bg); color: var(--text-2); padding: 2px 8px; border-radius: 999px;
}
.tag-up {
  position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 700;
  background: #e8f8f0; color: var(--green); padding: 2px 8px; border-radius: 999px;
}

/* ---------- Promo list ---------- */
.promo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.promo-item {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; gap: 14px; align-items: center; transition: .18s;
}
.promo-item:hover { box-shadow: var(--shadow); border-color: var(--primary); }
.promo-item .store-logo { flex: 0 0 48px; width: 48px; height: 48px; font-size: 20px; border-radius: 12px; }
.promo-item .body { flex: 1; min-width: 0; }
.promo-item .store-name { font-size: 12px; color: var(--primary); font-weight: 700; }
.promo-item .title { font-weight: 600; margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.promo-item .rate { font-size: 13px; color: var(--green); font-weight: 700; }
.code-chip {
  flex-shrink: 0; border: 1.5px dashed var(--primary); color: var(--primary); font-weight: 800;
  font-size: 12px; padding: 7px 12px; border-radius: 8px; cursor: pointer; background: var(--primary-light);
}
.code-chip:hover { background: var(--primary); color: #fff; }

/* ---------- Store detail ---------- */
.detail-hero {
  background: linear-gradient(120deg, #6c3ef4, #9b6bff); color: #fff;
  padding: 44px 0; border-radius: 0 0 18px 18px;
}
.detail-hero .row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.detail-hero .store-logo { width: 84px; height: 84px; font-size: 36px; border-radius: 20px; }
.detail-hero h1 { font-size: 30px; font-weight: 800; }
.detail-hero .rate-big { font-size: 42px; font-weight: 800; line-height: 1.1; }
.detail-hero .rate-big small { display: block; font-size: 14px; font-weight: 600; opacity: .9; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 28px; }
.step { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.step .num {
  width: 30px; height: 30px; border-radius: 50%; background: var(--primary-light); color: var(--primary);
  font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.step h4 { font-size: 15px; margin-bottom: 4px; }
.step p { font-size: 13px; color: var(--text-2); }

/* ---------- How it works ---------- */
.hiw { background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 40px 0; margin-top: 40px; }
.hiw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.hiw-item { text-align: center; padding: 12px; }
.hiw-item .ico { font-size: 40px; margin-bottom: 10px; }
.hiw-item h4 { margin-bottom: 6px; }
.hiw-item p { color: var(--text-2); font-size: 14px; }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0; }
.filters button {
  border: 1.5px solid var(--border); background: #fff; padding: 7px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer;
}
.filters button.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Footer ---------- */
footer.site { background: #1f2430; color: #aab1c2; margin-top: 48px; padding: 40px 0 24px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 28px; }
.foot-grid h5 { color: #fff; margin-bottom: 12px; font-size: 15px; }
.foot-grid a { display: block; padding: 4px 0; font-size: 14px; }
.foot-grid a:hover { color: #fff; }
.copyright { border-top: 1px solid #333a4d; padding-top: 18px; font-size: 13px; text-align: center; }

/* ---------- Modal ---------- */
.modal-mask {
  display: none; position: fixed; inset: 0; background: rgba(20,22,30,.55); z-index: 200;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.open { display: flex; }
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 420px; padding: 34px;
  position: relative; animation: pop .22s ease;
}
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal .close { position: absolute; right: 16px; top: 14px; font-size: 22px; color: var(--text-2); cursor: pointer; background: none; border: none; }
.modal h3 { font-size: 22px; margin-bottom: 6px; }
.modal .sub { color: var(--text-2); font-size: 14px; margin-bottom: 20px; }
.modal input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; margin-bottom: 12px; outline: none;
}
.modal input:focus { border-color: var(--primary); }
.modal .btn { width: 100%; padding: 13px; }
.modal .fine { font-size: 12px; color: var(--text-2); margin-top: 12px; text-align: center; }
.modal .ok { text-align: center; padding: 20px 0; }
.modal .ok .big { font-size: 44px; }
.modal .ok h3 { margin-top: 8px; }
.modal .ok p { color: var(--text-2); font-size: 14px; margin-top: 6px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #1f2430; color: #fff; padding: 12px 24px; border-radius: 999px; font-size: 14px;
  opacity: 0; transition: .3s; z-index: 300; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Legal pages ---------- */
.legal { max-width: 860px; padding-bottom: 48px; }
.legal h2 { font-size: 19px; font-weight: 800; margin: 30px 0 10px; color: var(--primary-dark); }
.legal h3 { font-size: 15px; font-weight: 700; margin: 16px 0 6px; }
.legal p, .legal li { font-size: 14px; color: #3c4250; }
.legal p { margin-bottom: 8px; }
.legal ul { padding-left: 22px; margin-bottom: 10px; }
.legal li { margin-bottom: 5px; }
.legal-notice {
  background: #fff8e1; border: 1px solid #f2c94c; color: #7a5b00; font-size: 13px;
  font-weight: 600; border-radius: 10px; padding: 10px 16px; margin-bottom: 8px;
}

/* ---------- Page head ---------- */
.page-head { padding: 34px 0 6px; }
.page-head h1 { font-size: 28px; font-weight: 800; }
.page-head p { color: var(--text-2); margin-top: 4px; }

@media (max-width: 860px) {
  nav.main { display: none; }
  .search-box { flex: 1; }
  .slide h2 { font-size: 26px; }
  .slide .rate-badge { display: none; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
