/* 永续科技 · 简洁浅色风格 */
:root {
  --bg: #f2f2f2;
  --surface: #ffffff;
  --ink: #222222;
  --ink-soft: #555555;
  --muted: #888888;
  --line: #e6e6e6;
  --line-strong: #d9d9d9;
  --search-bg: #ececec;
  --price: #e8871e;
  --tag-bg: #eef6ff;
  --tag-text: #3b82c4;
  --btn-dark: #3a3a3a;
  --radius: 12px;
  --radius-sm: 8px;
  --max: 1100px;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  background: var(--bg);
  line-height: 1.55;
  font-size: 14px;
}

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

button,
input {
  font: inherit;
}

/* —— Topbar —— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid transparent;
}

.topbar__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand__logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #1a1a1a;
  color: #f5c542;
  font-weight: 700;
  font-size: 16px;
}

.brand__name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.search {
  display: flex;
  align-items: center;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  background: var(--search-bg);
  border-radius: 999px;
  padding: 2px 4px 2px 16px;
  border: 1px solid transparent;
}

.search:focus-within {
  border-color: #cfcfcf;
  background: #fff;
}

.search input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  padding: 10px 0;
  min-width: 0;
  color: var(--ink);
}

.search input::placeholder {
  color: #a0a0a0;
}

.search__btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #666;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.search__btn:hover {
  color: var(--ink);
}

.topbar__actions {
  display: flex;
  gap: 10px;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--ink);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn--outline {
  border-color: #c8c8c8;
  background: transparent;
  color: #444;
}

.btn--outline:hover {
  border-color: #999;
  background: #fff;
}

.btn--dark {
  background: var(--btn-dark);
  color: #fff;
  border-color: var(--btn-dark);
}

.btn--dark:hover {
  background: #2a2a2a;
}

.btn--wechat {
  background: #07c160;
  color: #fff;
  border-color: #07c160;
  box-shadow: 0 8px 18px rgba(7, 193, 96, 0.28);
}

.btn--wechat:hover {
  background: #06a552;
  border-color: #06a552;
}

.btn--wechat svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

.btn--buy {
  padding: 7px 16px;
  gap: 5px;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: #333;
}

.drawer {
  position: fixed;
  inset: 68px 0 auto 0;
  z-index: 35;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer[hidden] {
  display: none;
}

.search--drawer {
  max-width: none;
  margin: 0;
}

.drawer__nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* —— Banner —— */
.banner-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

.banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #111;
  box-shadow: var(--shadow);
}

.banner__track {
  display: flex;
  transition: transform 0.5s ease;
}

.banner__slide {
  flex: 0 0 100%;
  min-width: 100%;
  line-height: 0;
}

.banner__slide a,
.banner__slide img {
  display: block;
  width: 100%;
}

.banner__slide img {
  width: 100%;
  height: auto;
  object-fit: contain;
  vertical-align: top;
}

.banner__dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.banner__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
}

.banner__dot.is-active {
  width: 18px;
  background: #fff;
}

/* —— Notice —— */
.notice {
  max-width: var(--max);
  margin: 14px auto 0;
  padding: 0 16px;
}

.notice__inner {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: var(--shadow);
}

.notice__label {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--price);
  line-height: 1.6;
}

.notice__text {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

/* —— Catalog —— */
.catalog {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 16px 40px;
}

.category-block {
  margin-bottom: 22px;
}

.category-block__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px 4px;
}

.category-block__head .icon {
  width: 18px;
  height: 18px;
  color: #666;
  flex-shrink: 0;
}

.category-block__head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.table-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-head,
.product-row {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) 110px 70px 110px 100px;
  gap: 8px;
  align-items: center;
  padding: 0 18px;
}

.table-head {
  padding-top: 14px;
  padding-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  border-bottom: 1px dashed var(--line);
}

.product-row {
  min-height: 72px;
  padding-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}

.product-row:last-child {
  border-bottom: none;
}

.product-row:hover {
  background: #fafafa;
}

.product-name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.thumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
  flex-shrink: 0;
}

.product-name__text {
  min-width: 0;
}

.product-name__text strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-name__text span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid #d6e8f8;
  white-space: nowrap;
}

.badge--manual {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.product-stock {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.product-price {
  color: var(--price);
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.product-action {
  justify-self: end;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
  background: var(--surface);
  border-radius: var(--radius);
}

/* —— Footer —— */
.footer {
  border-top: 1px solid var(--line);
  padding: 24px 16px 36px;
  color: var(--muted);
  font-size: 13px;
}

.footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.footer p {
  margin: 0;
}

.footer strong {
  color: var(--ink);
}

/* —— Modal —— */
.modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: calc(100vw - 2rem);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.modal__panel {
  width: min(420px, 92vw);
  margin: auto;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

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

.modal__panel > header h3 {
  margin: 0;
  font-size: 16px;
}

.modal__close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.modal__body {
  padding: 16px;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 16px 16px;
}

.kv {
  margin: 0;
}

.kv > div {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

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

.kv dd {
  margin: 0;
  font-weight: 600;
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font-size: 13px;
  font-weight: 600;
}

.field input {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  outline: none;
}

.field input:focus {
  border-color: #999;
}

.buy-summary {
  margin: 0;
  color: var(--ink-soft);
}

.buy-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.buy-meta div {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #f7f7f7;
}

.buy-meta dt {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--muted);
}

.buy-meta dd {
  margin: 0;
  font-weight: 700;
}

.buy-price {
  color: var(--price);
  font-size: 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 80;
  background: #222;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

.toast[hidden] {
  display: none;
}

@media (max-width: 860px) {
  .topbar__inner {
    grid-template-columns: 1fr auto;
  }

  .search,
  .topbar__actions {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .table-head {
    display: none;
  }

  .table-head,
  .product-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "name name"
      "type stock"
      "price action";
    gap: 8px 10px;
    padding: 14px 14px;
  }

  .product-name {
    grid-area: name;
  }

  .product-type {
    grid-area: type;
  }

  .product-stock {
    grid-area: stock;
    text-align: right;
  }

  .product-price {
    grid-area: price;
  }

  .product-action {
    grid-area: action;
  }

  .product-name__text strong,
  .product-name__text span {
    white-space: normal;
  }

  .buy-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .brand__name {
    font-size: 14px;
  }

  .brand__logo {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }
}

/* —— Detail page —— */
.topbar__inner--detail {
  grid-template-columns: 1fr auto;
}

.detail-page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 16px 100px;
}

.detail-loading,
.detail-empty {
  text-align: center;
  padding: 64px 16px;
  color: var(--muted);
}

.detail-empty h1 {
  color: var(--ink);
  font-size: 20px;
}

.crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.crumb a:hover {
  color: var(--ink);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 14px;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.detail-hero__media {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f0f0f0;
  line-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  width: 100%;
}

.detail-hero__media img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

.detail-hero__cat {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.detail-hero__info h1 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.35;
}

.detail-hero__summary {
  margin: 0 0 12px;
  color: var(--ink-soft);
}

.chip {
  display: inline-block;
  margin: 0 6px 8px 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f3f3f3;
  color: #555;
  font-size: 12px;
}

.detail-hero__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.detail-hero__meta > div {
  background: #f7f7f7;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.detail-hero__meta dt {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.detail-hero__meta dd {
  margin: 0;
  font-weight: 600;
}

.detail-price {
  color: var(--price) !important;
  font-size: 20px;
  font-weight: 700 !important;
}

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

.detail-specs h2,
.detail-body .detail-h {
  margin: 0 0 14px;
  font-size: 17px;
}

.detail-body .detail-h {
  margin-top: 22px;
  padding-top: 6px;
}

.detail-body .detail-h:first-child {
  margin-top: 0;
}

.detail-p {
  margin: 0 0 12px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.detail-highlight {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(220, 38, 38, 0.06);
  border-left: 3px solid #dc2626;
  color: #dc2626;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.65;
}

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

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

.specs-grid > div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
  padding: 10px 12px;
  background: #f7f7f7;
  border-radius: var(--radius-sm);
}

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

.specs-grid dd {
  margin: 0;
  font-weight: 600;
}

.detail-gallery {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 12px 0 16px;
  width: 100%;
}

.detail-gallery figure {
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.detail-gallery img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  cursor: zoom-in;
  background: #f0f0f0;
}

.detail-gallery figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.code-block {
  margin: 12px 0 16px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid #e0e0e0;
  background: #1e1e1e;
}

.code-block__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: #2a2a2a;
  color: #ccc;
  font-size: 12px;
}

.code-copy {
  border: 1px solid #555;
  background: transparent;
  color: #ddd;
  border-radius: 999px;
  padding: 2px 10px;
  cursor: pointer;
  font-size: 12px;
}

.code-copy:hover {
  background: #3a3a3a;
}

.code-block__pre {
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  color: #e8e8e8;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.6;
}

.tree-pre {
  color: #d4edda;
}

.detail-table-wrap {
  overflow: auto;
  margin: 10px 0 16px;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.detail-table th,
.detail-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
}

.detail-table th {
  color: var(--muted);
  font-weight: 500;
  background: #fafafa;
}

.buy-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.buy-bar__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.buy-bar__price {
  color: var(--price);
  font-size: 14px;
}

.buy-bar__price strong {
  font-size: 22px;
}

.buy-bar__actions {
  display: flex;
  gap: 8px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: min(960px, 100%);
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox p {
  color: #ddd;
  margin: 10px 0 0;
  font-size: 13px;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
}

@media (max-width: 860px) {
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .detail-hero__meta,
  .specs-grid {
    grid-template-columns: 1fr;
  }

  .specs-grid > div {
    grid-template-columns: 72px 1fr;
  }

  .topbar__inner--detail .topbar__actions .btn--outline:first-child {
    display: none;
  }
}

/* —— WeChat modal（对齐 teenpatti-landing） —— */
.wx-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.wx-modal.is-open {
  display: flex;
}

.wx-modal__mask {
  position: absolute;
  inset: 0;
  background: rgba(8, 24, 16, 0.55);
  backdrop-filter: blur(6px);
}

.wx-modal__panel {
  position: relative;
  z-index: 1;
  width: min(360px, 100%);
  padding: 28px 24px 22px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 28px 60px rgba(22, 33, 27, 0.28);
  text-align: center;
}

.wx-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: #f1f5f0;
  color: #425047;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.wx-modal__close:hover {
  background: #e8f5ec;
  color: #0f7d4f;
}

.wx-modal__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(7, 193, 96, 0.12);
  color: #07c160;
  font-size: 13px;
  font-weight: 800;
}

.wx-modal__badge svg {
  display: block;
}

.wx-modal h3 {
  margin: 0 0 8px;
  font-size: 22px;
  color: var(--ink);
}

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

.wx-modal__qr {
  width: 220px;
  height: 220px;
  margin: 0 auto 18px;
  padding: 12px;
  border-radius: 14px;
  background: #f7faf6;
  border: 1px solid var(--line);
}

.wx-modal__qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.wx-modal__id {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f4f8f3;
  border: 1px solid var(--line);
  text-align: left;
}

.wx-modal__id-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.wx-modal__id-value {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  word-break: break-all;
}

.wx-modal__copy {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: #07c160;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.wx-modal__copy:hover {
  background: #06ad56;
}

.wx-modal__badge--qq {
  background: rgba(18, 183, 245, 0.12);
  color: #12b7f5;
}

.wx-modal__copy--qq {
  background: #12b7f5;
}

.wx-modal__copy--qq:hover {
  background: #0ea5e0;
}

.wx-modal__copy--qq.is-done {
  background: #0284c7;
}

