:root {
  --brand: #22c55e;
  --brand-dark: #16a34a;
  --brand-soft: #e8f9ef;
  --ink: #1b1b23;
  --muted: #7a7a8c;
  --bg: #f5f5fb;
  --surface: #ffffff;
  --border: #ececf4;
  --success: #17b26a;
  --warn: #f79009;
  --danger: #f04438;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(27, 27, 35, 0.06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
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);
  font-size: 15px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; font-size: inherit; }
.hidden { display: none !important; }

.shell { max-width: 520px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }

.hero {
  background: var(--brand);
  color: #fff;
  padding: calc(22px + env(safe-area-inset-top)) 20px 28px;
  border-radius: 0 0 24px 24px;
}
.hero-top { display: flex; align-items: center; justify-content: space-between; }
.logo { font-weight: 800; letter-spacing: 2px; font-size: 15px; opacity: .9; }
.hero h1 { margin: 18px 0 4px; font-size: 26px; letter-spacing: .5px; }
.hero p { margin: 0; opacity: .82; font-size: 14px; }
.ghost {
  background: rgba(255, 255, 255, .16);
  border: 0;
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}

.page { padding: 18px 16px 0; }
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
}
.card + .card { margin-top: 14px; }
.card-title { margin: 0 0 4px; font-size: 18px; }
.card-sub { margin: 0 0 16px; color: var(--muted); font-size: 13px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfbfe;
  color: var(--ink);
  outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: var(--brand); background: #fff; }
.input-row { display: flex; gap: 10px; }
.input-row .input { flex: 1; }

.btn {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: background .15s;
}
.btn:active { background: var(--brand-dark); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
  font-weight: 600;
  height: 44px;
  border-radius: 12px;
  width: 100%;
  cursor: pointer;
}
.btn-sms {
  min-width: 108px;
  height: 46px;
  border: 1px solid var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-sms[disabled] { opacity: .5; cursor: not-allowed; }

.hint { font-size: 12px; color: var(--muted); margin-top: 8px; min-height: 16px; word-break: break-all; }
.hint.warn { color: var(--warn); }
.hint.danger { color: var(--danger); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 22px 4px 10px;
}
.section-head h2 { margin: 0; font-size: 16px; }
.section-head span { font-size: 12px; color: var(--muted); }

.shop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 4px 14px rgba(27, 27, 35, .04);
  cursor: pointer;
}
.shop-logo {
  width: 46px; height: 46px; flex: none;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
  overflow: hidden;
}
.shop-logo img { width: 100%; height: 100%; object-fit: cover; }
.shop-main { flex: 1; min-width: 0; }
.shop-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--brand-soft);
  color: var(--brand);
  vertical-align: 1px;
}
.badge.gray { background: #f1f1f6; color: var(--muted); }
.badge.green { background: #e8f8f0; color: var(--success); }
.badge.orange { background: #fef4e6; color: var(--warn); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 44px 16px;
  font-size: 14px;
}
.empty svg { display: block; margin: 0 auto 12px; opacity: .5; }

.quick-links { margin: 22px 0 8px; text-align: center; }
.quick-links a { color: var(--muted); font-size: 13px; }

.tabs { display: flex; background: #eeeef6; border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.tabs button {
  flex: 1; height: 38px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted); font-weight: 600; cursor: pointer;
}
.tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(27,27,35,.08); }

.shop-hero {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 16px;
  text-align: center;
}
.shop-hero .shop-logo { width: 62px; height: 62px; margin: 0 auto 10px; font-size: 24px; border-radius: 18px; }
.shop-hero h1 { margin: 0; font-size: 21px; }
.shop-hero .meta { color: var(--muted); font-size: 13px; margin-top: 6px; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.stat {
  background: var(--surface);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 4px 14px rgba(27,27,35,.04);
}
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 17px; font-weight: 700; margin-top: 4px; }

.action-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.action {
  background: var(--surface);
  border: 0;
  border-radius: 14px;
  padding: 14px 4px;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(27,27,35,.04);
}
.action .ico {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin: 0 auto 6px;
  border-radius: 10px; background: var(--brand-soft); color: var(--brand);
}
.action .ico svg { width: 18px; height: 18px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
}
.topbar h1 { margin: 0; font-size: 17px; }
.topbar a { color: var(--muted); font-size: 13px; }

.toast {
  position: fixed;
  left: 50%; bottom: calc(36px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(8px);
  background: rgba(27, 27, 35, .9);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  max-width: 80vw;
  text-align: center;
  z-index: 99;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.footer-note { text-align: center; color: var(--muted); font-size: 12px; margin: 20px 0 8px; }
