:root {
  --blue: #2f6bff;
  --blue-deep: #1e4fd8;
  --ink: #16181d;
  --muted: #8f8878;
  --bg: #f5f0e6;
  --line: #ebe3d4;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #3474ff 0%, #2057e0 55%, #1745bd 100%);
}

.hero::before {
  content: "";
  position: absolute;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.055);
  top: -300px;
  right: -100px;
}

.hero::after {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  bottom: -260px;
  left: 18%;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 24px 52px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
}

.brand-badge svg {
  width: 15px;
  height: 15px;
}

.admin-link {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 9px;
  padding: 6px 13px;
  transition: background 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}

.admin-link:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.hero h1 {
  margin: 38px 0 12px;
  font-size: 40px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hero .sub {
  margin: 0 0 24px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.72);
}

.hero .sub b {
  color: #fff;
  font-weight: 600;
}

.search {
  position: relative;
  max-width: 560px;
}

.search svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #9aa4b6;
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 52px;
  padding: 0 16px 0 44px;
  border: none;
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  box-shadow: 0 10px 28px rgba(9, 30, 90, 0.2);
}

.search input::placeholder {
  color: #a6adba;
}

.search input:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28), 0 10px 28px rgba(9, 30, 90, 0.2);
}

/* ---------- content ---------- */

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 30px 24px 64px;
}

.notice {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1px solid #f1dcd4;
  background: #fdf4f0;
  color: #b9543f;
  font-size: 13px;
  line-height: 1.5;
}

.notice svg {
  width: 16px;
  height: 16px;
  flex: none;
  opacity: 0.85;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 0 14px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: #6e6a5f;
  letter-spacing: 0.04em;
}

.section-meta {
  font-size: 12px;
  color: #a49c8c;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.merchant-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  min-width: 0;
}

.merchant-card:hover {
  transform: translateY(-2px);
  border-color: #dfd5c2;
  box-shadow: 0 10px 24px rgba(78, 63, 35, 0.09);
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  flex: none;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  overflow: hidden;
  background: var(--blue);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.merchant-info {
  flex: 1;
  min-width: 0;
}

.merchant-name {
  font-size: 16px;
  font-weight: 600;
  color: #1a1c21;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.merchant-code {
  margin-top: 4px;
  font-size: 12px;
  color: #9a9488;
  letter-spacing: 0.02em;
}

.enter-btn {
  flex: none;
  min-width: 66px;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #d6e2ff;
  background: #f3f7ff;
  color: #2456d8;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.16s ease;
}

.enter-btn:hover {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.empty {
  padding: 56px 20px;
  text-align: center;
  color: #a49c8c;
}

.empty p {
  margin: 0 0 6px;
  font-size: 15px;
  color: #7d7668;
  font-weight: 500;
}

.empty span {
  font-size: 13px;
}

/* ---------- bottom tabbar ---------- */

body.has-tabbar {
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(255, 255, 255, 0.97);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid #ede5d6;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -6px 24px rgba(78, 63, 35, 0.06);
}

.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 58px;
  color: #9a9488;
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.03em;
  transition: color 0.16s ease;
}

.tabbar a svg {
  width: 22px;
  height: 22px;
}

.tabbar a.active {
  color: var(--blue);
  font-weight: 600;
}

/* ---------- inner pages (join / me) ---------- */

.hero.compact .hero-inner {
  padding: 20px 18px 30px;
}

.hero.compact h1 {
  margin: 24px 0 8px;
  font-size: 26px;
}

.hero.compact .sub {
  margin-bottom: 0;
  font-size: 13px;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 18px 44px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}

.card + .card {
  margin-top: 14px;
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
}

.hint-box {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: #eef4ff;
  border: 1px solid #dbe7ff;
  color: #2c5bc4;
  font-size: 13px;
  line-height: 1.6;
}

.hint-box.warn {
  background: #fdf4f0;
  border-color: #f1dcd4;
  color: #b9543f;
}

/* segmented tabs */

.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.seg button {
  height: 40px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #6f6a5f;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.16s ease;
}

.seg button.active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 14px rgba(47, 107, 255, 0.28);
}

/* forms */

.form-field {
  display: block;
  margin-bottom: 14px;
}

.form-field > span {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  color: #55503f;
  font-weight: 500;
}

.form-field > span i {
  color: #e05252;
  font-style: normal;
}

.form-field input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid #e4dccd;
  border-radius: 10px;
  background: #fdfcf9;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.form-field input:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.12);
}

.form-field input::placeholder {
  color: #b3ac9e;
}

.primary-btn {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 11px;
  background: linear-gradient(135deg, #3776ff, #2258e0);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.16s ease, transform 0.16s ease;
  box-shadow: 0 8px 20px rgba(47, 107, 255, 0.24);
}

.primary-btn:hover {
  opacity: 0.94;
}

.primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.form-msg {
  margin-top: 12px;
  padding: 10px 13px;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.55;
}

.form-msg.error {
  background: #fdf0ee;
  border: 1px solid #f3d7d2;
  color: #b94334;
}

.form-msg.success {
  background: #eef9f1;
  border: 1px solid #d2eedb;
  color: #237a45;
}

/* avatar picker */

.avatar-picker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.avatar-picker .preview {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--blue);
  color: #fff;
  font-size: 22px;
  font-weight: 600;
}

.avatar-picker .preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-picker .ops {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.avatar-picker .ops small {
  flex-basis: 100%;
  color: #a49c8c;
  font-size: 12px;
}

.small-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #e4dccd;
  background: #fff;
  color: #55503f;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.small-btn:hover {
  border-color: #cfc6b4;
  background: #fbf8f2;
}

.price-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0 0 6px;
  color: #8d8676;
  font-size: 13px;
}

.price-line b {
  color: #e05252;
  font-size: 24px;
  font-weight: 700;
}

.steps {
  margin: 0;
  padding-left: 18px;
  color: #8d8676;
  font-size: 12.5px;
  line-height: 1.9;
}

/* my page */

.profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile .face {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #eef2fb;
  color: var(--blue);
  font-size: 20px;
  font-weight: 600;
}

.profile .face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile .meta {
  flex: 1;
  min-width: 0;
}

.profile .meta h3 {
  margin: 0 0 4px;
  font-size: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile .meta p {
  margin: 0;
  font-size: 12px;
  color: #a49c8c;
}

.my-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f3ecdf;
}

.my-row:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.my-row .avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  font-size: 16px;
}

.my-row .info {
  flex: 1;
  min-width: 0;
}

.my-row .info .n {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 600;
}

.my-row .info .c {
  margin-top: 3px;
  font-size: 12px;
  color: #a49c8c;
}

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  background: #eef9f1;
  color: #237a45;
}

.status-pill.off {
  background: #f5f1e8;
  color: #9a9488;
}

.status-pill.pending {
  background: #fff5e6;
  color: #b7791f;
}

.status-pill.rejected {
  background: #fdf0ee;
  color: #b94334;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex: none;
}

.login-list {
  display: grid;
  gap: 10px;
}

.login-list button {
  height: 46px;
  border-radius: 11px;
  border: 1px solid #e4dccd;
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  color: #3b3830;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.16s ease;
}

.login-list button:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: #f7faff;
}

.login-list button b {
  color: var(--blue);
}

/* simple modal */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(18, 24, 38, 0.46);
}

.sheet {
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 24px 70px rgba(20, 30, 60, 0.24);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sheet-head h3 {
  margin: 0;
  font-size: 17px;
}

.sheet-head .close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: #f6f2e9;
  color: #7d7668;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.sheet-actions .ghost-btn {
  flex: 1;
  height: 46px;
  border-radius: 11px;
  border: 1px solid #e4dccd;
  background: #fff;
  color: #55503f;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.sheet-actions .primary-btn {
  flex: 2;
}

/* toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 150;
  max-width: 82vw;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(30, 36, 48, 0.92);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 10px 28px rgba(20, 30, 60, 0.25);
}

.toast.error {
  background: rgba(176, 58, 44, 0.95);
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .hero-inner {
    padding: 20px 18px 40px;
  }

  .hero h1 {
    margin-top: 28px;
    font-size: 29px;
  }

  main {
    padding: 22px 18px 48px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .merchant-card {
    padding: 13px 14px;
  }

  .brand-left {
    font-size: 13px;
  }
}
