/* 醒狮陪玩 · 设计系统（共享） */
:root {
  --red: #E1251B;
  --red-600: #C8161D;
  --red-500: #F23A2C;
  --red-50: #FFF1F0;
  --red-100: #FFE2DE;
  --gold: #F2B544;
  --gold-600: #D99A2B;
  --gold-soft: #FFF7E6;
  --ink: #17181C;
  --ink-2: #4B5058;
  --ink-3: #8B909A;
  --ink-4: #B4B8C0;
  --bg: #F4F4F6;
  --card: #FFFFFF;
  --line: #EDEDF0;
  --green: #12B76A;
  --blue: #2563EB;
  --orange: #F79009;
  --r-xl: 22px;
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 24, .04), 0 2px 8px rgba(20, 20, 24, .04);
  --shadow-md: 0 6px 24px rgba(20, 20, 24, .08);
  --shadow-lg: 0 16px 48px rgba(20, 20, 24, .16);
  --grad-red: linear-gradient(135deg, #FF5C46 0%, #E1251B 52%, #C8161D 100%);
  --grad-gold: linear-gradient(135deg, #FFE3A3, #F2B544);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 2px solid rgba(225, 37, 27, .45); outline-offset: 2px; }
::selection { background: var(--red-100); }

/* 滚动条（桌面） */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D5D7DD; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 20px; border-radius: 999px;
  font-size: 15px; font-weight: 600; white-space: nowrap;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad-red); color: #fff; box-shadow: 0 6px 16px rgba(225, 37, 27, .28); }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(225, 37, 27, .36); }
.btn-gold { background: var(--grad-gold); color: #5A3B00; box-shadow: 0 6px 16px rgba(242, 181, 68, .3); }
.btn-outline { background: #fff; color: var(--red); border: 1px solid var(--red-100); }
.btn-ghost { background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .35); }
.btn-plain { background: #F4F4F6; color: var(--ink-2); }
.btn-danger { background: #FEF3F2; color: #B42318; }
.btn-block { display: flex; width: 100%; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; border-radius: 999px; }
.btn-xs { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 999px; }
.btn-lg { height: 50px; font-size: 16px; }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; color: var(--ink-2); background: transparent;
}
.icon-btn:hover { background: rgba(0, 0, 0, .04); }

/* ---------------- 卡片 / 布局 ---------------- */
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 16px; }
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.strong { font-weight: 700; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.section { margin: 18px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-size: 18px; font-weight: 800; letter-spacing: .2px; position: relative; }
.section-title::before {
  content: ""; display: inline-block; width: 4px; height: 16px; border-radius: 4px;
  background: var(--grad-red); margin-right: 8px; vertical-align: -2px;
}
.section-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.more-link { font-size: 13px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 2px; }
.more-link:hover { color: var(--red); }

/* ---------------- 头像 / 图片 ---------------- */
.avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  background: var(--red-50); flex: none; overflow: hidden;
}
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 84px; height: 84px; }
.avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-red); color: #fff; font-weight: 700;
}
.img-cover { width: 100%; height: 100%; object-fit: cover; }

/* ---------------- 标签 / 徽标 ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600;
  background: var(--red-50); color: var(--red); line-height: 18px; white-space: nowrap;
}
.tag-gold { background: var(--gold-soft); color: #A16A0E; }
.tag-green { background: #EAFBF2; color: #0B8A57; }
.tag-gray { background: #F3F4F6; color: var(--ink-2); }
.tag-blue { background: #EFF4FF; color: #2457D6; }
.tag-line { background: transparent; border: 1px solid var(--red-100); }
.badge-dot {
  position: absolute; top: -2px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}
.dot-online { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; }
.dot-offline { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); display: inline-block; }

/* ---------------- 价格 ---------------- */
.price { color: var(--red); font-weight: 800; font-variant-numeric: tabular-nums; }
.price .cur { font-size: .68em; font-weight: 700; margin-right: 1px; }
.price .unit { font-size: .55em; font-weight: 500; color: var(--ink-3); margin-left: 2px; }
.price-lg { font-size: 26px; }
.price-line-through { color: var(--ink-4); text-decoration: line-through; font-size: 12px; margin-left: 6px; }

/* ---------------- 星级 ---------------- */
.stars { display: inline-flex; align-items: center; gap: 1px; color: var(--gold); }
.stars svg { width: 12px; height: 12px; }
.rating-val { color: var(--ink); font-weight: 700; font-size: 12px; margin-left: 3px; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 16px; }
.field-label { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-bottom: 8px; display: block; }
.input, .textarea, .select {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 12px 14px; font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--red); box-shadow: 0 0 0 3px rgba(225, 37, 27, .1);
}
.textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
.input-group { position: relative; }
.input-group .input { padding-right: 78px; }
.input-suffix {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--ink-3);
}
.form-hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.form-error { font-size: 12px; color: var(--red); margin-top: 6px; }

/* 开关 */
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px; background: #D7DAE0; transition: background .2s;
}
.switch .thumb {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); transition: transform .2s;
}
.switch input:checked ~ .track { background: var(--red); }
.switch input:checked ~ .thumb { transform: translateX(18px); }

/* 分段选择 */
.segmented { display: flex; gap: 4px; background: #F1F2F4; padding: 4px; border-radius: 12px; }
.segmented button {
  flex: 1; height: 34px; border-radius: 9px; font-size: 13px; color: var(--ink-2); font-weight: 600;
  transition: all .18s;
}
.segmented button.active { background: #fff; color: var(--red); box-shadow: var(--shadow-sm); }

/* ---------------- 列表 ---------------- */
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #fff;
  cursor: pointer; transition: background .15s;
}
.list-row:hover { background: #FAFAFB; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row .row-icon {
  width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; background: var(--red-50); color: var(--red); flex: none;
}
.list-row .chevron { color: var(--ink-4); }

/* ---------------- 空状态 / 加载 ---------------- */
.empty { padding: 56px 20px; text-align: center; color: var(--ink-3); }
.empty .empty-emoji { font-size: 40px; margin-bottom: 10px; }
.empty .empty-title { font-size: 15px; color: var(--ink-2); font-weight: 600; }
.empty .empty-sub { font-size: 12px; margin-top: 4px; }
.skeleton {
  background: linear-gradient(100deg, #EFEFF2 20%, #F8F8FA 40%, #EFEFF2 60%);
  background-size: 200% 100%; animation: shine 1.4s infinite linear; border-radius: 10px;
}
@keyframes shine { to { background-position: -200% 0; } }
.spinner {
  width: 22px; height: 22px; border: 2.5px solid var(--red-100); border-top-color: var(--red);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-wrap { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px 0; color: var(--ink-3); font-size: 13px; }

/* ---------------- Toast ---------------- */
#toast-root { position: fixed; inset: 0; pointer-events: none; z-index: 9999; display: flex; align-items: flex-start; justify-content: center; }
.toast {
  margin-top: 18vh; max-width: 78vw; background: rgba(23, 24, 28, .92); color: #fff;
  padding: 11px 18px; border-radius: 12px; font-size: 14px; line-height: 1.5; text-align: center;
  animation: toast-in .22s ease; box-shadow: 0 8px 30px rgba(0, 0, 0, .22); backdrop-filter: blur(6px);
  display: flex; align-items: center; gap: 8px;
}
.toast.success { background: rgba(12, 122, 77, .94); }
.toast.error { background: rgba(180, 35, 24, .94); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.96); } }

/* ---------------- 弹层 ---------------- */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 16, 20, .45); z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center; animation: fade-in .2s ease;
  backdrop-filter: blur(2px);
}
.overlay.center { align-items: center; padding: 24px; }
@keyframes fade-in { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 560px; background: #fff; border-radius: 24px 24px 0 0;
  padding: 20px 20px calc(20px + var(--safe-bottom)); animation: sheet-up .25s cubic-bezier(.2, .8, .3, 1);
  max-height: 86vh; overflow-y: auto;
}
@keyframes sheet-up { from { transform: translateY(100%); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet-title { font-size: 17px; font-weight: 800; }
.dialog {
  width: 100%; max-width: 360px; background: #fff; border-radius: 20px; padding: 24px 20px 18px;
  animation: pop-in .22s cubic-bezier(.2, .9, .3, 1.2); text-align: center;
}
@keyframes pop-in { from { opacity: 0; transform: scale(.92); } }
.dialog-title { font-size: 17px; font-weight: 800; margin-bottom: 8px; }
.dialog-text { font-size: 14px; color: var(--ink-2); line-height: 1.6; margin-bottom: 20px; }
.dialog-actions { display: flex; gap: 10px; }
.dialog-actions .btn { flex: 1; }

/* ---------------- 通用外壳 ---------------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.view { flex: 1; width: 100%; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 14px; }
.stack-12 > * + * { margin-top: 12px; }
.hidden { display: none !important; }
