:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-strong: #f9fbff;
  --line: #e6eaf2;
  --line-strong: #d3d9e6;
  --text: #1c2433;
  --muted: #697386;
  --weak: #98a2b3;
  --primary: #1769ff;
  --primary-strong: #0f52cf;
  --primary-soft: #e8f1ff;
  --success: #13a06f;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 12px 40px rgba(25, 35, 55, 0.08);
  --radius: 8px;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid transparent;
  background: rgba(245, 247, 251, 0.86);
  backdrop-filter: blur(16px);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.site-header.is-scrolled {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 28px rgba(25, 35, 55, 0.06);
}

.header-inner,
.page,
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 66px;
}

.brand,
.hero-left,
.shop-title-row,
.shop-actions,
.hero-tools,
.main-nav,
.content-tabs,
.panel-head,
.goods-price,
.price-row,
.modal-head,
.order-summary,
.pay-option,
.footer-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  min-width: 160px;
  font-weight: 700;
}

.brand-mark,
.shop-avatar {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #1769ff, #13a06f);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.brand-name {
  font-size: 16px;
}

.main-nav {
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.main-nav a {
  padding: 8px 11px;
  border-radius: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.main-nav a:hover {
  background: var(--surface);
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(23, 105, 255, 0.22);
}

.btn-primary:hover {
  background: var(--primary-strong);
}

.btn-outline {
  border-color: var(--line-strong);
  background: var(--surface);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-sm {
  min-height: 36px;
  padding: 0 14px;
}

.btn-xs {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.icon {
  line-height: 1;
}

.page {
  padding: 26px 0 36px;
}

.shop-hero {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 340px);
  gap: 24px;
  margin-bottom: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(23, 105, 255, 0.08), transparent 36%),
    linear-gradient(145deg, rgba(19, 160, 111, 0.08), transparent 38%),
    var(--surface);
  box-shadow: var(--shadow);
}

.hero-left {
  gap: 18px;
  min-width: 0;
}

.shop-avatar {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  font-size: 24px;
  font-weight: 800;
}

.shop-meta {
  min-width: 0;
}

.shop-title-row {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.shop-title-row h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.verify-badge,
.deposit-badge,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.verify-badge {
  background: #fff7dc;
  color: #9a6700;
}

.deposit-badge {
  background: #e7f8f0;
  color: var(--success);
}

.shop-meta p {
  max-width: 740px;
  margin: 0 0 14px;
  color: var(--muted);
}

.hero-tools {
  justify-content: flex-end;
}

.search-box {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 42px;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--weak);
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 105, 255, 0.1);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.content-tabs {
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 18px;
}

.tab-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.tab-button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(23, 105, 255, 0.18);
}

.shop-layout {
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 20px;
  align-items: start;
}

.category-panel,
.notice-panel,
.goods-panel,
.modal-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.category-panel {
  position: sticky;
  top: 86px;
  padding: 8px;
}

.panel-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.category-panel .panel-title {
  padding: 12px;
}

.category-list {
  display: grid;
  gap: 4px;
}

.category-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.category-item:hover,
.category-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.category-count {
  color: var(--weak);
  font-size: 12px;
}

.main-column {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.notice-panel,
.goods-panel {
  padding: 18px;
}

.notice-panel p,
.panel-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
}

.panel-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

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

.goods-item {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 13px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.goods-item:hover {
  transform: translateY(-2px);
  border-color: rgba(23, 105, 255, 0.32);
  box-shadow: 0 10px 28px rgba(25, 35, 55, 0.08);
}

.goods-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: #e9f1ff;
  color: var(--primary);
  font-size: 22px;
  font-weight: 800;
}

.goods-body {
  min-width: 0;
}

.goods-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 6px;
}

.goods-title strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 15px;
}

.goods-desc {
  display: -webkit-box;
  min-height: 40px;
  margin: 0 0 10px;
  overflow: hidden;
  color: var(--muted);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.goods-foot {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

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

.tag {
  background: #fff4e5;
  color: #a35a00;
}

.tag.auto {
  background: #e7f8f0;
  color: var(--success);
}

.goods-price {
  gap: 4px;
  white-space: nowrap;
}

.currency {
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

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

.old-price {
  color: var(--weak);
  font-size: 12px;
  text-decoration: line-through;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 220px;
  color: var(--muted);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 40px;
  color: var(--muted);
  font-size: 13px;
}

.footer-links {
  gap: 8px;
  flex-wrap: wrap;
}

.back-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.back-top.show {
  display: block;
}

.modal[hidden],
.toast[hidden],
[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 24, 38, 0.56);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 20px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.26);
}

.query-card {
  width: min(720px, 100%);
}

.modal-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.icon-btn {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.order-summary {
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.order-summary strong {
  display: block;
  margin-bottom: 5px;
}

.order-desc {
  margin: 14px 0;
  color: var(--muted);
}

.order-form {
  display: grid;
  gap: 13px;
}

.field {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 12px;
}

.field > span {
  color: var(--muted);
}

.field input,
.stepper {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}

.field input {
  width: 100%;
  padding: 0 12px;
  outline: 0;
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 105, 255, 0.1);
}

.stepper {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  overflow: hidden;
}

.stepper button {
  border: 0;
  background: var(--surface-strong);
  color: var(--text);
}

.stepper input {
  min-height: 38px;
  border: 0;
  border-inline: 1px solid var(--line);
  border-radius: 0;
  text-align: center;
}

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

.pay-option {
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.pay-option.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.price-row {
  justify-content: space-between;
  min-height: 50px;
  padding: 0 14px;
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.price-row strong {
  color: var(--danger);
  font-size: 24px;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.query-search {
  margin-bottom: 14px;
}

.order-list {
  display: grid;
  gap: 10px;
}

.order-record {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.order-record strong {
  display: block;
}

.order-record span {
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  top: 86px;
  left: 50%;
  z-index: 60;
  max-width: min(460px, calc(100% - 32px));
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  transform: translateX(-50%);
}

@media (max-width: 920px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .shop-hero,
  .shop-layout {
    grid-template-columns: 1fr;
  }

  .category-panel {
    position: static;
  }

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

@media (max-width: 680px) {
  .header-inner,
  .page,
  .site-footer {
    width: min(100% - 20px, 1180px);
  }

  .shop-hero {
    padding: 18px;
  }

  .hero-left {
    align-items: flex-start;
  }

  .shop-title-row h1 {
    font-size: 20px;
  }

  .shop-actions,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .goods-grid,
  .category-list,
  .pay-types {
    grid-template-columns: 1fr;
  }

  .goods-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .field {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .modal-card {
    padding: 16px;
  }
}
