/* ============================================================
   方块集市 BLOCKMART — 蓝紫磨砂玻璃 · Minecraft 物品商城
   ============================================================ */

:root {
  --bg: #05060f;
  --ink: #edf0ff;
  --muted: rgba(237, 240, 255, 0.64);
  --faint: rgba(237, 240, 255, 0.4);
  --indigo: #6c5cff;
  --violet: #a06bff;
  --cyan: #4fd6ff;
  --pink: #ff6bd6;
  --gold: #ffc766;
  --green: #5ee0a0;
  --red: #ff7d92;
  --stroke: rgba(160, 175, 255, 0.18);
  --stroke-strong: rgba(180, 195, 255, 0.34);
  --glass: linear-gradient(160deg, rgba(140, 150, 255, 0.12), rgba(90, 100, 200, 0.04) 55%, rgba(120, 140, 255, 0.08));
  --glass-soft: linear-gradient(160deg, rgba(140, 150, 255, 0.08), rgba(90, 100, 200, 0.03));
  --shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  --radius: 22px;
  --radius-sm: 14px;
  --font: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --pixel: "Press Start 2P", "Courier New", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

:focus-visible { outline: 2px solid rgba(124, 108, 255, 0.9); outline-offset: 3px; border-radius: 8px; }
::selection { background: rgba(108, 92, 255, 0.5); }

/* ---------------- 背景 ---------------- */

.bgeffect { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }

.orb { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.55; will-change: transform; }

.orb-a { width: 640px; height: 640px; left: -200px; top: -180px; background: radial-gradient(circle at 35% 35%, #6c5cff, transparent 66%); animation: drift-a 26s ease-in-out infinite alternate; }
.orb-b { width: 560px; height: 560px; right: -160px; top: 8%; background: radial-gradient(circle at 55% 45%, #3b9dff, transparent 66%); opacity: 0.4; animation: drift-b 32s ease-in-out infinite alternate; }
.orb-c { width: 720px; height: 720px; left: 30%; bottom: -420px; background: radial-gradient(circle at 50% 50%, #a06bff, transparent 68%); opacity: 0.3; animation: drift-c 38s ease-in-out infinite alternate; }

@keyframes drift-a { to { transform: translate3d(80px, 90px, 0) scale(1.1); } }
@keyframes drift-b { to { transform: translate3d(-70px, 120px, 0) scale(1.08); } }
@keyframes drift-c { to { transform: translate3d(60px, -90px, 0) scale(1.12); } }

.gridlines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(140, 150, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 150, 255, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 72%);
}

.noise {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#app { position: relative; z-index: 1; }

/* ---------------- 基础 ---------------- */

.container { width: min(1220px, 100% - 48px); margin-inline: auto; }

.glass {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.35), transparent 40%, rgba(124, 108, 255, 0.25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.muted { color: var(--muted); }
.faint { color: var(--faint); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(180, 195, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-weight: 650;
  font-size: 14.5px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
  user-select: none;
}

.btn:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--stroke-strong); }
.btn:active { transform: translateY(1px) scale(0.995); }

.btn-primary {
  color: #070a18;
  border: 0;
  background: linear-gradient(115deg, #b7aeff 0%, #7c6cff 40%, #4fd6ff 100%);
  box-shadow: 0 18px 40px -16px rgba(108, 92, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 24px 50px -18px rgba(108, 92, 255, 1), inset 0 1px 0 rgba(255, 255, 255, 0.7); }

.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-danger { background: rgba(255, 125, 146, 0.12); border-color: rgba(255, 125, 146, 0.35); color: #ffb3c0; }
.btn-danger:hover { background: rgba(255, 125, 146, 0.22); }

.btn-ghost { background: rgba(255, 255, 255, 0.04); backdrop-filter: blur(12px); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
.icon-btn svg { width: 19px; height: 19px; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted);
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
}

.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }

.pixel-label { font-family: var(--pixel); font-size: 9px; letter-spacing: 1px; color: var(--faint); }

/* ---------------- 顶栏 ---------------- */

.site-header { position: sticky; top: 0; z-index: 60; padding: 16px 0 8px; }

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 6, 15, 0.9), rgba(5, 6, 15, 0));
  pointer-events: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px 10px 18px;
  border-radius: 999px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; white-space: nowrap; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, #b7aeff, #6c5cff 55%, #4fd6ff);
  box-shadow: 0 10px 24px -10px rgba(108, 92, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  color: #070a18;
  font-family: var(--pixel);
  font-size: 12px;
}

.brand-name { font-size: 16px; letter-spacing: 0.3px; }
.brand-name small { display: block; font-family: var(--pixel); font-size: 8px; letter-spacing: 1.4px; color: var(--faint); margin-top: 3px; }

.nav-links { display: flex; gap: 3px; }
.nav-links a { padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); }
.nav-links a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.nav-links a.active { color: var(--ink); background: rgba(255, 255, 255, 0.1); }

.nav-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 100px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(160, 175, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
}

.nav-search:focus-within { border-color: rgba(124, 108, 255, 0.7); }
.nav-search svg { width: 17px; height: 17px; color: var(--faint); flex: none; }
.nav-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 14px; }
.nav-search input::placeholder { color: var(--faint); }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.cart-btn { position: relative; }

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 700;
  color: #070a18;
  background: linear-gradient(135deg, #ffd479, #ff9f6b);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px 0 5px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  font-size: 13.5px;
  max-width: 190px;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: 700;
  color: #070a18;
  background: linear-gradient(135deg, #b7aeff, #4fd6ff);
  flex: none;
}

/* ---------------- Hero ---------------- */

.hero { display: grid; grid-template-columns: 1.02fr 0.98fr; gap: 46px; align-items: center; padding: 64px 0 40px; }

.hero h1 { margin: 22px 0 18px; font-size: clamp(40px, 5.2vw, 68px); line-height: 1.08; letter-spacing: -1.6px; font-weight: 800; }

.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #ffffff 0%, #b7aeff 34%, #6fd8ff 70%, #ff9fe0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p { max-width: 46ch; margin: 0 0 28px; color: var(--muted); font-size: 16px; line-height: 1.85; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-meta { display: flex; gap: 26px; margin-top: 34px; padding-top: 22px; border-top: 1px solid rgba(160, 175, 255, 0.12); }
.hero-meta b { display: block; font-size: 19px; letter-spacing: -0.3px; }
.hero-meta span { font-size: 12px; color: var(--faint); }

.hero-stage { position: relative; padding: 26px; min-height: 460px; display: grid; place-items: center; }

.stage-glow { position: absolute; inset: 10% 4%; border-radius: 50%; background: radial-gradient(circle, rgba(108, 92, 255, 0.4), transparent 65%); filter: blur(46px); z-index: -1; }

.server-card { width: min(390px, 100%); padding: 26px; animation: float 7s ease-in-out infinite; }

.server-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }

.server-status { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--green); }
.server-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }

.server-ip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px dashed rgba(160, 175, 255, 0.3);
  background: rgba(0, 0, 0, 0.18);
  font-family: var(--pixel);
  font-size: 11px;
  letter-spacing: 0.5px;
}

.server-ip button { border: 0; background: none; color: var(--cyan); cursor: pointer; font-family: var(--font); font-size: 12px; }

.server-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.server-grid div { padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); text-align: center; }
.server-grid b { display: block; font-size: 15px; }
.server-grid span { font-size: 10.5px; color: var(--faint); }

.server-items { display: flex; gap: 10px; margin-top: 18px; align-items: center; }
.server-items .pixel-icon { width: 40px; height: 40px; }

.float-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 12.5px;
  white-space: nowrap;
  animation: float 8s ease-in-out infinite;
  z-index: 2;
}

.chip-a { left: -6px; top: 12%; animation-delay: -1.8s; }
.chip-b { right: -10px; bottom: 10%; animation-delay: -3.4s; }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ---------------- 商城 ---------------- */

.shop { padding: 22px 0 10px; }

.shop-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.shop-head h2 { margin: 0; font-size: 25px; letter-spacing: -0.5px; }
.shop-head h2 span { font-size: 13px; font-weight: 500; color: var(--faint); margin-left: 8px; }

.sort {
  appearance: none;
  padding: 9px 34px 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa4c7' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.sort option { background: #0d1024; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }

.chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(160, 175, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.chip:hover { color: var(--ink); background: rgba(255, 255, 255, 0.09); }

.chip.active {
  color: #070a18;
  border-color: transparent;
  font-weight: 650;
  background: linear-gradient(120deg, #b7aeff, #6c5cff 50%, #4fd6ff);
  box-shadow: 0 12px 26px -12px rgba(108, 92, 255, 0.9);
}

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 10px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  transform-style: preserve-3d;
}

.card:hover { border-color: rgba(190, 200, 255, 0.3); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 1), 0 0 40px -18px rgba(124, 108, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.24); }

.card-art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 2.2 / 1;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 25% 15%, color-mix(in srgb, var(--rc) 32%, transparent), transparent 60%),
    radial-gradient(120% 120% at 80% 90%, rgba(79, 214, 255, 0.14), transparent 60%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.01));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), inset 0 -40px 70px rgba(0, 0, 0, 0.32);
}

.card-art::after {
  content: "";
  position: absolute;
  width: 70%;
  height: 70%;
  left: 2%;
  top: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 70%);
  filter: blur(8px);
}

.card-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.4));
  transition: transform 0.3s ease;
}

.card-art .pixel-icon {
  width: 46%;
  height: 46%;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.45));
  transition: transform 0.3s ease;
}

.card:hover .card-art img, .card:hover .card-art .pixel-icon { transform: translateY(-3px) scale(1.03); }

.card .tag { position: absolute; top: 10px; left: 10px; z-index: 2; }

.rarity-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--rc);
  background: color-mix(in srgb, var(--rc) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--rc) 40%, transparent);
}

.card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 6px 6px; flex: 1; }
.card-body h3 { margin: 0; font-size: 15px; font-weight: 650; }
.card-cat { font-size: 11px; color: var(--faint); letter-spacing: 0.5px; }
.card-desc { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; }

.price { font-size: 18px; font-weight: 700; letter-spacing: -0.4px; }
.price small { font-size: 12px; opacity: 0.65; margin-right: 1px; }

.stock { font-size: 11px; color: var(--faint); }
.stock.low { color: var(--gold); }

/* 稀有度 */
.r-common { --rc: #a9b2cf; }
.r-rare { --rc: #4fc3ff; }
.r-epic { --rc: #b06bff; }
.r-legendary { --rc: #ffb84d; }

.pixel-icon { display: block; image-rendering: pixelated; }

/* ---------------- 特性 ---------------- */

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 46px auto 10px; }

.feature { display: flex; gap: 14px; padding: 20px; align-items: flex-start; }
.feature .ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); }
.feature .ic svg { width: 21px; height: 21px; color: #c3bcff; }
.feature b { display: block; font-size: 14.5px; margin-bottom: 2px; }
.feature p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; }

/* ---------------- 详情 ---------------- */

.detail { padding: 40px 0 20px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.crumb:hover { color: var(--ink); }
.crumb svg { width: 15px; height: 15px; }

.detail-grid { display: grid; grid-template-columns: 1.02fr 0.98fr; gap: 26px; align-items: start; }

.detail-art { padding: 18px; }
.detail-art .card-art { aspect-ratio: 2.2 / 1; }
.detail-art .card-art img { width: 100%; height: 100%; }
.detail-art .card-art .pixel-icon { width: 30%; height: 30%; }

.detail-info { padding: 30px; display: flex; flex-direction: column; gap: 4px; }
.detail-info h1 { margin: 10px 0 8px; font-size: clamp(26px, 3vw, 36px); letter-spacing: -0.7px; line-height: 1.2; }
.detail-desc { margin: 0 0 18px; color: var(--muted); line-height: 1.85; }
.detail-price { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.detail-price .price { font-size: 34px; letter-spacing: -1px; }
.detail-price del { color: var(--faint); font-size: 15px; }

.specs { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 8px; }
.specs li { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.specs li::before { content: "▮"; color: var(--indigo); }

.qty { display: inline-flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px; border: 1px solid var(--stroke); background: rgba(0, 0, 0, 0.2); margin-bottom: 16px; align-self: flex-start; }
.qty button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font-size: 17px; cursor: pointer; }
.qty button:hover { background: rgba(255, 255, 255, 0.1); }
.qty span { min-width: 36px; text-align: center; font-weight: 650; }

.detail-actions { display: flex; gap: 10px; margin-top: auto; }
.related { margin-top: 54px; }
.related h2 { font-size: 22px; margin: 0 0 18px; }

/* ---------------- 购物袋抽屉 ---------------- */

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(3, 5, 12, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  width: min(420px, 96vw);
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.35s cubic-bezier(0.22, 0.9, 0.3, 1);
  border-radius: 0;
  border-left: 1px solid var(--stroke);
  background: linear-gradient(200deg, rgba(20, 22, 48, 0.96), rgba(9, 11, 26, 0.98));
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.6);
}

.cart-drawer.open { transform: none; }

.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid rgba(160, 175, 255, 0.12); }
.drawer-head h3 { margin: 0; font-size: 17px; }

.drawer-body { flex: 1; overflow: auto; padding: 8px 22px; }
.drawer-foot { padding: 18px 22px 24px; border-top: 1px solid rgba(160, 175, 255, 0.12); }
.drawer-close { border: 0; background: none; font-size: 24px; color: var(--muted); cursor: pointer; }

.cart-line { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); align-items: center; }
.cart-line .thumb { width: 64px; height: 64px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); display: grid; place-items: center; }
.cart-line .thumb .pixel-icon { width: 44px; height: 44px; }
.cart-line .thumb img { width: 54px; height: 54px; object-fit: contain; }
.cart-line .name { font-size: 13.5px; font-weight: 600; }
.cart-line .sub { font-size: 11.5px; color: var(--faint); }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--stroke); border-radius: 999px; background: rgba(0, 0, 0, 0.18); }
.stepper button { width: 28px; height: 28px; border: 0; background: transparent; cursor: pointer; font-size: 15px; }
.stepper span { min-width: 26px; text-align: center; font-size: 12.5px; }

.sum-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; color: var(--muted); }
.sum-row b { color: var(--ink); }
.sum-row.total { margin-top: 8px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.1); color: var(--ink); font-size: 15px; }
.sum-row.total b { font-size: 24px; }

/* ---------------- 页面 ---------------- */

.page { padding: 40px 0 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -0.9px; }

.panel { padding: 26px; }
.panel h2 { margin: 0 0 18px; font-size: 19px; }

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

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

.field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid rgba(160, 175, 255, 0.16);
  background: rgba(0, 0, 0, 0.24);
  color: var(--ink);
  font-size: 14px;
  outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: rgba(124, 108, 255, 0.75); box-shadow: 0 0 0 4px rgba(108, 92, 255, 0.14); }
.field textarea { min-height: 76px; resize: vertical; }
.field .err { display: none; font-size: 12px; color: var(--red); }
.field.invalid .err { display: block; }
.field.invalid input { border-color: rgba(255, 125, 146, 0.8); }
.field .hint { font-size: 11.5px; color: var(--faint); }

.form-error { display: none; margin-bottom: 14px; padding: 10px 14px; border-radius: 12px; background: rgba(255, 90, 110, 0.12); border: 1px solid rgba(255, 90, 110, 0.32); color: #ffb3bd; font-size: 13px; }
.form-error.show { display: block; }

.check-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.check-item .thumb { width: 40px; height: 40px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); display: grid; place-items: center; flex: none; }
.check-item .thumb .pixel-icon { width: 30px; height: 30px; }
.check-item .thumb img { width: 34px; height: 34px; object-fit: contain; }
.check-item .name { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-item .q { font-size: 12px; color: var(--faint); }

.qr-row { display: flex; gap: 14px; flex-wrap: wrap; }
.qr-row figure { margin: 0; text-align: center; flex: 1 1 120px; }
.qr-row .qr { width: 130px; max-width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 10px; border: 1px solid rgba(160, 175, 255, 0.2); }
.qr-row figcaption { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.pay-note { margin: 12px 0 0; font-size: 12px; color: var(--faint); line-height: 1.7; }

/* 订单 */
.orders { display: grid; gap: 14px; }
.order-card { padding: 20px 22px; }
.order-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 14px; margin-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.order-id { font-size: 13px; color: var(--muted); letter-spacing: 0.4px; }
.order-items { display: flex; flex-wrap: wrap; gap: 12px; }
.order-item { display: flex; align-items: center; gap: 10px; flex: 1 1 180px; }
.order-item .thumb { width: 44px; height: 44px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); display: grid; place-items: center; flex: none; }
.order-item .thumb .pixel-icon { width: 32px; height: 32px; }
.order-item .thumb img { width: 36px; height: 36px; object-fit: contain; }
.order-item .n { font-size: 13px; }
.order-item .q { font-size: 11.5px; color: var(--faint); }
.order-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.07); font-size: 12.5px; color: var(--faint); }
.order-foot b { color: var(--ink); font-size: 18px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.06); color: var(--muted); white-space: nowrap; }
.badge.pending { color: var(--gold); border-color: rgba(255, 199, 102, 0.4); background: rgba(255, 199, 102, 0.1); }
.badge.shipped { color: var(--cyan); border-color: rgba(79, 214, 255, 0.4); background: rgba(79, 214, 255, 0.1); }
.badge.done { color: var(--green); border-color: rgba(94, 224, 160, 0.4); background: rgba(94, 224, 160, 0.1); }
.badge.cancelled { color: var(--red); border-color: rgba(255, 125, 146, 0.4); background: rgba(255, 125, 146, 0.1); }

.empty-state { padding: 70px 20px; text-align: center; }
.empty-state .emoji { font-size: 44px; margin-bottom: 10px; opacity: 0.8; }
.empty-state h3 { margin: 0 0 6px; font-size: 18px; }
.empty-state p { margin: 0 0 20px; color: var(--muted); font-size: 13.5px; }

/* ---------------- 登录 ---------------- */

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }
.auth-brand { position: fixed; top: 22px; left: 26px; z-index: 10; }
.auth-panel { display: grid; grid-template-columns: 1.02fr 0.98fr; width: min(980px, 100%); overflow: hidden; border-radius: 28px; }
.auth-visual {
  padding: 46px 42px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden;
  background: radial-gradient(120% 120% at 10% 0%, rgba(108, 92, 255, 0.4), transparent 60%), radial-gradient(100% 100% at 100% 100%, rgba(79, 214, 255, 0.22), transparent 60%);
  border-right: 1px solid rgba(160, 175, 255, 0.12);
}
.auth-visual h2 { margin: 0 0 12px; font-size: 30px; line-height: 1.25; letter-spacing: -0.7px; }
.auth-visual p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.85; }
.auth-points { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 12px; }
.auth-points li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.auth-points li::before { content: "✓"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; color: #070a18; background: linear-gradient(135deg, #b7aeff, #4fd6ff); flex: none; }
.auth-form { padding: 40px 42px; display: flex; flex-direction: column; justify-content: center; }
.auth-form h1 { margin: 0 0 6px; font-size: 24px; }
.auth-form .sub { margin: 0 0 20px; color: var(--muted); font-size: 13.5px; }

.tabs { display: flex; gap: 6px; padding: 5px; border-radius: 999px; background: rgba(0, 0, 0, 0.26); margin-bottom: 22px; border: 1px solid rgba(160, 175, 255, 0.1); }
.tabs a { flex: 1; text-align: center; padding: 9px 12px; border-radius: 999px; font-size: 13.5px; color: var(--muted); }
.tabs a.active { color: #070a18; font-weight: 650; background: linear-gradient(120deg, #b7aeff, #6c5cff 60%, #4fd6ff); }

.pw-meter { display: flex; gap: 5px; }
.pw-meter i { height: 3px; flex: 1; border-radius: 99px; background: rgba(255, 255, 255, 0.12); }
.pw-meter.s1 i:nth-child(1) { background: var(--red); }
.pw-meter.s2 i:nth-child(-n+2) { background: var(--gold); }
.pw-meter.s3 i { background: var(--green); }

.terms { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; color: var(--muted); margin: 4px 0 18px; line-height: 1.6; }
.terms input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: #7c6cff; flex: none; }

.auth-alt { margin-top: 16px; text-align: center; font-size: 13px; color: var(--muted); }
.auth-alt a { color: #cfc7ff; font-weight: 600; }
.admin-hint { margin: 12px 0 0; text-align: center; font-size: 12px; color: var(--faint); }
.admin-hint b { color: var(--muted); }

/* ---------------- 后台 ---------------- */

.admin-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; padding: 28px 0 60px; align-items: start; }

.sidebar { position: sticky; top: 92px; padding: 16px 12px; }
.sidebar .brand { padding: 6px 8px 16px; }
.side-nav { display: grid; gap: 4px; }
.side-nav a {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 12px; font-size: 14px; color: var(--muted);
}
.side-nav a:hover { background: rgba(255, 255, 255, 0.06); color: var(--ink); }
.side-nav a.active { background: linear-gradient(120deg, rgba(124, 108, 255, 0.3), rgba(79, 214, 255, 0.16)); color: var(--ink); border: 1px solid rgba(160, 175, 255, 0.24); }
.side-nav svg { width: 18px; height: 18px; }

.side-foot { margin-top: 18px; padding: 12px 8px 0; border-top: 1px solid rgba(160, 175, 255, 0.12); font-size: 12px; color: var(--faint); }

.admin-main { min-width: 0; }
.admin-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-top h1 { margin: 0; font-size: 28px; letter-spacing: -0.6px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { padding: 18px; }
.stat b { display: block; font-size: 26px; letter-spacing: -0.6px; }
.stat span { font-size: 12px; color: var(--muted); }
.stat b.up { color: var(--green); }
.stat b.gold { color: var(--gold); }
.stat b.red { color: var(--red); }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid rgba(160, 175, 255, 0.1); }
.panel-head h3 { margin: 0; font-size: 15px; }

.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; padding: 11px 12px; font-size: 11.5px; color: var(--faint); border-bottom: 1px solid rgba(160, 175, 255, 0.12); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

.item-cell { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.item-cell .thumb { width: 38px; height: 38px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); display: grid; place-items: center; flex: none; }
.item-cell .thumb .pixel-icon { width: 30px; height: 30px; }
.item-cell .thumb img { width: 32px; height: 32px; object-fit: contain; }

.actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.search-inline { padding: 9px 14px; border-radius: 999px; border: 1px solid rgba(160, 175, 255, 0.16); background: rgba(0, 0, 0, 0.22); color: var(--ink); font-size: 13px; outline: none; min-width: 220px; }

.chart-wrap { padding: 14px; }
.trend-svg { width: 100%; height: auto; display: block; }
.chart-empty { padding: 54px 0; text-align: center; color: var(--faint); font-size: 13px; }

.tab-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tab-btn { padding: 7px 13px; border-radius: 999px; border: 1px solid rgba(160, 175, 255, 0.16); background: rgba(255, 255, 255, 0.05); color: var(--muted); font-size: 12.5px; cursor: pointer; }
.tab-btn.active { color: #070a18; border-color: transparent; background: linear-gradient(120deg, #b7aeff, #4fd6ff); font-weight: 650; }

/* 上传 */
.upload-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 6px 0 14px; }
.pay-slot { width: 190px; padding: 12px; border-radius: 14px; border: 1px dashed rgba(160, 175, 255, 0.24); background: rgba(0, 0, 0, 0.18); }
.pay-slot .qr { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 8px; }
.pay-empty { width: 100%; aspect-ratio: 1; display: grid; place-items: center; color: var(--faint); font-size: 12px; }
.pay-slot figcaption { text-align: center; font-size: 12px; color: var(--muted); margin: 8px 0; }
.pay-slot input[type="file"] { width: 100%; font-size: 11px; color: var(--faint); }

input[type="file"]::file-selector-button {
  margin-right: 8px; padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(160, 175, 255, 0.2);
  background: rgba(255, 255, 255, 0.08); color: var(--ink); cursor: pointer; font-size: 11px; font-family: inherit;
}

/* ---------------- 弹窗 / Toast ---------------- */

.overlay { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 24px; background: rgba(3, 5, 12, 0.66); backdrop-filter: blur(8px); overflow: auto; }
.modal { width: min(640px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid rgba(160, 175, 255, 0.12); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-close { border: 0; background: none; color: var(--muted); font-size: 24px; cursor: pointer; }
.modal-body { padding: 20px 22px 22px; overflow: auto; }
.modal-body .btn-block { margin-top: 14px; }

#if-preview svg { width: 60px; height: 60px; }
#if-preview img { max-height: 66px; }

.toast-root { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: min(420px, calc(100% - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-radius: 14px; font-size: 13.5px; background: rgba(18, 20, 40, 0.92); border: 1px solid rgba(160, 175, 255, 0.2); box-shadow: 0 20px 44px -18px rgba(0, 0, 0, 0.9); backdrop-filter: blur(20px); opacity: 0; transform: translateY(10px); transition: opacity 0.25s ease, transform 0.25s ease; }
.toast.show { opacity: 1; transform: none; }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.toast.err .dot { background: var(--red); box-shadow: 0 0 10px var(--red); }

.footer { margin-top: 70px; padding: 34px 0 44px; border-top: 1px solid rgba(160, 175, 255, 0.1); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer p { margin: 10px 0 0; font-size: 12.5px; color: var(--faint); line-height: 1.8; max-width: 44ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; color: var(--muted); }
.footer-links a:hover { color: var(--ink); }

.mobile-nav { display: none; position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 90; width: min(420px, calc(100% - 28px)); padding: 8px; border-radius: 999px; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.mobile-nav a, .mobile-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border: 0; border-radius: 999px; background: transparent; color: var(--faint); font-size: 10.5px; cursor: pointer; }
.mobile-nav svg { width: 19px; height: 19px; }
.mobile-nav .active { color: var(--ink); background: rgba(255, 255, 255, 0.1); }

.view-enter { animation: rise 0.5s cubic-bezier(0.22, 0.9, 0.3, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------------- 响应式 ---------------- */

@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .checkout-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .admin-shell { grid-template-columns: 200px minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 16px; padding-top: 34px; }
  .hero-stage { min-height: 380px; }
  .features { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .checkout-grid { grid-template-columns: 1fr; }
  .auth-panel { grid-template-columns: 1fr; max-width: 480px; }
  .auth-visual { display: none; }
  .auth-brand { position: static; margin-bottom: 16px; }
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; padding: 10px; }
  .side-nav { display: flex; overflow-x: auto; gap: 6px; }
  .side-nav a { white-space: nowrap; padding: 9px 12px; }
  .side-foot { display: none; }
}

@media (max-width: 760px) {
  .container { width: calc(100% - 32px); }
  .site-header { padding: 10px 0 6px; }
  .nav { flex-wrap: wrap; padding: 8px 10px; border-radius: 24px; gap: 8px; }
  .nav-links { display: none; }
  .nav-search { order: 3; flex-basis: 100%; height: 38px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-desc { display: none; }
  .hero h1 { font-size: 38px; }
  .hero-meta { gap: 16px; }
  .float-chip { font-size: 11px; padding: 8px 11px; }
  .chip-a { left: 0; } .chip-b { right: 0; }
  .page { padding-top: 26px; padding-bottom: 96px; }
  .footer { margin-bottom: 70px; }
  .mobile-nav { display: grid; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-info { padding: 22px; }
  .detail-actions { flex-direction: column; }
  .toast-root { bottom: 92px; }
  .admin-top h1 { font-size: 23px; }
  .stat b { font-size: 22px; }
}

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