/* ============================================================
   拼单局 · 设计系统
   左侧深蓝导航 + 右侧白色内容
   ============================================================ */

:root {
  /* 内容区（浅色） */
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --surface-3: #f7f9fc;

  --line: #e3e8f0;
  --line-2: #cbd4e1;

  --ink: #16233a;
  --ink-2: #475569;
  --ink-3: #7c8aa0;

  /* 左侧导航（深蓝） */
  --nav: #12305c;
  --nav-2: #0b2144;
  --nav-line: #1e4580;
  --nav-ink: #c3d3ea;
  --nav-ink-dim: #8ba6cc;
  --nav-hover: rgba(255, 255, 255, 0.08);
  --nav-active: rgba(255, 255, 255, 0.16);

  /* 品牌强调色与状态色 */
  --lime: #1d4ed8;
  --lime-2: #1e40af;
  --lime-soft: rgba(29, 78, 216, 0.1);
  --teal: #0d9488;
  --amber: #b45309;
  --red: #dc2626;

  --sidebar-w: 238px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;

  --shadow: 0 18px 40px -26px rgba(15, 33, 68, 0.35);
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

/* 保证 hidden 属性始终生效（否则会被 display:flex 之类的类覆盖） */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui,
    -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(900px 520px at 14% -14%, rgba(29, 78, 216, 0.05), transparent 68%);
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
  border-radius: 6px;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.015em; }

svg { display: block; }

/* ============================================================
   布局：左侧导航 + 右侧内容
   ============================================================ */

.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 60;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  background: linear-gradient(180deg, var(--nav), var(--nav-2));
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 22px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: #fff;
}

.brand__mark {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.sidenav { display: flex; flex-direction: column; gap: 4px; }

.sidenav__label {
  padding: 14px 11px 6px;
  color: var(--nav-ink-dim);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.sidenav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 11px;
  color: var(--nav-ink);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: 0.18s;
}

.sidenav a svg { width: 18px; height: 18px; flex: none; stroke-width: 1.8; }
.sidenav a:hover { background: var(--nav-hover); color: #fff; }
.sidenav a.is-active { background: var(--nav-active); color: #fff; }

.sidenav__count {
  margin-left: auto;
  padding: 0 7px;
  border-radius: 99px;
  background: var(--nav-hover);
  color: var(--nav-ink-dim);
  font-size: 11.5px;
  font-weight: 700;
}

.sidenav a.is-active .sidenav__count { background: rgba(255, 255, 255, 0.22); color: #fff; }

.sidebar__foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--nav-line); }

/* 侧边栏内的按钮（深色底上的浅色描边） */
.sidebar .btn--ghost { border-color: rgba(255, 255, 255, 0.28); color: #fff; }
.sidebar .btn--ghost:hover:not(:disabled) { border-color: rgba(255, 255, 255, 0.55); background: var(--nav-hover); }

.userchip { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; }

.userchip__avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.userchip__name { min-width: 0; }
.userchip__name b { display: block; font-size: 14px; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userchip__name span { display: block; color: var(--nav-ink-dim); font-size: 12px; }

.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  padding: 32px 34px 90px;
  position: relative;
  z-index: 1;
}

.main--narrow { max-width: 1080px; }

/* 页头 */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.page-head h1 { font-size: clamp(23px, 3vw, 29px); font-weight: 800; letter-spacing: -0.03em; }
.page-head p { margin: 7px 0 0; color: var(--ink-3); font-size: 14px; }
.page-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   通用工具类
   ============================================================ */

.stack { display: flex; flex-direction: column; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.row-end { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-2); }
.dimmer { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-variant-numeric: tabular-nums;
}
.num { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.hidden { display: none !important; }

/* ============================================================
   按钮
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.18s;
}

.btn svg { width: 16px; height: 16px; stroke-width: 2; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn--primary { background: var(--lime); color: #fff; }
.btn--primary:hover:not(:disabled) {
  background: var(--lime-2);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px -10px rgba(29, 78, 216, 0.55);
}

.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover:not(:disabled) { border-color: var(--ink-3); background: var(--surface-2); }

.btn--solid { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.btn--solid:hover:not(:disabled) { border-color: var(--line-2); background: #e3e9f3; }

.btn--danger { background: transparent; border-color: rgba(220, 38, 38, 0.35); color: var(--red); }
.btn--danger:hover:not(:disabled) { background: rgba(220, 38, 38, 0.08); }

.btn--sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn--lg { padding: 14px 26px; font-size: 16px; border-radius: 13px; }
.btn--block { width: 100%; }

/* 分段控件 */
.seg {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-3);
}

.seg button {
  padding: 7px 15px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.18s;
}

.seg button:hover { color: var(--ink); }
.seg button.is-on { background: var(--lime-soft); color: var(--lime); }
.seg--block { display: flex; width: 100%; }
.seg--block button { flex: 1; }

/* ============================================================
   徽标 / 状态
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge--open { background: var(--lime-soft); color: var(--lime); border-color: rgba(29, 78, 216, 0.28); }
.badge--success { background: rgba(13, 148, 136, 0.11); color: var(--teal); border-color: rgba(13, 148, 136, 0.32); }
.badge--single { background: rgba(13, 148, 136, 0.1); color: var(--teal); border-color: rgba(13, 148, 136, 0.28); }
.badge--pending { background: rgba(180, 83, 9, 0.1); color: var(--amber); border-color: rgba(180, 83, 9, 0.3); }
.badge--danger { background: rgba(220, 38, 38, 0.09); color: var(--red); border-color: rgba(220, 38, 38, 0.3); }
.badge--muted { background: var(--surface-2); color: var(--ink-3); border-color: var(--line); }

.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--open .badge__dot { animation: pulse 1.8s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.tag {
  display: inline-block;
  padding: 2px 9px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.tag--lime { color: var(--lime); border-color: rgba(29, 78, 216, 0.35); }

/* 提示条 */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--surface-3);
  font-size: 14px;
  line-height: 1.6;
}

.alert--warn { border-color: rgba(180, 83, 9, 0.35); background: rgba(180, 83, 9, 0.07); }
.alert--warn strong { color: var(--amber); }
.alert--err { border-color: rgba(220, 38, 38, 0.32); background: rgba(220, 38, 38, 0.06); }
.alert--err strong { color: var(--red); }
.alert--info { border-color: rgba(13, 148, 136, 0.3); background: rgba(13, 148, 136, 0.06); }
.alert--info strong { color: var(--teal); }
.alert__icon { flex: none; font-size: 17px; line-height: 1.4; }

/* ============================================================
   商品网格与卡片
   ============================================================ */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 20px;
}

.pcard {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform 0.22s var(--ease), border-color 0.22s, box-shadow 0.22s;
}

.pcard:hover {
  transform: translateY(-4px);
  border-color: rgba(29, 78, 216, 0.35);
  box-shadow: var(--shadow);
}

.pcard__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface-3);
  overflow: hidden;
}

.pcard__media img {
  width: 100%;
  height: 100%;
  /* 完整显示整张图：方形外框内等比缩放，不做裁切 */
  object-fit: contain;
  display: block;
  transition: transform 0.5s var(--ease);
}

.pcard:hover .pcard__media img { transform: scale(1.05); }

.pcard__ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font-size: 13px;
  letter-spacing: 0.1em;
  background: repeating-linear-gradient(45deg, #f4f7fc, #f4f7fc 13px, #e9eff8 13px, #e9eff8 26px);
}

.pcard__state { position: absolute; top: 12px; left: 12px; }

.pcard__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  padding: 15px 16px 17px;
}

.pcard__title {
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.47;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pcard__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }

.pcard__tags { display: flex; flex-wrap: wrap; gap: 6px; }

.price { color: var(--lime); font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.price__unit { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.price__from { color: var(--ink-3); font-size: 12px; }

/* ============================================================
   进度条
   ============================================================ */

.progress {
  position: relative;
  height: 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #e9eef6;
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--lime-2), #3b82f6);
  transition: width 0.5s var(--ease);
}

.progress__fill.is-done { background: linear-gradient(90deg, var(--teal), #2dd4bf); }

.progress--lg { height: 12px; }

.progress__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.progress__meta b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ============================================================
   面板 / 卡片
   ============================================================ */

.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 22px;
}

.panel--tight { padding: 18px; }
.panel__title { font-size: 16px; font-weight: 700; }
.panel__desc { color: var(--ink-3); font-size: 13.5px; margin: 5px 0 0; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }

.stat {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--surface), var(--surface-3));
}

.stat__value {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--lime);
  font-variant-numeric: tabular-nums;
}

.stat__value--plain { color: var(--ink); }
.stat__label { margin-top: 2px; color: var(--ink-3); font-size: 13px; }

/* ============================================================
   表单
   ============================================================ */

.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }

.field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field > label .req { color: var(--lime); }

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 14.5px;
  transition: 0.18s;
}

.field input::placeholder,
.field textarea::placeholder { color: #a3aec0; }

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 3px var(--lime-soft);
}

.field textarea { resize: vertical; min-height: 88px; }
.field .hint { color: var(--ink-3); font-size: 12px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row--3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.form-error {
  padding: 10px 14px;
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: var(--r-sm);
  background: rgba(220, 38, 38, 0.06);
  color: var(--red);
  font-size: 13.5px;
}

.form-error:empty { display: none; }

.switch { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--lime); cursor: pointer; }

/* 登录页 */
.auth-wrap { display: grid; place-items: center; min-height: 100vh; padding: 40px 20px; }

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card h1 { font-size: 24px; font-weight: 800; }
.auth-card .lead { margin: 8px 0 22px; color: var(--ink-3); font-size: 14px; }

/* ============================================================
   表格
   ============================================================ */

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  overflow-x: auto;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th {
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-align: left;
  white-space: nowrap;
}

td { padding: 12px 15px; border-bottom: 1px solid var(--line); vertical-align: middle; }

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f6f8fc; }

td.actions { white-space: nowrap; }
td.actions > * + * { margin-left: 6px; }

.thumb {
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-3);
  overflow: hidden;
  display: grid;
  place-items: center;
}

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

/* ============================================================
   档位选择
   ============================================================ */

.tiers { display: flex; flex-direction: column; gap: 12px; }

.tier {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-3);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: 0.2s;
}

.tier:hover:not(:disabled) { border-color: var(--line-2); background: var(--surface-2); }
.tier.is-on { border-color: var(--lime); background: var(--surface-2); box-shadow: 0 0 0 3px var(--lime-soft); }
.tier:disabled { opacity: 0.5; cursor: not-allowed; }

.tier__radio {
  width: 20px;
  height: 20px;
  flex: none;
  border: 2px solid var(--line-2);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: 0.18s;
}

.tier.is-on .tier__radio { border-color: var(--lime); }
.tier.is-on .tier__radio::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lime);
}

.tier__body { display: block; flex: 1; min-width: 0; }

.tier__name { display: flex; align-items: center; gap: 9px; font-size: 15.5px; font-weight: 700; }
.tier__note { display: block; margin-top: 5px; color: var(--ink-3); font-size: 13px; }
.tier__note b { color: var(--lime); }
.tier__note .is-urgent { color: var(--amber); font-weight: 700; }

.tier__price { text-align: right; flex: none; }
.tier__price b { display: block; font-size: 24px; font-weight: 800; color: var(--lime); letter-spacing: -0.03em; }
.tier__price span { color: var(--ink-3); font-size: 12px; }

/* 档位进度（管理后台内联） */
.tier-mini { display: flex; flex-direction: column; gap: 4px; }
.tier-mini__row { display: flex; align-items: center; gap: 10px; }
.tier-mini__name { font-weight: 600; }
.tier-mini__bar { flex: 1; min-width: 80px; }

/* ============================================================
   商品详情
   ============================================================ */

.detail {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.detail__media {
  position: relative;
  display: grid;
  place-items: center;
  max-width: 380px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-3);
  overflow: hidden;
}

/* 完整显示整张图：不裁切，高度按原图比例自适应，过高的长图再加一个上限 */
.detail__media img {
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: contain;
  display: block;
}

.detail__media .pcard__ph { min-height: 260px; }
.detail__title { font-size: clamp(23px, 3vw, 31px); font-weight: 800; letter-spacing: -0.03em; }

.detail__desc {
  margin: 14px 0 0;
  color: var(--ink-2);
  font-size: 14.5px;
  white-space: pre-wrap;
  word-break: break-word;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  color: var(--ink-3);
  font-size: 13.5px;
  text-decoration: none;
}

.back-link:hover { color: var(--lime); }

/* 成团横幅 */
.banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(13, 148, 136, 0.32);
  background: linear-gradient(120deg, rgba(13, 148, 136, 0.1), rgba(13, 148, 136, 0.02));
}

.banner--done { animation: bannerIn 0.5s var(--ease); }

@keyframes bannerIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
}

.banner__icon {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.banner__title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--teal); }
.banner__sub { color: var(--ink-2); font-size: 14px; margin-top: 3px; }

.banner--open {
  border-color: rgba(29, 78, 216, 0.3);
  background: linear-gradient(120deg, rgba(29, 78, 216, 0.09), rgba(29, 78, 216, 0.02));
}

.banner--open .banner__icon { background: var(--lime); color: #fff; }
.banner--open .banner__title { color: var(--lime); }

/* ============================================================
   参与者
   ============================================================ */

.people { display: flex; flex-wrap: wrap; gap: 8px; }

.person {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface-3);
  font-size: 13px;
}

.person__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex: none;
}

.person--me { border-color: rgba(29, 78, 216, 0.4); background: var(--lime-soft); }
.person--empty { border-style: dashed; color: var(--ink-3); }

/* ============================================================
   空状态 / 骨架屏
   ============================================================ */

.empty {
  padding: 64px 24px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.empty__icon { font-size: 30px; margin-bottom: 12px; opacity: 0.5; }
.empty h3 { font-size: 17px; font-weight: 700; }
.empty p { margin: 8px auto 20px; max-width: 42ch; color: var(--ink-3); font-size: 14px; }

.skeleton {
  border-radius: 18px;
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.3s infinite linear;
}

@keyframes shimmer { to { background-position: -120% 0; } }
.skeleton--card { height: 336px; }

/* ============================================================
   弹窗
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 33, 68, 0.45);
  backdrop-filter: blur(7px);
  animation: fade 0.2s;
}

.modal[hidden] { display: none; }

@keyframes fade { from { opacity: 0; } }

.modal__box {
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  padding: 26px;
  border: 1px solid var(--line-2);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: pop 0.28s var(--ease);
}

.modal__box--wide { max-width: 540px; }

@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.97); } }

.modal__head { margin-bottom: 20px; }
.modal__head h3 { font-size: 19px; font-weight: 800; }
.modal__head p { margin: 6px 0 0; color: var(--ink-3); font-size: 13.5px; }
.modal__actions { display: flex; gap: 10px; margin-top: 22px; }
.modal__actions .btn { flex: 1; }

/* ============================================================
   支付
   ============================================================ */

.pay-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-3);
}

.pay-summary__amount { font-size: 27px; font-weight: 800; color: var(--lime); letter-spacing: -0.03em; }

.pay-qr {
  display: grid;
  place-items: center;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: #fff;
  width: 218px;
  height: 218px;
  margin: 0 auto;
}

.pay-qr img { width: 190px; height: 190px; display: block; }

.pay-qr__ph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #55606f;
  font-size: 13px;
  text-align: center;
  padding: 12px;
}

.pay-timer { font-variant-numeric: tabular-nums; font-weight: 700; }
.pay-timer.is-urgent { color: var(--amber); }

.pay-steps { display: flex; flex-direction: column; gap: 8px; color: var(--ink-3); font-size: 13px; }

/* 三列资料展示 */
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--line);
  overflow: hidden;
}

.info-grid__cell { padding: 13px 15px; background: var(--surface-3); }
.info-grid__cell dt { color: var(--ink-3); font-size: 12.5px; }
.info-grid__cell dd { margin: 4px 0 0; font-size: 14.5px; font-weight: 600; word-break: break-all; }

.order-result { display: grid; place-items: center; padding: 40px 20px; text-align: center; }

.order-result__icon {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 36px;
  margin-bottom: 20px;
}

.order-result__icon--ok { background: rgba(13, 148, 136, 0.12); color: var(--teal); border: 2px solid rgba(13, 148, 136, 0.45); }
.order-result__icon--wait { background: rgba(180, 83, 9, 0.1); color: var(--amber); border: 2px solid rgba(180, 83, 9, 0.4); }
.order-result__icon--bad { background: rgba(220, 38, 38, 0.09); color: var(--red); border: 2px solid rgba(220, 38, 38, 0.4); }

/* ============================================================
   提示条（浮层）
   ============================================================ */

#toasts {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 11px 20px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 14px 32px -14px rgba(15, 33, 68, 0.45);
  font-size: 14px;
  font-weight: 600;
  animation: toastIn 0.26s var(--ease);
}

.toast--ok { border-color: rgba(29, 78, 216, 0.4); color: var(--lime); }
.toast--err { border-color: rgba(220, 38, 38, 0.4); color: var(--red); }
.toast.is-out { animation: toastOut 0.25s forwards; }

@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ============================================================
   管理后台
   ============================================================ */

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tabs button {
  padding: 11px 17px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.18s;
}

.tabs button:hover { color: var(--ink); }
.tabs button.is-on { color: var(--lime); border-bottom-color: var(--lime); }
.tabpanel[hidden] { display: none; }

.dropzone {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
  background: var(--surface-3);
}

.dropzone__preview {
  width: 84px;
  height: 84px;
  flex: none;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  object-fit: cover;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font-size: 12px;
  overflow: hidden;
}

.dropzone__preview img { width: 100%; height: 100%; object-fit: cover; }

/* 档位编辑行 */
.tier-edit {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.8fr 0.8fr 1.1fr auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-3);
}

.tier-edit .field > label { font-size: 12px; }

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 1100px) {
  .detail { grid-template-columns: 1fr; gap: 22px; }
  .detail__media { max-width: 340px; }
  .tier-edit { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 980px) {
  .app { flex-direction: column; }

  .sidebar {
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    bottom: auto;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--nav-line);
    overflow-x: auto;
  }

  .brand { padding: 0; font-size: 15px; }
  .brand__mark { width: 26px; height: 26px; font-size: 15px; border-radius: 8px; }

  .sidenav { flex-direction: row; gap: 2px; }
  .sidenav__label { display: none; }
  .sidenav a { padding: 8px 12px; font-size: 13.5px; white-space: nowrap; gap: 7px; }
  .sidenav a svg { width: 16px; height: 16px; }
  .sidenav__count { display: none; }

  .sidebar__foot { margin: 0 0 0 auto; padding: 0; border: 0; flex: none; }
  .userchip { display: none; }

  .main { margin-left: 0; padding: 22px 16px 70px; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 13px; }
  .pcard__body { padding: 12px 12px 14px; gap: 9px; }
  .pcard__title { font-size: 14px; min-height: 41px; }
  .price { font-size: 19px; }

  .panel { padding: 17px; }
  .field-row, .field-row--3 { grid-template-columns: 1fr; }
  .tier-edit { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }

  .tier { padding: 14px; gap: 12px; }
  .tier__price b { font-size: 20px; }

  .pay-qr { width: 190px; height: 190px; }
  .pay-qr img { width: 162px; height: 162px; }

  .stat__value { font-size: 23px; }
  .page-head { gap: 14px; }
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html { scroll-behavior: auto; }
}
