:root {
  --ink: #111827;
  --muted: #667085;
  --line: #e5e7eb;
  --soft: #f3f4f6;
  --navy: #111d2f;
  --navy-2: #1f3048;
  --orange: #ff9900;
  --orange-dark: #e07d00;
  --blue: #1677ff;
  --green: #16a34a;
  --shadow: 0 18px 45px rgba(17, 24, 39, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #f6f7f9;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 72px;
  padding: 0 5vw;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: var(--orange);
  color: #161616;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 3px;
  color: #cbd5e1;
  font-size: 12px;
}

.desktop-nav {
  display: flex;
  gap: 20px;
  color: #d6e0ef;
  font-size: 14px;
}

.desktop-nav a:hover {
  color: #fff;
}

.cart-button {
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: var(--orange);
  color: #151515;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
}

.cart-button span {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  place-items: center;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 12px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 42px;
  padding: 70px 5vw 58px;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 153, 0, 0.22), transparent 30%),
    linear-gradient(135deg, #132035 0%, #243b57 55%, #0d1728 100%);
  color: #fff;
}

.hero h1 {
  max-width: 760px;
  margin: 0 0 18px;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1.08;
}

.hero p {
  max-width: 720px;
  margin: 0;
  color: #dce6f3;
  font-size: 18px;
  line-height: 1.8;
}

.hero-actions,
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.primary-action,
.secondary-action,
.outline-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  background: var(--orange);
  color: #121212;
}

.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.trust-row span {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 9px 13px;
  color: #dce6f3;
  font-size: 13px;
}

.hero-panel {
  align-self: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.panel-header,
.cart-total,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-header strong {
  color: #7ee787;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.metric-grid div,
.mini-order {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  padding: 16px;
}

.metric-grid strong,
.metric-grid span,
.mini-order span,
.mini-order strong,
.mini-order small {
  display: block;
}

.metric-grid strong {
  font-size: 28px;
}

.metric-grid span,
.mini-order small {
  color: #d8e2ee;
  font-size: 13px;
}

.mini-order strong {
  margin: 8px 0;
  font-size: 20px;
}

.search-band {
  padding: 24px 5vw;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.search-box {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 120px;
  max-width: 1100px;
  margin: auto;
  border: 2px solid var(--orange);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.search-box select,
.search-box input,
.search-box button {
  min-height: 52px;
  border: 0;
  padding: 0 16px;
}

.search-box select {
  border-right: 1px solid var(--line);
  background: #f8fafc;
}

.search-box button {
  background: var(--orange);
  cursor: pointer;
  font-weight: 900;
}

.content-grid {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 26px;
  padding: 30px 5vw;
}

.sidebar,
.product-area,
.upload-section,
.company-card,
.contact-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
}

.sidebar {
  height: fit-content;
  padding: 20px;
}

.sidebar h2,
.product-area h2,
.upload-section h2,
.info-sections h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.category {
  display: block;
  width: 100%;
  margin: 8px 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
}

.category.active,
.category:hover {
  border-color: #f8c15a;
  background: #fff7e6;
  color: #9a5b00;
  font-weight: 800;
}

.service-card {
  margin-top: 22px;
  border-radius: 10px;
  background: #f1f7ff;
  padding: 16px;
}

.service-card p {
  color: var(--muted);
  line-height: 1.6;
}

.service-card a {
  color: var(--blue);
  font-weight: 800;
}

.product-area {
  padding: 22px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.outline-button {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 14px;
}

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

.product-card {
  display: flex;
  min-height: 360px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.product-image {
  display: grid;
  height: 160px;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #e8eef7, #fff4df);
  color: var(--navy);
  font-size: 42px;
  font-weight: 900;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 14px;
}

.product-body h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
}

.product-body p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.tag {
  width: fit-content;
  margin-bottom: 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3150ad;
  padding: 4px 9px;
  font-size: 12px;
}

.price-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
}

.price {
  color: #b12704;
  font-size: 22px;
  font-weight: 900;
}

.add-cart {
  margin-top: 12px;
  border: 0;
  border-radius: 999px;
  background: #ffd814;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 800;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.upload-section {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  margin: 0 5vw 30px;
  padding: 26px;
}

.upload-section p {
  color: var(--muted);
  line-height: 1.7;
}

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

.upload-form label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-weight: 700;
}

.upload-form .full {
  grid-column: 1 / -1;
}

.upload-form input,
.upload-form select,
.upload-form textarea,
#chatForm input {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.upload-form button {
  width: fit-content;
}

.info-sections {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  padding: 0 5vw 36px;
}

.company-card,
.contact-card {
  padding: 26px;
}

.company-card p,
.contact-card p {
  color: var(--muted);
  line-height: 1.8;
}

.company-card li {
  margin: 8px 0;
}

.contact-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.contact-card dl div {
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.contact-card dt {
  color: var(--muted);
  font-size: 13px;
}

.contact-card dd {
  margin: 6px 0 0;
  font-weight: 800;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 24px 5vw;
  background: var(--navy);
  color: #cbd5e1;
  font-size: 14px;
}

.site-footer a {
  color: #fff;
}

.floating-chat {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
}

.chat-toggle {
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  padding: 13px 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-weight: 800;
}

.chat-panel {
  display: none;
  width: min(360px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.chat-panel.open {
  display: block;
}

.chat-panel header {
  display: flex;
  justify-content: space-between;
  background: var(--navy);
  color: #fff;
  padding: 14px;
}

.chat-panel header button,
.dialog-close button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 22px;
}

.chat-messages {
  display: grid;
  align-content: start;
  gap: 10px;
  height: 230px;
  overflow: auto;
  padding: 14px;
}

.chat-messages p {
  max-width: 86%;
  margin: 0;
  border-radius: 12px;
  padding: 10px 12px;
  line-height: 1.5;
}

.chat-messages .bot {
  background: #eef2ff;
}

.chat-messages .user {
  justify-self: end;
  background: #fff7e6;
}

#chatForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

#chatForm button {
  border: 0;
  border-radius: 8px;
  background: var(--orange);
  cursor: pointer;
  font-weight: 800;
}

dialog {
  width: min(560px, calc(100vw - 28px));
  border: 0;
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(2, 6, 23, 0.55);
}

.dialog-close {
  float: right;
}

.dialog-close button {
  color: var(--muted);
}

.cart-items {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
}

.cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.cart-item button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  padding: 6px 8px;
}

.cart-total {
  margin: 18px 0;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: 20px;
}

.payment-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.payment-actions button {
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  padding: 13px;
  font-weight: 900;
}

.alipay {
  background: #1677ff;
}

.wechat {
  background: var(--green);
}

.payment-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.qr-placeholder {
  display: grid;
  width: 190px;
  height: 190px;
  margin: 18px auto;
  place-items: center;
  border: 12px solid #f2f4f7;
  background:
    linear-gradient(90deg, #111 10px, transparent 10px) 0 0 / 28px 28px,
    linear-gradient(#111 10px, transparent 10px) 0 0 / 28px 28px,
    #fff;
  color: #fff;
  font-weight: 900;
}

@media (max-width: 1100px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .topbar {
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 4vw;
  }

  .desktop-nav {
    order: 3;
    width: 100%;
    overflow: auto;
  }

  .hero,
  .content-grid,
  .upload-section,
  .info-sections {
    grid-template-columns: 1fr;
  }

  .search-box {
    grid-template-columns: 1fr;
  }

  .search-box select {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

@media (max-width: 560px) {
  .hero,
  .search-band,
  .content-grid,
  .upload-section,
  .info-sections {
    padding-left: 16px;
    padding-right: 16px;
  }

  .metric-grid,
  .product-grid,
  .upload-form,
  .contact-card dl,
  .payment-actions {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .cart-button {
    margin-left: 0;
  }
}
