/* 之涣的IT市场 — phones first; wider screens get more columns and a side column, not another design */
:root {
  --brand: #1f8f52; --brand-dark: #166b3d; --brand-soft: #e8f5ee;
  --bg: #f5f6f7; --card: #fff; --text: #1a1d21; --muted: #6b7280; --line: #e6e8eb;
  --price: #d4380d; --warn-bg: #fff7e6; --warn: #ad6800;
  --r: 12px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
  --tabbar: 56px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 12px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { margin-top: 20px; }
.page { padding-top: 12px; padding-bottom: 28px; }
.page > * + * { margin-top: 14px; }
.page-title { font-size: 22px; line-height: 1.3; }
.empty { background: var(--card); border-radius: var(--r); padding: 36px 16px; text-align: center; color: var(--muted); }
.empty a { margin-left: 8px; }

/* bars across the top */
.bar { padding: 8px 12px; text-align: center; font-size: 13px; }
.bar-preview { background: #1a1d21; color: #fff; }
.bar-preview a { color: #9be3b8; margin-left: 8px; }
.bar-notice { background: var(--warn-bg); color: var(--warn); }

/* header */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; font-size: 17px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 9px; object-fit: cover; }
.nav { display: none; }
.search { order: 3; flex: 1 1 100%; display: flex; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid transparent; }
.search:focus-within { border-color: var(--brand); background: #fff; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 9px 14px; outline: none; font-size: 15px; -webkit-appearance: none; appearance: none; }
.search button { border: 0; background: transparent; padding: 0 14px; color: var(--muted); cursor: pointer; display: flex; align-items: center; }

/* buttons, tags */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: #cfd3d8; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-light { background: #fff; border-color: #fff; color: var(--brand-dark); }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn-big { min-height: 50px; font-size: 16px; padding: 0 24px; }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; background: var(--brand-soft); color: var(--brand-dark); font-size: 12px; white-space: nowrap; }
.tag-muted { background: #eef0f2; color: var(--muted); }
.price { color: var(--price); font-weight: 700; font-size: 17px; }
.price-big { font-size: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; min-height: 20px; }
.chips span { font-size: 11.5px; line-height: 18px; padding: 0 6px; border-radius: 4px; background: #f0f2f4; color: #4b5563; white-space: nowrap; }
.badge { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; color: #fff; }
.badge-sold { background: rgba(17, 24, 39, .78); }
.badge-soon { position: static; background: var(--warn-bg); color: var(--warn); align-self: flex-start; }
.badge-big { font-size: 15px; padding: 5px 14px; left: 12px; top: 12px; }

/* hero */
.hero { background: linear-gradient(135deg, #1f8f52 0%, #14693a 100%); color: #fff; }
.hero-in { padding-top: 28px; padding-bottom: 28px; }
.hero h1 { font-size: 26px; line-height: 1.25; }
.hero-sub { margin-top: 6px; font-size: 15px; opacity: .95; }
.hero-meta { margin-top: 4px; font-size: 13px; opacity: .8; }
.hero-btns { display: flex; gap: 10px; margin-top: 16px; }

/* home blocks */
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.block > .head:first-child { margin-top: 0; }
.head h2 { font-size: 18px; }
.head a { font-size: 13px; white-space: nowrap; }
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cat { background: var(--card); border-radius: var(--r); padding: 12px 10px; box-shadow: var(--shadow); color: var(--text); text-align: center; }
.cat:hover { text-decoration: none; outline: 2px solid var(--brand-soft); }
.cat b { display: block; font-size: 16px; }
.cat span { font-size: 12px; color: var(--muted); }
.service { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); color: var(--text); }
.service:hover { text-decoration: none; }
.service h2 { font-size: 17px; }
.service p { color: var(--muted); font-size: 13px; }
.steps { display: grid; gap: 8px; counter-reset: step; }
.steps li { background: var(--card); border-radius: var(--r); padding: 12px 14px 12px 48px; position: relative; box-shadow: var(--shadow); counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 12px; top: 13px; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark);
  font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.steps b { display: block; }
.steps span { color: var(--muted); font-size: 13px; }

/* product grid */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.card { background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); color: var(--text); display: flex; flex-direction: column; }
.card:hover { text-decoration: none; box-shadow: 0 4px 14px rgba(16, 24, 40, .1); }
.card-img { position: relative; aspect-ratio: 1; background: #eceef0; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.card-title { font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; }
.is-sold .card-img img { filter: grayscale(.6); opacity: .8; }
.is-sold .price { color: var(--muted); }
.soon-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.soon-card { background: var(--card); border-radius: var(--r); padding: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.soon-cat { font-size: 12px; color: var(--muted); }
.soon-title { font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }

/* shelf: tabs, filters, sorting */
.crumbs { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-left: -12px; margin-right: -12px; padding: 2px 12px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; min-height: 38px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; background: var(--card); color: var(--text); border: 1px solid var(--line); font-size: 14px; }
.tabs a:hover { text-decoration: none; }
.tabs a.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.tabs i, .facet-vals i { font-style: normal; font-size: 12px; opacity: .65; margin-left: 3px; }
.filters-fold { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.filters-fold > summary { list-style: none; cursor: pointer; padding: 11px 14px; font-weight: 600; display: flex; justify-content: space-between; }
.filters-fold > summary::-webkit-details-marker { display: none; }
.filters-fold > summary::after { content: '展开 ▾'; font-weight: 400; color: var(--muted); font-size: 13px; }
.filters-fold[open] > summary::after { content: '收起 ▴'; }
.facet { padding: 4px 14px 12px; }
.facet h4 { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
.facet-vals { display: flex; flex-wrap: wrap; gap: 6px; }
.facet-vals a { min-height: 36px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 8px; background: #f0f2f4; color: var(--text); font-size: 13.5px; }
.facet-vals a:hover { text-decoration: none; background: #e6e9ec; }
.facet-vals a.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.range { display: flex; align-items: center; gap: 6px; }
.range input { width: 0; flex: 1; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; }
.clear { font-size: 13px; display: inline-block; margin-top: 6px; }
.sortbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 10px; font-size: 13px; }
.sorts { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.sorts a { flex: none; padding: 6px 10px; border-radius: 8px; color: var(--muted); white-space: nowrap; }
.sorts a.on { color: var(--brand-dark); background: var(--brand-soft); font-weight: 600; }
.sorts a:hover { text-decoration: none; }

/* product page */
.detail { display: grid; gap: 14px; }
.gallery { min-width: 0; }
.slides { position: relative; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--card); border-radius: var(--r); margin-left: -12px; margin-right: -12px; border-radius: 0; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: #f0f1f3; }
.slide img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.thumbs button { flex: none; width: 60px; height: 60px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #eceef0; cursor: pointer; }
.thumbs button.on { border-color: var(--brand); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.info { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.info h1 { font-size: 19px; line-height: 1.4; }
.price-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.facts { display: grid; gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.facts > div { display: flex; gap: 12px; background: var(--card); padding: 10px 14px; }
.facts dt { flex: none; width: 4.5em; color: var(--muted); }
.facts dd { min-width: 0; overflow-wrap: anywhere; }
.buy { display: none; gap: 10px; }
.prose { background: var(--card); border-radius: var(--r); padding: 16px; white-space: pre-line; overflow-wrap: anywhere; box-shadow: var(--shadow); line-height: 1.8; }
.service-head { display: flex; gap: 14px; align-items: center; }
.service-head img { width: 96px; height: 96px; border-radius: var(--r); object-fit: cover; flex: none; }

/* contact */
.contacts { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.contact { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.contact:first-child { border-top: 0; }
.contact > span { flex: none; width: 3em; color: var(--muted); }
.contact b { flex: 1; min-width: 0; font-size: 16px; overflow-wrap: anywhere; user-select: all; }
.contact em { flex: 1 1 100%; font-style: normal; color: var(--muted); font-size: 13px; padding-left: calc(3em + 10px); }
.codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.codes figure { background: var(--card); border-radius: var(--r); padding: 14px; text-align: center; box-shadow: var(--shadow); }
.codes img { width: 100%; max-width: 220px; margin: 0 auto 8px; border-radius: 8px; }
.codes figcaption { font-size: 13px; }

/* footer */
.foot { margin-top: 32px; background: var(--card); border-top: 1px solid var(--line); padding: 20px 0 16px; font-size: 14px; }
.foot-in { display: grid; gap: 12px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.foot-links a { padding: 6px 0; }

/* the bottom bars of a phone */
.tabbar, .actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
.tabbar { display: grid; grid-template-columns: repeat(4, 1fr); height: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px; color: var(--muted); }
.tabbar a:hover { text-decoration: none; }
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tabbar a.on { color: var(--brand-dark); font-weight: 600; }
.actionbar { display: flex; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
.actionbar .btn { flex: none; }
.actionbar .btn-primary { flex: 1; min-width: 0; }
.has-actionbar { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

/* the sheet that goes on to Xianyu; the small word after copying */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .5); display: flex; align-items: flex-end; justify-content: center; }
.sheet-box { position: relative; width: 100%; max-width: 420px; background: #fff; border-radius: 16px 16px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
.sheet-box h3 { font-size: 17px; margin-bottom: 10px; padding-right: 32px; }
.sheet-x { position: absolute; right: 8px; top: 8px; width: 40px; height: 40px; border: 0; background: transparent; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; }
.sheet-body-qr { text-align: center; }
.sheet-body-qr img { width: 220px; height: 220px; margin: 4px auto 10px; }
.sheet-rows { display: grid; gap: 8px; margin-top: 12px; }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: rgba(17, 24, 39, .92); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 14px; }

/* the page while the site is closed */
.closed { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.closed-box { text-align: center; }
.closed-box img { margin: 0 auto 14px; border-radius: 18px; }
.closed-box h1 { font-size: 22px; }
.closed-box p { color: var(--muted); margin-top: 6px; }

/* ------------------------------------------------------------------ wider than a phone */
@media (min-width: 640px) {
  .wrap { padding: 0 20px; }
  .grid, .soon-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .cats { grid-template-columns: repeat(5, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .steps-col { grid-template-columns: 1fr; }
  .tabs, .slides { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  .slides { border-radius: var(--r); overflow: hidden; overflow-x: auto; }
  .sheet { align-items: center; }
  .sheet-box { border-radius: 16px; }
}
@media (min-width: 900px) {
  body, .has-actionbar { padding-bottom: 0; font-size: 15.5px; }
  .tabbar, .actionbar { display: none; }
  .top-in { flex-wrap: nowrap; padding-top: 12px; padding-bottom: 12px; gap: 24px; }
  .brand { font-size: 19px; }
  .nav { display: flex; gap: 4px; flex: 1; min-width: 0; }
  .nav a { padding: 8px 12px; border-radius: 8px; color: var(--text); white-space: nowrap; font-size: 15px; }
  .nav a:hover { background: var(--bg); text-decoration: none; }
  .nav a.on { color: var(--brand-dark); font-weight: 600; background: var(--brand-soft); }
  .search { order: 0; flex: 0 1 300px; }
  .hero-in { padding-top: 56px; padding-bottom: 56px; }
  .hero h1 { font-size: 40px; }
  .hero-sub { font-size: 18px; }
  .hero-meta { font-size: 14px; }
  .block { margin-top: 36px; }
  .head h2 { font-size: 22px; }
  .page { padding-top: 20px; padding-bottom: 48px; }
  .page-title { font-size: 28px; }
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
  .soon-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .cats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
  .cat { padding: 18px 12px; }
  .card-title { font-size: 15px; }
  .shelf { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
  .filters { position: sticky; top: 76px; }
  .filters-fold > summary { pointer-events: none; }
  .filters-fold > summary::after { content: none !important; }
  .grid-shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sortbar { margin-top: 0; }
  .detail { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .info h1 { font-size: 26px; }
  .price-big { font-size: 34px; }
  .buy { display: flex; }
  .foot-in { grid-template-columns: 1fr auto; }
  .foot-in > p { grid-column: 1 / -1; }
  .toast { bottom: 40px; }
}
@media (min-width: 900px) and (max-width: 1100px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav a { padding: 8px 8px; font-size: 14px; }
}
@media (prefers-reduced-motion: no-preference) { .slides { scroll-behavior: smooth; } }
