:root {
  --bg: #f8fbff;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --ink: #182232;
  --muted: #697586;
  --line: rgba(123, 142, 164, 0.18);
  --mint: #69d7b4;
  --teal: #49c7c9;
  --blue: #4f86f7;
  --violet: #8067f1;
  --coral: #ef6f7f;
  --gold: #f3bd5a;
  --shadow: 0 18px 50px rgba(58, 72, 98, 0.12);
  --small-shadow: 0 10px 25px rgba(61, 77, 107, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.45;
  letter-spacing: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.8)),
    url("assets/store-bg.png") center 46px / cover fixed no-repeat;
}

button,
input,
textarea {
  font: inherit;
}

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

.page-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto auto minmax(220px, 1fr) auto;
  gap: 18px;
  align-items: center;
  width: 100%;
  padding: 12px clamp(18px, 6vw, 96px);
  border-bottom: 1px solid rgba(222, 229, 238, 0.78);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.brand,
.nav-links,
.top-actions,
.site-search {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  color: #68a884;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  color: white;
  font-size: 12px;
  font-weight: 900;
  background: linear-gradient(135deg, #f24f59, #1e2634 58%, #6dddb9);
  box-shadow: 0 9px 18px rgba(239, 91, 109, 0.22);
}

.nav-links {
  gap: 8px;
  color: #4d5563;
  font-weight: 650;
}

.nav-links a,
.ghost-button,
.primary-button,
.category-tab,
.pay-button,
.query-button,
.auth-submit,
.chat-quick button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.nav-links a {
  padding: 7px 8px;
}

.nav-links a.active {
  color: var(--blue);
}

.site-search {
  justify-self: end;
  width: min(100%, 260px);
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(121, 132, 148, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 20px rgba(72, 87, 111, 0.06);
}

.site-search input {
  width: 100%;
  min-width: 0;
  height: 36px;
  border: 0;
  outline: none;
  color: var(--ink);
  background: transparent;
}

.top-actions {
  gap: 8px;
  white-space: nowrap;
}

.ghost-button {
  padding: 0 12px;
  border: 1px solid rgba(121, 132, 148, 0.35);
  background: rgba(255, 255, 255, 0.88);
}

.primary-button,
.query-button,
.auth-submit {
  padding: 0 14px;
  color: white;
  font-weight: 750;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  box-shadow: 0 10px 22px rgba(83, 112, 235, 0.24);
}

.main-view {
  width: min(1120px, calc(100% - 32px));
  margin: 26px auto 72px;
}

.glass-panel {
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  font-size: 16px;
  font-weight: 850;
}

.announcement-body {
  display: grid;
  min-height: 292px;
  place-items: center;
  padding: 28px 18px 32px;
  text-align: center;
}

.notice-stack {
  max-width: 610px;
  padding: 18px 20px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
}

.notice-stack h1 {
  margin: 0 0 8px;
  color: #283347;
  font-size: 18px;
  line-height: 1.35;
}

.notice-stack p {
  margin: 4px 0;
  color: #293346;
  font-weight: 720;
}

.notice-stack .danger {
  color: #ce5569;
}

.tabs-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 16px 10px;
}

.category-tab {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(109, 119, 136, 0.18);
  color: #556070;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--small-shadow);
}

.category-tab.active {
  color: white;
  background: linear-gradient(135deg, #8c77ef, #45c4d6);
}

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

.product-card {
  position: relative;
  display: grid;
  min-height: 304px;
  grid-template-rows: 168px auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--small-shadow);
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.product-card:hover,
.product-card:focus-visible,
.nav-links a:hover,
.ghost-button:hover,
.primary-button:hover,
.category-tab:hover,
.pay-button:hover,
.query-button:hover,
.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(63, 78, 107, 0.16);
}

.product-card:focus-visible,
.category-tab:focus-visible,
.pay-button:focus-visible,
.query-button:focus-visible,
.auth-submit:focus-visible,
.ghost-button:focus-visible,
.primary-button:focus-visible,
.chat-toggle:focus-visible,
.icon-button:focus-visible {
  outline: 3px solid rgba(79, 134, 247, 0.26);
  outline-offset: 2px;
}

.product-art {
  position: relative;
  display: grid;
  overflow: hidden;
  place-items: center;
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 36%),
    linear-gradient(135deg, var(--accent), rgba(255, 255, 255, 0.9));
}

.product-art::before {
  position: absolute;
  width: 150px;
  height: 150px;
  border: 18px solid rgba(255, 255, 255, 0.68);
  border-radius: 38px;
  content: "";
  transform: rotate(45deg);
}

.product-art::after {
  position: absolute;
  color: rgba(24, 34, 50, 0.84);
  content: attr(data-mark);
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 0;
}

.product-info {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 13px 14px 16px;
}

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

.badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: #4f7f67;
  font-size: 12px;
  font-weight: 720;
  background: rgba(115, 218, 180, 0.17);
}

.badge.recommend {
  color: #6552c8;
  background: rgba(128, 103, 241, 0.14);
}

.product-title {
  min-height: 44px;
  margin: 0;
  color: #111827;
  font-weight: 850;
  line-height: 1.35;
}

.price {
  color: var(--coral);
  font-size: 22px;
  font-weight: 900;
}

.stock {
  color: #5c6675;
  font-size: 14px;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 160px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.detail-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr);
  gap: 18px;
  padding: 18px;
}

.detail-art {
  min-height: 390px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.detail-content {
  display: grid;
  align-content: start;
  gap: 12px;
}

.detail-content h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

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

.detail-price {
  color: var(--coral);
  font-size: 24px;
  font-weight: 900;
}

.field-group {
  display: grid;
  gap: 7px;
}

.field-group label,
.form-row label {
  color: #6a7382;
  font-weight: 700;
}

.input,
.quantity input,
.textarea {
  width: 100%;
  border: 1px solid rgba(125, 136, 153, 0.22);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.input {
  height: 42px;
  padding: 0 12px;
}

.textarea {
  min-height: 94px;
  resize: vertical;
  padding: 10px 12px;
}

.input:focus,
.quantity input:focus,
.textarea:focus {
  border-color: rgba(79, 134, 247, 0.72);
  box-shadow: 0 0 0 4px rgba(79, 134, 247, 0.12);
}

.quantity {
  display: inline-grid;
  grid-template-columns: 38px 64px 38px;
  width: max-content;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(239, 111, 127, 0.16);
}

.quantity button {
  border: 0;
  color: white;
  font-size: 18px;
  font-weight: 850;
  cursor: pointer;
  background: linear-gradient(135deg, #ef6f7f, #8c77ef);
}

.quantity input {
  height: 38px;
  border-radius: 0;
  text-align: center;
  font-weight: 800;
}

.captcha-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.captcha-code {
  display: grid;
  min-width: 84px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(239, 111, 127, 0.35);
  border-radius: 8px;
  color: #ce6f98;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 2px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 226, 235, 0.82)),
    repeating-linear-gradient(45deg, transparent 0 7px, rgba(128, 103, 241, 0.11) 8px 10px);
  cursor: pointer;
}

.payment-box {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.payment-title {
  padding: 11px 13px;
  color: #5f6b7d;
  font-weight: 800;
  border-bottom: 1px dashed rgba(128, 140, 158, 0.2);
}

.pay-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
}

.pay-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(125, 136, 153, 0.18);
  color: #5f6472;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.82);
}

.pay-button.alipay {
  color: #4779df;
}

.pay-button.wallet {
  color: #bd6b81;
}

.detail-note {
  padding: 18px;
}

.detail-note p {
  margin: 6px 0;
}

.query-layout,
.auth-layout {
  display: grid;
  min-height: 430px;
  place-items: start center;
  padding: 16px;
}

.query-form {
  display: grid;
  grid-template-columns: minmax(220px, 300px) auto;
  gap: 12px;
  align-items: center;
  margin: 8px auto 22px;
}

.query-results {
  display: grid;
  width: min(720px, 100%);
  gap: 10px;
}

.order-result {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.order-result strong {
  font-size: 16px;
}

.order-result span {
  color: var(--muted);
}

.auth-card {
  display: grid;
  width: min(440px, 100%);
  gap: 14px;
  margin-top: 10px;
  padding: 28px;
}

.auth-logo {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  justify-self: center;
  border-radius: 8px;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, #ef4d5f, #202838 58%, #63dbba);
  box-shadow: 0 16px 34px rgba(239, 87, 105, 0.22);
}

.auth-card h1 {
  margin: 0;
  text-align: center;
  font-size: 22px;
}

.form-row {
  display: grid;
  gap: 7px;
}

.split-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.auth-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}

.auth-meta label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.auth-switch {
  text-align: center;
  color: var(--muted);
}

.auth-switch a {
  color: var(--violet);
  font-weight: 800;
}

.chat-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  display: grid;
  justify-items: end;
  gap: 12px;
}

.chat-toggle {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  cursor: pointer;
  background: linear-gradient(135deg, #62d5bb, #4f86f7);
  box-shadow: 0 16px 38px rgba(70, 143, 198, 0.32);
}

.chat-panel {
  width: min(400px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.chat-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.chat-panel header div {
  display: grid;
  gap: 2px;
}

.chat-panel header span {
  color: var(--muted);
  font-size: 13px;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #8a93a3;
  cursor: pointer;
  background: rgba(244, 247, 251, 0.9);
}

.chat-messages {
  display: grid;
  gap: 9px;
  max-height: 220px;
  overflow: auto;
  padding: 14px;
}

.chat-messages p {
  width: fit-content;
  max-width: 88%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(244, 247, 251, 0.94);
}

.chat-messages .user {
  justify-self: end;
  color: white;
  background: linear-gradient(135deg, var(--violet), var(--blue));
}

.chat-quick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 14px 14px;
}

.chat-quick button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(125, 136, 153, 0.18);
  color: #4d5563;
  background: rgba(255, 255, 255, 0.9);
}

.toast-region {
  position: fixed;
  top: 72px;
  right: 20px;
  z-index: 30;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
}

.toast {
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  color: #253143;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--small-shadow);
  animation: slideIn 180ms ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 10px 14px;
  }

  .nav-links {
    order: 3;
  }

  .site-search {
    order: 4;
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
  }

  .top-actions {
    justify-self: end;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-panel {
    grid-template-columns: 1fr;
  }

  .detail-art {
    min-height: 300px;
  }
}

@media (max-width: 620px) {
  body {
    background-attachment: scroll;
  }

  .topbar {
    padding: 10px 14px;
  }

  .brand {
    font-size: 15px;
  }

  .nav-links {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: space-between;
  }

  .top-actions {
    gap: 6px;
  }

  .ghost-button,
  .primary-button {
    padding: 0 10px;
    font-size: 13px;
  }

  .main-view {
    width: calc(100% - 20px);
    margin-top: 14px;
  }

  .announcement-body {
    min-height: 250px;
    padding: 18px 12px 24px;
  }

  .notice-stack {
    padding: 14px 12px;
  }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 10px;
  }

  .product-card {
    grid-template-columns: 132px 1fr;
    grid-template-rows: auto;
    min-height: 168px;
  }

  .product-art {
    min-height: 168px;
  }

  .product-art::before {
    width: 90px;
    height: 90px;
    border-width: 12px;
  }

  .product-art::after {
    font-size: 28px;
  }

  .product-title {
    min-height: auto;
  }

  .query-form,
  .split-row,
  .captcha-row {
    grid-template-columns: 1fr;
  }

  .query-button,
  .auth-submit {
    width: 100%;
  }

  .auth-card {
    padding: 22px 16px;
  }

  .chat-widget {
    right: 14px;
    bottom: 14px;
  }
}
