/* Secondhand Phone Market — 全站样式（零依赖，单文件） */
:root {
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-2: #f7f9fc;
  --bg-3: #eef2f8;
  --accent: #0f172a;
  --accent-2: #2563eb;
  --ok: #0f766e;
  --warn-bg: #fff8e6;
  --warn-line: #f0d089;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --wrap: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.015em; }
h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem); }
h2 { font-size: clamp(1.4rem, 1.05rem + 1.4vw, 2rem); margin-top: 0; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 18px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--ink); color: #fff; font-size: .78rem; letter-spacing: .04em;
}
.brand-name { font-size: 1rem; }
.nav { display: flex; gap: 16px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--ink-2); font-size: .92rem; }
.cart-link {
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
  color: var(--ink); font-size: .9rem; white-space: nowrap;
}
.cart-link:hover { text-decoration: none; border-color: var(--ink); }
.cart-count {
  display: inline-block; min-width: 20px; text-align: center;
  background: var(--ink); color: #fff; border-radius: 999px;
  font-size: .74rem; padding: 1px 6px; margin-left: 4px;
}

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(1200px 420px at 12% -10%, #e8efff 0%, rgba(232, 239, 255, 0) 62%),
    linear-gradient(180deg, var(--bg-2), #fff);
  border-bottom: 1px solid var(--line);
  padding: 64px 0 52px;
}
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; color: var(--muted); margin-bottom: 10px; }
.lede { font-size: 1.1rem; color: var(--ink-2); max-width: 62ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 20px; }

.btn {
  display: inline-block; background: var(--ink); color: #fff;
  border: 1px solid var(--ink); border-radius: 999px;
  padding: 12px 22px; font-size: .96rem; font-weight: 600;
  cursor: pointer; text-align: center;
}
.btn:hover { background: #1e293b; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--bg-3); }
.btn.wide { display: block; width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.chips li {
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px; font-size: .84rem; color: var(--ink-2);
}

/* ---------- sections ---------- */
.section { padding: 46px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-lede { font-size: 1.05rem; color: var(--ink-2); max-width: 68ch; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }

/* ---------- grades ---------- */
.grade-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); list-style: none; padding: 0; margin: 0 0 16px; }
.grade-card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
}
.grade-tag { font-weight: 700; margin: 0 0 2px; }
.grade-alias { color: var(--accent-2); font-size: .92rem; margin: 0 0 10px; }

/* ---------- product cards ---------- */
.cards {
  list-style: none; padding: 0; margin: 24px 0 0;
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
}
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: box-shadow .18s ease, transform .18s ease;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-link { display: block; padding: 18px; color: var(--ink); }
.card-link:hover { text-decoration: none; }
.card img { display: block; margin: 0 auto 8px; }
.card h3 { font-size: 1.02rem; margin: 0 0 4px; }
.card-meta { color: var(--muted); font-size: .82rem; margin: 0 0 10px; }
.card-price { font-size: 1.25rem; font-weight: 700; margin: 0; }
.card-price .from { font-size: .74rem; font-weight: 400; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.card-sub { color: var(--muted); font-size: .82rem; margin: 4px 0 0; }
.small-cards { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.small-cards .card-link { padding: 14px; }

/* ---------- lists ---------- */
.tick-list { list-style: none; padding: 0; margin: 0 0 16px; }
.tick-list li { position: relative; padding-left: 26px; margin-bottom: 9px; color: var(--ink-2); }
.tick-list li::before {
  content: ""; position: absolute; left: 4px; top: .62em;
  width: 8px; height: 8px; border-radius: 2px; background: var(--ok);
}
.tick-list.small li { font-size: .9rem; margin-bottom: 6px; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 46px; margin-bottom: 16px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: .86rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.notice {
  background: var(--warn-bg); border: 1px solid var(--warn-line);
  border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 16px; color: #6b4c05;
}
.notice-box { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.warn-box { background: var(--bg-3); border-left: 4px solid var(--accent-2); padding: 18px 20px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.warn-box ul { margin: 0; padding-left: 20px; }
.warn-box li { margin-bottom: 8px; }
.warn-box em { color: #9a3412; font-style: normal; font-weight: 600; }
.warn { color: #9a3412; font-weight: 600; }

/* ---------- facts ---------- */
.facts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.fact { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.fact h3 { margin: 0 0 8px; font-size: .95rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.fact p:last-child { margin-bottom: 0; }

/* ---------- faq ---------- */
.faq { display: grid; gap: 10px; }
.faq-item { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 18px; }
.faq-item summary { cursor: pointer; font-weight: 600; padding: 15px 0; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; float: right; color: var(--muted); font-weight: 400; }
.faq-item[open] summary::after { content: "\2013"; }
.faq-body { padding-bottom: 14px; color: var(--ink-2); }

/* ---------- tables ---------- */
.compare, .specs { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: .94rem; }
.compare th, .compare td, .specs th, .specs td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { background: var(--bg-2); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.specs th { width: 38%; color: var(--muted); font-weight: 500; }
.table-scroll { overflow-x: auto; }

/* ---------- product page ---------- */
.product-grid { display: grid; gap: 34px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.product-media { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.product-media img { display: block; margin: 0 auto; }
.gallery-main-link { display: block; border-radius: 10px; overflow: hidden; background: #fff; }
.gallery-main { width: 100%; height: auto; border-radius: 10px; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.gallery-thumbs a { display: block; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.gallery-thumbs img { width: 100%; height: auto; transition: transform .2s ease; }
.gallery-thumbs a:hover img { transform: scale(1.04); }
.sample-note { margin: 12px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.sale-flag { display: inline-block; background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; border-radius: 999px; padding: 2px 7px; font-size: .68rem; font-weight: 700; vertical-align: 2px; }
.card img { aspect-ratio: 1 / 1; object-fit: cover; border-radius: 10px; }
.product-sub { color: var(--muted); }
.buy { margin: 22px 0 0; }
.opt { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px 16px; margin: 0 0 14px; }
.opt legend { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 0 6px; }
.opt-pill { display: inline-flex; margin: 0 8px 8px 0; }
.opt-pill input { position: absolute; opacity: 0; pointer-events: none; }
.opt-pill span {
  display: inline-block; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 15px; font-size: .9rem; cursor: pointer; background: #fff;
}
.opt-pill input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.opt-pill input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.price { font-size: 2rem; font-weight: 700; }
.crumbs { font-size: .86rem; color: var(--muted); margin-bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- cart / checkout ---------- */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.cart-table th, .cart-table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; }
.cart-table td.num, .cart-table th.num { text-align: right; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.2rem; font-weight: 700; padding: 14px 0; border-top: 2px solid var(--ink); }
.cart-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.qty-input { width: 64px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.link-btn { background: none; border: 0; color: var(--accent-2); cursor: pointer; font: inherit; padding: 0; }
.empty { background: var(--bg-2); border: 1px dashed var(--line); border-radius: var(--radius); padding: 30px; text-align: center; }

.checkout-grid { display: grid; gap: 30px; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.checkout-form h2 { margin-top: 0; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: .86rem; color: var(--muted); margin-bottom: 5px; }
.field input, .field select {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; border-color: var(--accent-2); }
.field-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: 9px; padding: 12px 14px; }
.checkout-aside { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }

.summary-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.summary-line:last-of-type { border-bottom: 0; }
.summary-line span:last-child { white-space: nowrap; }
.summary-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.15rem; padding-top: 12px; margin-top: 6px; border-top: 2px solid var(--ink); }

.order-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.order-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.status {
  display: inline-block; border-radius: 999px; padding: 4px 12px;
  font-size: .82rem; font-weight: 600; background: var(--bg-3); color: var(--ink-2);
}
.status.paid { background: #dcfce7; color: #166534; }
.status.shipped { background: #dbeafe; color: #1e40af; }
.status.refunded { background: #fee2e2; color: #991b1b; }
.status.cancelled { background: #f1f5f9; color: var(--muted); }
.pay-grid { display: grid; gap: 26px; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); align-items: start; margin-top: 22px; }
.qr-frame { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; }
.qr-frame img { display: block; margin: 0 auto 10px; width: 100%; max-width: 260px; aspect-ratio: 1 / 1; }
.amount-big { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem); font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; }
.order-meta { font-size: .92rem; color: var(--ink-2); }
.order-meta dt { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; margin-top: 12px; }
.order-meta dd { margin: 2px 0 0; }

/* ---------- footer ---------- */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line); margin-top: 40px; padding: 44px 0 26px; }
.footer-grid { display: grid; gap: 26px; grid-template-columns: 2fr 1fr 1fr 1.4fr; }
.footer-brand { font-weight: 700; margin: 0 0 6px; }
.footer-head { font-size: .84rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 7px; font-size: .92rem; }
.footer-legal { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 18px; }

/* ---------- responsive ---------- */
/* ---------- 视频区块（后台「Videos」页签上架，前台自动出现） ---------- */
.video-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-bottom: 8px; }
.video-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.video-card h3 { font-size: 1rem; margin: 12px 0 4px; }
.video-card p:last-child { margin-bottom: 0; }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #0b1220; border-radius: var(--radius-sm); overflow: hidden; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; object-fit: contain; }
.video-facade { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #0b1220 center/cover no-repeat; cursor: pointer; }
.video-facade::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15, 23, 42, .15), rgba(15, 23, 42, .5)); }
.video-play { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: 999px; padding: 12px 20px; background: rgba(255, 255, 255, .94); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; box-shadow: var(--shadow); }
.video-play:hover { background: #fff; }
.video-play-icon { font-size: .9rem; }

/* ---------- 公司主体信息（data/site.json 的 legal.entities） ---------- */
.entity-list { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.entity { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.entity-role { margin: 0 0 6px; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.entity h3 { margin: 0 0 12px; font-size: 1.05rem; }
.entity-zh { display: block; font-size: .9rem; font-weight: 400; color: var(--muted); }
.entity-rows { display: grid; grid-template-columns: minmax(130px, 42%) 1fr; gap: 5px 14px; margin: 0 0 14px; font-size: .88rem; }
.entity-note { grid-column: 1 / -1; margin: 0; }
.entity-rows dt { color: var(--muted); }
.entity-rows dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.entity .tick-list li { font-size: .9rem; }
@media (max-width: 640px) { .entity-rows { grid-template-columns: 1fr; } .entity-rows dd { margin-bottom: 8px; } }

@media (max-width: 900px) {
  .product-grid, .checkout-grid, .pay-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; padding: 10px 0; gap: 10px; }
  .nav { order: 3; width: 100%; margin-left: 0; gap: 12px; overflow-x: auto; }
  .cart-link { margin-left: auto; }
  .field-row { grid-template-columns: 1fr; }
  .hero { padding: 42px 0 36px; }
  .section { padding: 34px 0; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media print {
  .site-header, .site-footer, .hero-actions { display: none; }
}