:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --text: #17202a;
  --muted: #687381;
  --line: #dfe4ea;
  --panel: #ffffff;
  --brand: #0f766e;
  --brand-dark: #0b5954;
  --accent: #d97706;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 5vw, 64px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  min-height: 220px;
  padding: 42px 0 28px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 1;
  letter-spacing: 0;
}

.hero p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.intro {
  margin: 0 0 22px;
  padding: 18px 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 54px;
}

.product-card {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(23, 32, 42, 0.11);
}

.cover {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  background: #e8edf1;
  color: var(--muted);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

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

.product-body {
  padding: 16px;
}

.product-body h2 {
  margin: 0 0 8px;
  font-size: 19px;
}

.code {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #eef2f7;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.product-body p {
  min-height: 48px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

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

.tags span {
  padding: 4px 9px;
  border: 1px solid #b9d7d2;
  border-radius: 999px;
  background: #effaf8;
  color: #075b54;
  font-size: 12px;
  font-weight: 700;
}

.button,
.ghost,
.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.button {
  background: var(--brand);
  color: #fff;
}

.button:hover {
  background: var(--brand-dark);
}

.ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.danger {
  background: #fff4f2;
  color: var(--danger);
  border-color: #ffd2cc;
}

.detail {
  padding: 30px 0 70px;
}

.detail-head {
  display: grid;
  grid-template-columns: minmax(280px, 440px) 1fr;
  gap: 34px;
  align-items: start;
  margin-bottom: 34px;
}

.product-detail-template {
  grid-template-columns: minmax(300px, 520px) minmax(260px, 380px);
  justify-content: start;
}

.product-media {
  display: grid;
  gap: 14px;
}

.product-meta-under {
  display: grid;
  gap: 8px;
}

.product-meta-under .code {
  margin-bottom: 0;
}

.product-buy-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 100%;
}

.detail-cover {
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #e8edf1;
  border-radius: 8px;
}

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

.detail h1 {
  margin: 14px 0 10px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.1;
}

.detail p {
  color: var(--muted);
}

.detail-actions {
  margin: 18px 0;
}

.buy-card,
.inline-qr,
.float-buy {
  display: grid;
  gap: 8px;
  width: 132px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.buy-card img,
.inline-qr img,
.float-buy img {
  width: 110px;
  height: 110px;
  object-fit: contain;
}

.buy-card {
  grid-template-columns: auto 1fr;
  align-items: center;
  width: min(300px, 100%);
  margin-top: 0;
  padding: 12px;
  background: linear-gradient(135deg, #ffffff, #edf5ff);
  border-color: #b9cdf8;
  box-shadow: 0 12px 28px rgba(47, 111, 228, 0.12);
  text-align: left;
}

.buy-card strong,
.buy-card span {
  display: block;
}

.buy-card strong {
  color: #173b75;
  font-size: 16px;
}

.buy-card span {
  color: var(--muted);
}

.buy-card img {
  width: 86px;
  height: 86px;
  border-radius: 8px;
  background: #fff;
}

.material-button {
  width: min(300px, 100%);
}

.float-buy {
  position: fixed;
  right: 18px;
  bottom: 72px;
  z-index: 30;
  box-shadow: 0 12px 30px rgba(23, 32, 42, 0.12);
}

.content {
  overflow-wrap: anywhere;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.content h2,
.content h3 {
  margin-top: 28px;
}

.content table {
  width: 100%;
  border-collapse: collapse;
}

.content th,
.content td {
  padding: 10px;
  border: 1px solid var(--line);
}

.spec-block {
  margin: 0 0 28px;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.feature-list div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.feature-list strong,
.feature-list span {
  display: block;
}

.feature-list span {
  color: var(--muted);
  font-size: 14px;
}

.manual-hero-image {
  width: min(680px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.manual-image-grid img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.lookup {
  padding: 48px 0 70px;
}

.lookup-panel,
.admin-section,
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.lookup-panel {
  padding: 26px;
}

.lookup-form {
  display: flex;
  gap: 12px;
}

input,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

textarea {
  resize: vertical;
  font-family: Consolas, "Microsoft YaHei", monospace;
}

.notice {
  padding: 10px 12px;
  border-radius: 6px;
}

.notice.error {
  color: var(--danger);
  background: #fff4f2;
}

.notice.success {
  color: #066047;
  background: #ecfdf5;
}

.material {
  margin-top: 24px;
}

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

.admin-login {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.login-card {
  width: min(420px, calc(100% - 32px));
  padding: 26px;
}

.login-card label,
.editor-form label,
.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.admin {
  padding: 28px 0 70px;
}

.admin-top,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-section {
  margin-top: 18px;
  padding: 20px;
}

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

.wide {
  grid-column: 1 / -1;
}

.check {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.check input {
  width: auto;
}

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

.admin-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.admin-row small {
  display: block;
  color: var(--muted);
}

.admin-thumb {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.site-footer {
  padding: 26px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line);
}

@media (max-width: 820px) {
  .site-header,
  .hero,
  .admin-top,
  .section-head,
  .lookup-form {
    align-items: stretch;
    flex-direction: column;
  }

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

  .detail-head,
  .feature-list,
  .manual-image-grid,
  .form-grid,
  .editor-form,
  .admin-row {
    grid-template-columns: 1fr;
  }

  .float-buy {
    position: static;
    width: min(180px, 100%);
    margin: 0 auto 24px;
  }
}

@media (max-width: 520px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  nav {
    flex-wrap: wrap;
  }
}
