/* ==========================================================================
   星卡铺 App · PWA 移动端样式
   ========================================================================== */

:root {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #eceef5;
  --brand: #5b5bd6;
  --brand-2: #8b5cf6;
  --brand-soft: #eef0ff;
  --success: #0f9f6e;
  --success-soft: #e8f8f1;
  --danger: #d92d20;
  --warn: #b54708;
  --warn-soft: #fdf6e7;
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

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

[hidden] {
  display: none !important;
}

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

body.app-body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(800px 500px at 80% 0%, rgba(139, 92, 246, 0.28), transparent 60%),
    radial-gradient(700px 500px at 10% 100%, rgba(91, 91, 214, 0.22), transparent 60%),
    #0b0d1a;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

code {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.device-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.device {
  position: relative;
  width: 420px;
  height: min(860px, calc(100vh - 70px));
  background: var(--bg);
  border: 9px solid #0b0d18;
  border-radius: 48px;
  overflow: hidden;
  box-shadow:
    0 50px 100px -30px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
}

.app-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 86px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.app-scroll::-webkit-scrollbar {
  display: none;
}

.tab-view {
  display: none;
  padding: 0 16px;
}

.tab-view.active {
  display: block;
}

/* ---------------- 顶部 & 搜索 ---------------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -16px;
  padding: 16px 16px 10px;
  background: rgba(245, 246, 251, 0.92);
  backdrop-filter: blur(14px);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 8px 18px -8px rgba(91, 91, 214, 0.9);
}

.app-brand-text {
  min-width: 0;
}

.app-brand-text strong {
  display: block;
  font-size: 16.5px;
  line-height: 1.2;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-brand-text small {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid #e3e6f2;
  background: #fff;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.avatar-btn:active {
  transform: scale(0.96);
}

.app-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 12px;
  height: 42px;
  margin-top: 4px;
  box-shadow: 0 4px 14px -10px rgba(16, 24, 40, 0.2);
}

.app-search svg {
  width: 16px;
  height: 16px;
  color: #98a2b3;
  flex-shrink: 0;
}

.app-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 13px;
  height: 100%;
}

.app-search input::placeholder {
  color: #98a2b3;
}

.search-clear {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: #eef0f6;
  color: #667085;
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.notice-strip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 11px;
  background: #fff8ec;
  border: 1px solid #f8e7c8;
  color: #93540a;
  font-size: 11px;
  line-height: 1.55;
}

.notice-dot {
  width: 6px;
  height: 6px;
  margin-top: 5px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #f59e0b;
}

/* ---------------- 首页 Hero ---------------- */

.app-hero {
  position: relative;
  overflow: hidden;
  margin-top: 14px;
  padding: 18px 18px 14px;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(120% 140% at 90% 0%, rgba(255, 255, 255, 0.28), transparent 42%),
    linear-gradient(140deg, #4f46e5 0%, #7c3aed 55%, #a855f7 100%);
  box-shadow: 0 20px 40px -24px rgba(79, 70, 229, 0.9);
  isolation: isolate;
}

.app-hero::before {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  top: -70px;
  right: -40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: 66%;
}

.hero-tag {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.hero-copy h1 {
  margin: 10px 0 7px;
  font-size: 26px;
  line-height: 1.28;
  letter-spacing: -0.3px;
  font-weight: 800;
}

.hero-copy p {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
}

.hero-ticket {
  position: absolute;
  z-index: 1;
  top: 20px;
  right: 14px;
  width: 102px;
  height: 96px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(4px);
  transform: rotate(6deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 16px 30px -20px rgba(0, 0, 0, 0.55);
}

.ht-emoji {
  font-size: 24px;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.2));
}

.ht-code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 8.5px;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.92);
}

.ht-label {
  font-size: 8.5px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.62);
}

.hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 18px;
  padding: 9px 6px;
  border-radius: 13px;
  background: rgba(17, 12, 54, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(3px);
}

.hero-stats div {
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-stats div:last-child {
  border-right: 0;
}

.hero-stats b {
  display: block;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.hero-stats span {
  display: block;
  margin-top: 1px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.66);
}

/* ---------------- 分类 & 商品 ---------------- */

.cat-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 0 6px;
  scrollbar-width: none;
}

.cat-scroll::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  flex: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  color: var(--muted);
  transition: all 0.16s ease;
}

.cat-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 600;
}

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

.list-head h2 {
  font-size: 17px;
  letter-spacing: -0.2px;
}

.list-head span {
  font-size: 10.5px;
  color: var(--muted);
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.p-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 18px -16px rgba(16, 24, 40, 0.28);
}

.p-cover {
  position: relative;
  height: 106px;
  width: 100%;
  border: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  padding: 0;
}

.p-cover::before {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  top: -52px;
  right: -34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}

.p-cover::after {
  content: "";
  position: absolute;
  width: 70px;
  height: 70px;
  bottom: -38px;
  left: -16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.p-emoji {
  font-size: 40px;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.2));
  transition: transform 0.2s ease;
}

.p-card:active .p-emoji {
  transform: scale(1.06);
}

.p-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 700;
  color: #fff;
  background: rgba(17, 24, 39, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(3px);
}

.p-stock {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 600;
  color: #374151;
  background: rgba(255, 255, 255, 0.92);
}

.p-stock.low {
  color: #b54708;
  background: rgba(255, 247, 237, 0.96);
}

.p-body {
  padding: 9px 11px 11px;
}

.p-body h3 {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
  height: 2.8em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.p-sub {
  margin-top: 2px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
}

.p-price {
  color: var(--danger);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.4px;
  white-space: nowrap;
}

.p-price small {
  font-size: 10px;
  font-weight: 700;
  margin-right: 1px;
}

.p-price s {
  margin-left: 3px;
  font-size: 9px;
  color: #98a2b3;
  font-weight: 400;
  letter-spacing: 0;
}

.p-buy {
  border: 0;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 12px -8px rgba(91, 91, 214, 0.9);
  flex-shrink: 0;
}

.p-buy:disabled {
  background: #e5e7ef;
  color: #98a2b3;
  box-shadow: none;
}

.p-skeleton {
  height: 194px;
  border-radius: 16px;
  background: linear-gradient(100deg, #eceef6 30%, #f7f8fc 48%, #eceef6 66%);
  background-size: 240% 100%;
  animation: shimmer 1.3s infinite linear;
}

@keyframes shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

.app-empty {
  padding: 34px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  background: #fff;
  border: 1px dashed #dfe2ee;
  border-radius: 16px;
}

.empty-icon {
  font-size: 30px;
  margin-bottom: 8px;
}

.text-btn {
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  padding: 8px;
}

.home-note {
  margin: 22px 0 8px;
  text-align: center;
  font-size: 9.5px;
  color: #98a2b3;
  letter-spacing: 0.3px;
}

/* ---------------- 订单 ---------------- */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 0 14px;
}

.page-head h1 {
  font-size: 23px;
  letter-spacing: -0.4px;
}

.page-head p {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
}

.round-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: var(--ink);
}

.round-btn:active {
  background: #f1f3f9;
}

.query-entry {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  text-align: left;
}

.query-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--brand-soft);
  font-size: 15px;
}

.query-text {
  flex: 1;
  min-width: 0;
}

.query-text b {
  display: block;
  font-size: 12.5px;
}

.query-text small {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  color: var(--muted);
}

.chev {
  color: #98a2b3;
  font-size: 18px;
  line-height: 1;
}

.orders-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.order-card {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 13px 14px;
}

.order-card:active {
  background: #fafbff;
}

.order-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.order-no {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.7;
  background: #f0f2f7;
  color: #667085;
  white-space: nowrap;
}

.pill-success {
  background: var(--success-soft);
  color: var(--success);
}

.pill-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.pill-gray {
  background: #f0f2f7;
  color: #667085;
}

.order-mid {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.order-thumb {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: 20px;
}

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

.order-info h3 {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-info p {
  margin-top: 2px;
  font-size: 10px;
  color: var(--muted);
}

.order-amount {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  flex-shrink: 0;
}

.orders-empty {
  margin-top: 16px;
  background: #fff;
  border: 1px dashed #dfe2ee;
  border-radius: 16px;
  padding: 34px 20px;
  text-align: center;
}

.orders-empty .empty-icon {
  font-size: 32px;
}

.orders-empty h3 {
  font-size: 14px;
  margin-bottom: 4px;
}

.orders-empty p {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 14px;
}

.orders-empty .app-btn {
  width: auto;
  display: inline-flex;
  padding: 0 22px;
  height: 40px;
}

/* ---------------- 我的 ---------------- */

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  color: #fff;
  background:
    radial-gradient(120% 120% at 90% 0%, rgba(255, 255, 255, 0.26), transparent 45%),
    linear-gradient(135deg, #5b5bd6, #8b5cf6 70%, #a855f7);
  box-shadow: 0 18px 36px -24px rgba(91, 91, 214, 0.9);
}

.profile-avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.profile-info {
  min-width: 0;
}

.profile-info strong {
  display: block;
  font-size: 16px;
  margin-bottom: 3px;
}

.profile-info p {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-group {
  margin-top: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 14px 15px;
  border: 0;
  border-bottom: 1px solid #f2f3f8;
  background: #fff;
  text-align: left;
}

.menu-item:last-child {
  border-bottom: 0;
}

.menu-item:active {
  background: #fafbff;
}

.menu-ico {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #f5f6fb;
  font-size: 14px;
}

.menu-item b {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}

.menu-item i {
  font-style: normal;
  color: #98a2b3;
  font-size: 16px;
}

.menu-item.danger b {
  color: var(--danger);
}

.version {
  margin: 24px 0 12px;
  text-align: center;
  font-size: 10px;
  color: #98a2b3;
}

/* ---------------- 底部导航 ---------------- */

.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  height: calc(62px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}

.tab-item {
  position: relative;
  border: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #98a2b3;
  font-size: 10px;
  padding: 0;
  transition: color 0.16s ease;
}

.tab-item svg {
  width: 22px;
  height: 22px;
}

.tab-item.active {
  color: var(--brand);
  font-weight: 600;
}

.tab-item.active::before {
  content: "";
  position: absolute;
  top: 7px;
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

/* ---------------- 全屏页面层 ---------------- */

.layer-root {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.layer {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.22, 0.9, 0.32, 1);
  will-change: transform;
}

.layer.in {
  transform: translateY(0);
}

.layer-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(245, 246, 251, 0.94);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 2;
}

.layer-head .round-btn {
  background: #fff;
}

.layer-title {
  font-size: 14px;
  font-weight: 600;
}

.layer-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 2px 16px 24px;
  scrollbar-width: none;
}

.layer-scroll::-webkit-scrollbar {
  display: none;
}

.layer-foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px calc(13px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.foot-price {
  flex-shrink: 0;
  line-height: 1.1;
}

.foot-price small {
  display: block;
  font-size: 9.5px;
  color: var(--muted);
  margin-bottom: 3px;
}

.foot-price b {
  font-size: 21px;
  color: var(--danger);
  letter-spacing: -0.5px;
}

.app-btn {
  flex: 1;
  height: 44px;
  border: 0;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 12px 24px -14px rgba(91, 91, 214, 0.95);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.app-btn:active:not(:disabled) {
  transform: scale(0.985);
}

.app-btn:disabled {
  opacity: 0.5;
  box-shadow: none;
}

.app-btn.ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: none;
}

.app-btn.soft {
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: none;
}

/* 块级容器中的按钮需要主动撑满宽度 */
.sheet-scroll .app-btn,
.success-scroll .app-btn,
.detail-card .app-btn {
  width: 100%;
  flex: none;
}

/* ---------------- 商品详情 ---------------- */

.detail-cover {
  position: relative;
  height: 236px;
  margin-top: 2px;
  border-radius: 22px;
  overflow: hidden;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.detail-cover::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  top: -100px;
  right: -60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.detail-cover::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  bottom: -60px;
  left: -30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.detail-emoji {
  font-size: 84px;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.22));
}

.detail-stock {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.93);
  color: #374151;
  font-size: 10px;
  font-weight: 600;
}

.detail-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  backdrop-filter: blur(3px);
}

.detail-body {
  padding: 16px 2px 0;
}

.detail-cat {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.4px;
}

.detail-body h1 {
  margin: 4px 0 4px;
  font-size: 21px;
  line-height: 1.35;
  letter-spacing: -0.3px;
}

.detail-sub {
  font-size: 12px;
  color: var(--muted);
}

.detail-price {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 13px;
  color: var(--danger);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.8px;
}

.detail-price small {
  font-size: 15px;
  font-weight: 700;
}

.detail-price s {
  font-size: 11px;
  color: #98a2b3;
  font-weight: 400;
  letter-spacing: 0;
}

.save-pill {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 700;
  color: #b42318;
  background: #fee4e2;
  border-radius: 999px;
  padding: 3px 8px;
  letter-spacing: 0;
}

.detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #e6e8f1;
  font-size: 10.5px;
  color: var(--muted);
}

.detail-card {
  margin-top: 12px;
  padding: 15px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
}

.detail-card h2 {
  font-size: 13px;
  margin-bottom: 8px;
}

.detail-card p {
  white-space: pre-line;
  font-size: 12px;
  line-height: 1.9;
  color: #475467;
}

.detail-tip {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: #4b4a9e;
  font-size: 10.5px;
  line-height: 1.7;
}

/* ---------------- 底部弹层 ---------------- */

.sheet-wrap {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: auto;
}

.sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(9, 11, 25, 0.5);
  opacity: 0;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(2px);
}

.sheet {
  position: relative;
  background: #fff;
  border-radius: 24px 24px 0 0;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.22, 0.9, 0.32, 1);
  box-shadow: 0 -20px 50px -30px rgba(0, 0, 0, 0.45);
}

.sheet-wrap.in .sheet-mask {
  opacity: 1;
}

.sheet-wrap.in .sheet {
  transform: translateY(0);
}

.sheet-grab {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: #e4e6ef;
  margin: 9px auto 0;
  flex-shrink: 0;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 18px 8px;
  flex-shrink: 0;
}

.sheet-head h3 {
  font-size: 16px;
  letter-spacing: -0.2px;
}

.sheet-head .round-btn {
  width: 30px;
  height: 30px;
  font-size: 15px;
  border: 0;
  background: #f2f4f9;
}

.sheet-scroll {
  padding: 4px 18px 12px;
  overflow-y: auto;
  scrollbar-width: none;
}

.sheet-scroll::-webkit-scrollbar {
  display: none;
}

.sheet-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
}

.checkout-total small {
  display: block;
  font-size: 9.5px;
  color: var(--muted);
  margin-bottom: 2px;
}

.checkout-total b {
  font-size: 21px;
  color: var(--danger);
  letter-spacing: -0.5px;
}

.checkout-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border-radius: 14px;
  background: #f8f9fc;
  margin-bottom: 16px;
}

.checkout-thumb {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 22px;
}

.checkout-item h4 {
  font-size: 12.5px;
  font-weight: 600;
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.checkout-item p {
  font-size: 10px;
  color: var(--muted);
}

.checkout-price {
  margin-left: auto;
  font-size: 13px;
  font-weight: 800;
  color: var(--danger);
  flex-shrink: 0;
}

.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 12.5px;
  font-weight: 600;
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dfe2ee;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.stepper button {
  width: 32px;
  height: 32px;
  border: 0;
  background: #f8f9fc;
  font-size: 16px;
  color: #475467;
  display: grid;
  place-items: center;
}

.stepper button:disabled {
  color: #c3c7d6;
}

.stepper input {
  width: 38px;
  height: 32px;
  border: 0;
  border-inline: 1px solid #dfe2ee;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  outline: none;
}

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

.app-field > span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 7px;
}

.app-input {
  width: 100%;
  border: 1px solid #dfe2ee;
  border-radius: 11px;
  background: #fff;
  padding: 11px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.app-input:focus {
  border-color: #b3b6f2;
  box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.12);
}

.pay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}

.pay-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid #dfe2ee;
  border-radius: 11px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.pay-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pay-chip .mark {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #1677ff;
  font-size: 10.5px;
  font-weight: 700;
}

.pay-chip[data-method="wxpay"] .mark {
  background: #07c160;
}

.pay-chip[data-method="qqpay"] .mark {
  background: #12b7f5;
}

.pay-chip:has(input:checked) {
  border-color: var(--brand);
  background: #f6f6ff;
  box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.1);
}

.sheet-hint {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.7;
  margin: 10px 0 0;
}

/* ---------------- 支付中 ---------------- */

.processing {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: rgba(245, 246, 251, 0.94);
  backdrop-filter: blur(7px);
  pointer-events: auto;
}

.processing .spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #e6e8f5;
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
  margin-bottom: 4px;
}

.processing strong {
  font-size: 14.5px;
}

.processing span {
  font-size: 11.5px;
  color: var(--muted);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------------- 支付成功 ---------------- */

.success-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 40px 20px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
  scrollbar-width: none;
}

.success-scroll::-webkit-scrollbar {
  display: none;
}

.success-icon {
  width: 66px;
  height: 66px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--success-soft);
  color: var(--success);
  font-size: 32px;
  animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}

.success-scroll h1 {
  font-size: 21px;
  letter-spacing: -0.3px;
}

.success-scroll > p {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.success-amount {
  margin: 14px 0 6px;
  font-size: 30px;
  font-weight: 800;
  color: var(--danger);
  letter-spacing: -1px;
}

.success-amount small {
  font-size: 14px;
  margin-right: 1px;
}

.card-list {
  display: grid;
  gap: 8px;
  margin: 18px 0 12px;
}

.card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8f9fc;
  border: 1px solid #e9ebf3;
  border-radius: 11px;
  padding: 11px 12px;
}

.card-row code {
  flex: 1;
  text-align: left;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  word-break: break-all;
  color: #1d2939;
}

.copy-btn {
  flex-shrink: 0;
  border: 1px solid #dfe2ee;
  background: #fff;
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 10.5px;
  color: #475467;
}

.copy-btn:active {
  background: #f1f3f9;
}

.success-actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.success-actions .app-btn {
  flex: none;
  width: 100%;
}

.success-note {
  margin-top: 14px;
  font-size: 10px;
  color: #98a2b3;
  line-height: 1.7;
}

/* ---------------- 订单详情 ---------------- */

.order-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0 14px;
}

.order-detail-head .order-no {
  font-size: 11px;
}

.detail-list {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.detail-list > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  font-size: 12px;
  border-bottom: 1px dashed #f0f1f7;
}

.detail-list > div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--muted);
  flex-shrink: 0;
}

.detail-list dd {
  margin: 0;
  text-align: right;
  word-break: break-all;
}

.detail-list dd.amount {
  color: var(--danger);
  font-weight: 800;
  font-size: 15px;
}

.detail-cards {
  display: grid;
  gap: 7px;
}

.detail-cards .none {
  padding: 14px;
  border-radius: 11px;
  background: #f8f9fc;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

.order-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.order-actions .app-btn {
  width: 100%;
  flex: none;
}

/* ---------------- 我的-弹层内容 ---------------- */

.plain-sheet h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.plain-sheet .sheet-lead {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.7;
}

.info-block {
  padding: 14px;
  border-radius: 13px;
  background: #f8f9fc;
  border: 1px solid #eef0f7;
  font-size: 12px;
  line-height: 1.9;
  color: #475467;
  white-space: pre-line;
}

.menu-sheet p {
  font-size: 12.5px;
  line-height: 1.9;
  color: #475467;
}

/* ---------------- Toast ---------------- */

.toast-host {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  pointer-events: none;
}

.toast {
  max-width: 100%;
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.93);
  color: #fff;
  font-size: 11.5px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 12px 26px -16px rgba(0, 0, 0, 0.6);
  animation: toast-in 0.2s ease;
}

.toast.success {
  background: #067a55;
}

.toast.error {
  background: #b42318;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ---------------- 启动页 ---------------- */

.splash {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #fff;
  background:
    radial-gradient(120% 100% at 85% 0%, rgba(255, 255, 255, 0.22), transparent 45%),
    linear-gradient(155deg, #4f46e5, #7c3aed 58%, #a855f7);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.splash.done {
  opacity: 0;
  visibility: hidden;
}

.splash-mark {
  width: 76px;
  height: 76px;
  margin-bottom: 8px;
  border-radius: 23px;
  display: grid;
  place-items: center;
  font-size: 36px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.6);
}

.splash strong {
  font-size: 20px;
  letter-spacing: 3px;
}

.splash > span {
  font-size: 10.5px;
  letter-spacing: 2.5px;
  color: rgba(255, 255, 255, 0.74);
}

.splash-loader {
  width: 110px;
  height: 3px;
  margin-top: 22px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.splash-loader i {
  display: block;
  width: 36%;
  height: 100%;
  border-radius: 2px;
  background: #fff;
  animation: load 1s ease-in-out infinite;
}

@keyframes load {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(330%);
  }
}

/* ---------------- 主题渐变 ---------------- */

.theme-violet {
  background: linear-gradient(135deg, #6d28d9, #a78bfa);
}

.theme-ocean {
  background: linear-gradient(135deg, #0369a1, #22d3ee);
}

.theme-sunset {
  background: linear-gradient(135deg, #ea580c, #fb7185);
}

.theme-forest {
  background: linear-gradient(135deg, #047857, #6ee7b7);
}

.theme-midnight {
  background: linear-gradient(135deg, #0f172a, #475569);
}

.theme-candy {
  background: linear-gradient(135deg, #be185d, #f9a8d4);
}

/* ---------------- 手机全屏适配 ---------------- */

@media (max-width: 640px) {
  body.app-body {
    display: block;
    place-items: initial;
    background: var(--bg);
  }

  .device-wrap {
    display: block;
    width: 100%;
    height: 100%;
    gap: 0;
  }

  .device {
    width: 100%;
    max-width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .app-scroll {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }

  .app-header {
    padding-top: calc(14px + env(safe-area-inset-top));
  }

  .page-head {
    padding-top: calc(20px + env(safe-area-inset-top));
  }

  .layer-head {
    padding-top: calc(12px + env(safe-area-inset-top));
  }

  .preview-hint {
    display: none;
  }
}

@media (max-height: 720px) and (min-width: 641px) {
  .device {
    height: calc(100vh - 40px);
  }

  .preview-hint {
    display: none;
  }
}

.preview-hint {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.44);
  letter-spacing: 0.3px;
  margin: 0;
}

.preview-hint code {
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 5px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
