.shop-body {
  min-height: 100vh;
  background: #f6f8fb;
}

.shop-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
}

.shop-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.shop-brand span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-weight: 900;
}

.shop-brand strong { font-size: 18px; }

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

.shop-nav a {
  padding: 8px 10px;
  border-radius: 8px;
  color: #334155;
  text-decoration: none;
  font-size: 14px;
  font-weight: 850;
}

.shop-nav a:hover {
  background: #eff6ff;
  color: var(--blue);
}

.shop-logout {
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  font-size: 14px;
  font-weight: 850;
}

.shop-logout:hover {
  background: #fef2f2;
  color: #dc2626;
}

.customer-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 18px auto 32px;
  display: grid;
  gap: 16px;
}

.customer-main,
.shop-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.customer-main { padding: 18px; }
.shop-section { padding: 18px; }

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .75fr) minmax(220px, .55fr);
  gap: 18px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-panel[hidden] { display: none; }

.login-panel h1 {
  font-size: 30px;
  line-height: 1.2;
}

.login-panel p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.login-form .input {
  width: 100%;
}

.signup-entry {
  display: grid;
  gap: 8px;
  align-self: stretch;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.signup-entry span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.signup-entry strong {
  line-height: 1.45;
}

.login-error {
  min-height: 18px;
  color: #dc2626;
  font-size: 13px;
}

.customer-head,
.shop-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.customer-head h1,
.shop-section-head h2 {
  font-size: 24px;
  line-height: 1.2;
}

.client-switch {
  display: grid;
  gap: 6px;
  min-width: 260px;
}

.client-switch span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.client-switch strong,
#checkoutClientName {
  font-size: 16px;
}

.account-overview {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(420px, 1.15fr);
  gap: 14px;
}

.usage-card,
.quick-import,
.checkout-card,
.plan-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.usage-card {
  display: grid;
  gap: 18px;
  padding: 18px;
  background: #0f172a;
  color: #fff;
}

.usage-top,
.usage-foot,
.quick-import-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.usage-card span,
.quick-import-head span {
  display: block;
  color: inherit;
  opacity: .72;
  font-size: 12px;
  font-weight: 850;
}

.usage-top strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.usage-number {
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.bar.large {
  height: 12px;
  background: rgba(255,255,255,.18);
}

.bar.large i { background: #38bdf8; }

.usage-foot {
  color: rgba(255,255,255,.72);
  font-size: 13px;
}

.quick-import {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.quick-import-head {
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.quick-import-head strong {
  display: block;
  margin-top: 6px;
  max-width: 620px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

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

.import-btn {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 900;
  cursor: pointer;
}

.import-btn.clash { background: #eff6ff; color: #1d4ed8; }
.import-btn.v2ray { background: #ecfeff; color: #0e7490; }
.import-btn.shadow { background: #f5f3ff; color: #6d28d9; }
.import-btn.qr { background: #f8fafc; color: #334155; }

.qr-box {
  min-height: 86px;
  display: grid;
  place-items: center;
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  text-align: center;
  overflow-wrap: anywhere;
}

.qr-dialog {
  width: min(420px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.qr-dialog::backdrop {
  background: rgba(15, 23, 42, .46);
  backdrop-filter: blur(4px);
}

.qr-dialog-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

.qr-dialog-head,
.qr-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qr-dialog-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.qr-dialog-head strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.qr-canvas-wrap {
  display: grid;
  place-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

#qrCanvas {
  width: 286px;
  height: 286px;
  image-rendering: pixelated;
  border-radius: 6px;
  background: #fff;
}

#qrDialogUrl {
  margin: 0;
  padding: 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

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

.plan-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.plan-card.featured {
  border-color: #93c5fd;
  box-shadow: 0 18px 42px rgba(37, 99, 235, .12);
}

.plan-card h3 { font-size: 20px; }

.plan-traffic {
  font-size: 38px;
  font-weight: 950;
  line-height: 1;
}

.plan-meta {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .75fr);
  gap: 14px;
}

.signup-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px);
  gap: 14px;
}

.signup-form,
.signup-note {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  box-shadow: var(--shadow-soft);
}

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

.signup-note {
  align-content: start;
  background: #fff;
}

.signup-note p {
  color: var(--muted);
  line-height: 1.65;
}

.signup-result {
  min-height: 18px;
  font-size: 13px;
}

.signup-result.success { color: #15803d; }
.signup-result.error { color: #dc2626; }

.checkout-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: #f8fafc;
}

.payment-guide p {
  color: var(--muted);
  line-height: 1.65;
}

.checkout-summary,
.payment-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.checkout-summary span,
.payment-box span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 940px) {
  .shop-topbar,
  .customer-head,
  .account-overview,
  .login-panel,
  .signup-layout,
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .shop-topbar,
  .customer-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .client-switch { min-width: 0; width: 100%; }

  .plan-grid,
  .form-grid,
  .import-grid {
    grid-template-columns: 1fr;
  }
}
