:root {
  --primary: #6d28d9;
  --primary2: #2563eb;
  --grad: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
  --grad-soft: linear-gradient(135deg, #ede9fe 0%, #dbeafe 100%);
  --price: #f43f5e;
  --price-dark: #e11d48;
  --bg: #f5f4fb;
  --card: #ffffff;
  --text: #1f1b2e;
  --muted: #76738c;
  --border: #ececf3;
  --radius: 16px;
  --shadow: 0 6px 22px rgba(79, 70, 229, 0.08);
  --shadow-hover: 0 16px 38px rgba(79, 70, 229, 0.20);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(1200px 600px at 100% -10%, #e8e2ff 0%, rgba(232,226,255,0) 55%),
    radial-gradient(1000px 500px at -10% 0%, #dbeafe 0%, rgba(219,234,254,0) 50%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text); line-height: 1.6;
  padding-bottom: 92px;
}

a { color: inherit; text-decoration: none; }
::selection { background: #ddd6fe; }

/* 滚动条美化 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d6d3e8; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #bdb6df; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 20px; letter-spacing: .3px; }
.brand .logo {
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--grad); display: grid; place-items: center;
  color: #fff; font-size: 18px; box-shadow: 0 6px 16px rgba(124,58,237,.35);
}
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  color: var(--muted); font-size: 14px; padding: 7px 13px; border-radius: 10px;
  transition: all .18s;
}
.nav-links a:hover { color: var(--primary); background: #f3f0fe; }

/* ---------- 容器 / Hero ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 26px 24px 20px; }

.hero {
  position: relative; overflow: hidden;
  background: var(--grad);
  border-radius: 22px; padding: 30px 30px 26px; margin-bottom: 26px;
  color: #fff; box-shadow: 0 18px 40px rgba(124, 58, 237, .28);
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px;
  width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255,255,255,.16); filter: blur(4px);
}
.hero::before {
  content: ""; position: absolute; right: 90px; bottom: -90px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,.10);
}
.hero h1 { font-size: 30px; font-weight: 800; margin-bottom: 8px; position: relative; }
.hero p { font-size: 15px; opacity: .92; position: relative; max-width: 560px; }
.hero .pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; position: relative; }
.hero .pills span {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25);
  padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 600;
  backdrop-filter: blur(4px);
}

.page-sub { color: var(--muted); margin-bottom: 22px; }

/* ---------- 分类筛选 ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.chip {
  padding: 8px 17px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; color: var(--muted); cursor: pointer; font-size: 14px;
  transition: all .18s; box-shadow: 0 1px 2px rgba(17,24,39,.03);
}
.chip:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.chip.active {
  background: var(--grad); color: #fff; border-color: transparent;
  box-shadow: 0 6px 16px rgba(124,58,237,.32);
}

/* ---------- 商品网格 ---------- */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); }
.card {
  position: relative; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); border-color: #d9d2fb; }
.card .thumb {
  height: 156px; display: grid; place-items: center; color: #fff;
  font-size: 56px; background: var(--grad); position: relative;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb-ic { filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); transition: transform .25s; }
.card:hover .thumb-ic { transform: scale(1.12) rotate(-4deg); }

.badge-hot {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: linear-gradient(135deg, #fb7185, #ef4444); color: #fff;
  font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px;
  box-shadow: 0 4px 10px rgba(239,68,68,.4);
}
.fab {
  position: absolute; right: 14px; bottom: 14px; z-index: 3;
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: #fff; color: var(--primary); font-size: 26px; line-height: 1;
  display: grid; place-items: center;
  box-shadow: 0 8px 18px rgba(79,70,229,.28);
  transition: transform .15s, background .15s, color .15s;
}
.fab:hover { background: var(--grad); color: #fff; transform: scale(1.08); }
.fab:active { transform: scale(.92); }

.card .body { padding: 15px 16px 17px; display: flex; flex-direction: column; flex: 1; }
.card .cat {
  font-size: 12px; color: var(--primary); font-weight: 700; margin-bottom: 5px;
  display: inline-flex; align-items: center; gap: 5px;
}
.card .cat::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.card .name { font-size: 16px; font-weight: 700; }
.card .meta { font-size: 12px; color: var(--muted); margin: 3px 0 7px; }
.card .desc {
  font-size: 13px; color: var(--muted); flex: 1; margin-bottom: 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .row { display: flex; align-items: center; justify-content: space-between; }
.price { color: var(--price-dark); font-weight: 800; font-size: 21px; }
.price .cny { font-size: 13px; margin-right: 1px; }

/* 数量步进器 */
.stepper { display: flex; align-items: center; gap: 0; margin-top: 14px; }
.stepper button {
  width: 34px; height: 34px; border: 1px solid var(--border); background: #fff;
  border-radius: 10px; font-size: 19px; cursor: pointer; color: var(--primary);
  transition: all .15s;
}
.stepper button:hover { border-color: var(--primary); background: #f3f0fe; }
.stepper .q { min-width: 40px; text-align: center; font-weight: 700; }

/* ---------- 底部预约篮 ---------- */
.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 auto; max-width: 1120px;
  left: 50%; transform: translateX(-50%); width: calc(100% - 28px);
  padding: 13px 16px; background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: 0 -8px 30px rgba(17,24,39,.12); bottom: 14px;
}
.cartbar .info { font-size: 14px; color: var(--muted); }
.cartbar .info b { color: var(--price-dark); font-size: 19px; }
.cartbar .go {
  padding: 12px 28px; border: none; border-radius: 999px; background: var(--grad);
  color: #fff; font-weight: 700; cursor: pointer; box-shadow: 0 8px 20px rgba(124,58,237,.34);
  transition: transform .15s, box-shadow .15s;
}
.cartbar .go:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(124,58,237,.42); }
.cartbar .go:disabled { background: #cbd5e1; box-shadow: none; cursor: not-allowed; }

/* ---------- 抽屉 / 弹层 ---------- */
.drawer-mask { position: fixed; inset: 0; background: rgba(17,14,35,.5); backdrop-filter: blur(2px); display: none; z-index: 100; }
.drawer-mask.show { display: block; }
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: 430px; max-width: 94vw; background: #fff;
  z-index: 110; transform: translateX(100%); transition: transform .28s cubic-bezier(.22,.61,.36,1);
  display: flex; flex-direction: column; box-shadow: -16px 0 44px rgba(17,14,35,.2);
}
.drawer.show { transform: translateX(0); }
.drawer .d-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 22px; border-bottom: 1px solid var(--border);
  background: var(--grad); color: #fff;
}
.drawer .d-head h3 { font-size: 18px; font-weight: 700; }
.drawer .d-close { background: rgba(255,255,255,.2); border: none; width: 32px; height: 32px; border-radius: 9px; font-size: 20px; cursor: pointer; color: #fff; line-height: 1; }
.drawer .d-close:hover { background: rgba(255,255,255,.32); }
.drawer .d-body { flex: 1; overflow: auto; padding: 18px 22px; }
.drawer .d-foot { padding: 16px 22px; border-top: 1px solid var(--border); background: #faf9ff; }

.li { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.li .ln { font-weight: 700; }
.li .lp { color: var(--muted); font-size: 13px; margin-top: 2px; }
.li .price { font-size: 15px; }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
.field label .req { color: var(--price); margin-left: 2px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 11px;
  font-size: 14px; font-family: inherit; background: #fff; transition: all .15s; color: var(--text);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,.15); background: #fcfbff;
}
.field textarea { resize: vertical; min-height: 58px; }

.row2 { display: flex; gap: 12px; }
.row2 > div { flex: 1; }

.big-btn {
  width: 100%; padding: 14px; border: none; border-radius: 13px; background: var(--grad);
  color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 24px rgba(124,58,237,.32); transition: transform .15s, box-shadow .15s;
}
.big-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(124,58,237,.42); }
.big-btn:disabled { background: #c4bddd; box-shadow: none; cursor: not-allowed; transform: none; }
.big-btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); box-shadow: none; }
.big-btn.ghost:hover { background: #f3f0fe; }
.total-line { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; font-size: 15px; color: var(--muted); }
.total-line .amount { color: var(--price-dark); font-weight: 800; font-size: 22px; }

.empty { text-align: center; color: var(--muted); padding: 48px 0; font-size: 14px; }

/* ---------- 成功页 ---------- */
.success { text-align: center; padding: 64px 20px; animation: fadeUp .5s ease; }
.success .tick {
  width: 76px; height: 76px; border-radius: 50%; background: linear-gradient(135deg,#22c55e,#16a34a);
  color: #fff; display: grid; place-items: center; font-size: 40px; margin: 0 auto 20px;
  box-shadow: 0 12px 28px rgba(22,163,74,.35); animation: pop .45s cubic-bezier(.2,1.4,.5,1);
}
.success h2 { margin-bottom: 8px; font-size: 24px; }
.success p { color: var(--muted); margin-bottom: 6px; }
.success .box {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; margin: 20px auto; max-width: 380px; text-align: left; font-size: 14px; box-shadow: var(--shadow);
}
.success .box .r { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.success .box .r:last-child { border-bottom: none; }

/* ---------- 状态标签 ---------- */
.tag { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.tag.pending_pay { background: #fef3c7; color: #b45309; }
.tag.paid { background: #dbeafe; color: #1d4ed8; }
.tag.serving { background: #dcfce7; color: #15803d; }
.tag.done { background: #e9e7f5; color: #6d28d9; }
.tag.cancelled { background: #fee2e2; color: #b91c1c; }

/* ---------- 后台 ---------- */
.admin-wrap { max-width: 1000px; margin: 0 auto; padding: 30px 24px 60px; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.admin-toolbar h1 { font-size: 22px; font-weight: 800; }
.btn-primary {
  padding: 10px 18px; border: none; border-radius: 11px; background: var(--grad);
  color: #fff; font-weight: 700; cursor: pointer; box-shadow: 0 6px 16px rgba(124,58,237,.28); transition: transform .15s, box-shadow .15s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(124,58,237,.38); }
.btn-ghost {
  padding: 9px 15px; border: 1px solid var(--border); border-radius: 11px; background: #fff;
  cursor: pointer; color: var(--muted); font-weight: 600; transition: all .15s;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: #f3f0fe; }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  padding: 9px 18px; border-radius: 11px; border: 1px solid var(--border); background: #fff;
  cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); transition: all .15s;
}
.tab:hover { border-color: var(--primary); color: var(--primary); }
.tab.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(124,58,237,.28); }

.login-mask { position: fixed; inset: 0; background: rgba(17,14,35,.58); backdrop-filter: blur(3px); display: none; place-items: center; z-index: 100; }
.login-mask.show { display: grid; }
.login-box {
  background: #fff; border-radius: 20px; padding: 0 0 30px; width: 340px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(17,14,35,.3);
}
.login-box .lb-head { background: var(--grad); color: #fff; padding: 26px 30px 22px; text-align: center; }
.login-box .lb-head .lg { width: 50px; height: 50px; border-radius: 14px; background: rgba(255,255,255,.2); display: inline-grid; place-items: center; font-size: 26px; margin-bottom: 12px; }
.login-box .lb-head h2 { font-size: 20px; margin-bottom: 4px; }
.login-box .lb-head p { font-size: 12px; opacity: .85; }
.login-box .lb-body { padding: 24px 30px 0; }
.login-box input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 11px;
  margin-bottom: 14px; font-size: 15px; transition: all .15s;
}
.login-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,.15); }
.login-box button {
  width: 100%; padding: 12px; border: none; border-radius: 11px; background: var(--grad);
  color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; box-shadow: 0 8px 20px rgba(124,58,237,.3); transition: transform .15s;
}
.login-box button:hover { transform: translateY(-1px); }
.login-err { color: var(--price); font-size: 13px; margin-bottom: 10px; min-height: 16px; }

table.admin-table {
  width: 100%; border-collapse: separate; border-spacing: 0; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.admin-table th, .admin-table td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.admin-table th { background: #f7f6fd; color: var(--muted); font-weight: 700; }
.admin-table tbody tr { transition: background .15s; }
.admin-table tbody tr:hover { background: #faf9ff; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.act-btn { border: none; background: none; cursor: pointer; font-size: 13px; margin-right: 8px; padding: 5px 10px; border-radius: 8px; transition: background .15s; }
.act-edit { color: var(--primary); }
.act-edit:hover { background: #f3f0fe; }
.act-del { color: var(--price); }
.act-del:hover { background: #fdeef1; }
.act-ok { color: #16a34a; }
.act-ok:hover { background: #effaf3; }

.modal-mask { position: fixed; inset: 0; background: rgba(17,14,35,.5); backdrop-filter: blur(2px); display: none; place-items: center; z-index: 110; }
.modal-mask.show { display: grid; }
.modal {
  background: #fff; border-radius: 18px; padding: 24px; width: 480px; max-width: 92vw;
  box-shadow: 0 24px 60px rgba(17,14,35,.3); max-height: 90vh; overflow: auto;
}
.modal h3 {
  font-size: 18px; font-weight: 700; margin: -24px -24px 18px; padding: 18px 24px;
  background: var(--grad); color: #fff; border-radius: 18px 18px 0 0;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }

.toast {
  position: fixed; bottom: 34px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: #1f1b2e; color: #fff; padding: 12px 22px; border-radius: 12px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 200;
  box-shadow: 0 12px 30px rgba(17,14,35,.4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 后台陪玩评价星级 */
.stars-cell { color: #f59e0b; letter-spacing: 1px; font-size: 13px; white-space: nowrap; }

/* 后台投诉反馈 */
.fb-badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  border-radius: 999px; font-size: 11px; font-weight: 800;
  background: #ef4444; color: #fff; vertical-align: middle;
  box-shadow: 0 2px 6px rgba(239, 68, 68, .45);
}
.fb-filter { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.fb-hint { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.fb-type-tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: #ede9fe; color: #6d28d9;
}
.fb-content-cell { max-width: 320px; color: #4b5563; }
.fb-row-new { background: #fffbf5 !important; }
.fb-row-new:hover { background: #fff7ea !important; }

/* ---------- 动画 ---------- */
@keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 移动端适配 ---------- */
@media (max-width: 640px) {
  .topbar { padding: 12px 14px; }
  .brand { font-size: 17px; }
  .brand .logo { width: 32px; height: 32px; font-size: 16px; }
  .container { padding: 18px 14px 16px; }
  .hero { padding: 22px 18px 20px; border-radius: 18px; margin-bottom: 20px; }
  .hero h1 { font-size: 23px; }
  .hero p { font-size: 13px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 13px; }
  .card .thumb { height: 120px; font-size: 42px; }
  .card .name { font-size: 15px; }
  .price { font-size: 18px; }
  .fab { width: 42px; height: 42px; font-size: 23px; }
  .drawer { width: 100%; }
  .modal { width: 94vw; }
  .modal .m-head { padding: 16px 18px; }
  .modal .m-body { padding: 18px; }
  .login-box { width: 90vw; }
  .admin-wrap { padding: 18px 14px 50px; }
  .cartbar { padding: 11px 13px; bottom: 10px; }
  .cartbar .go { padding: 11px 22px; }
  .admin-table th, .admin-table td { padding: 10px 8px; font-size: 13px; }
  .nav-links a { font-size: 13px; padding: 6px 10px; }
}
