/* ==========================================================
   商城 Shop（依赖 style.css 中的变量）
   ========================================================== */
.shop-hero { padding: 3rem 0 1.5rem; background: radial-gradient(circle at 85% 20%, rgba(200,161,90,.18), transparent 45%); }
.cat-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.cat-tabs button { border: 1px solid var(--line); background: #fff; padding: .5em 1.1em; border-radius: 999px; cursor: pointer; font-size: .92rem; color: var(--text); }
.cat-tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.p-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: .2s; position: relative; }
.p-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.p-card img { aspect-ratio: 1; object-fit: cover; width: 100%; background: var(--paper-2); }
.p-card .p-body { padding: .9rem 1rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.p-card h3 { font-family: var(--sans); font-size: 1rem; font-weight: 700; margin: 0; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-card .p-sub { font-size: .82rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.p-meta { display: flex; justify-content: space-between; align-items: baseline; margin-top: auto; padding-top: .4rem; gap: .4rem; }
.price { color: #c0392b; font-weight: 800; font-size: 1.25rem; font-family: var(--sans); white-space: nowrap; }
.price small { font-size: .7em; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: .85rem; margin-left: .4rem; font-weight: 400; }
.p-stat { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.badge-sample { position: absolute; top: .6rem; right: .6rem; background: rgba(255,255,255,.94); color: #a86d10; border: 1px solid #f0c977; font-size: .72rem; font-weight: 700; padding: .1em .6em; border-radius: 999px; z-index: 1; }
.type-pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: .1em .6em; border-radius: 6px; background: var(--teal-soft); color: var(--teal); width: fit-content; }

.pd-grid { display: grid; grid-template-columns: 440px 1fr; gap: 2.5rem; align-items: start; }
.pd-cover { border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); position: relative; }
.pd-cover img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.pd-info h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: .3em; }
.pd-price-box { background: #fff7f3; border-radius: 14px; padding: 1rem 1.2rem; margin: 1rem 0; display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.pd-price-box .price { font-size: 2rem; }
.pd-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: .8rem 0; }
.pd-tags span { font-size: .8rem; border: 1px solid var(--line); background: #fff; padding: .15em .7em; border-radius: 999px; }
.pd-highlights { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .5rem; }
.pd-highlights li { padding-left: 1.6rem; position: relative; }
.pd-highlights li::before { content: "\2713"; position: absolute; left: 0; color: var(--teal); font-weight: 800; }
.pd-section { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem 1.6rem; margin-top: 1.4rem; }
.pd-section h2 { font-size: 1.25rem; }
.pd-outline { padding-left: 1.2rem; margin: 0; }
.pd-outline li { padding: .25rem 0; }
.buy-bar { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.2rem; }
.variant-list { display: grid; gap: .6rem; margin: .4rem 0 1rem; }
.variant-opt { display: grid; grid-template-columns: 1fr auto; gap: .1rem .8rem; text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: .75rem 1rem; cursor: pointer; font-size: .95rem; color: var(--text); }
.variant-opt small { grid-column: 1 / -1; color: var(--muted); font-size: .8rem; }
.variant-opt .price { font-size: 1.05rem; }
.variant-opt.active, .variant-opt:hover { border-color: var(--teal); background: var(--teal-soft); }
.pd-two { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.pd-no li::before { content: "\00d7"; color: #c0392b; }
.spec-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.spec-table th, .spec-table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px dashed var(--line); vertical-align: top; }
.spec-table th { width: 8em; color: var(--muted); font-weight: 600; white-space: nowrap; }
.pd-gallery { display: flex; flex-direction: column; align-items: center; gap: 0; }
.pd-gallery img { width: 100%; max-width: 750px; display: block; }

.rv-summary { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.rv-score { font-size: 2.4rem; font-weight: 800; color: var(--ink); font-family: var(--sans); line-height: 1; }
.stars { color: #f5a623; letter-spacing: .1em; }
.rv-item { border-top: 1px dashed var(--line); padding: .9rem 0; }
.rv-item:first-of-type { border-top: 0; }
.rv-head { display: flex; gap: .7rem; align-items: center; font-size: .88rem; color: var(--muted); flex-wrap: wrap; }
.rv-head b { color: var(--ink); }
.rv-tag { font-size: .72rem; background: #fdf1dc; color: #a86d10; padding: .05em .55em; border-radius: 6px; font-weight: 700; }
.rv-item p { margin: .35rem 0 0; }

.modal-mask { position: fixed; inset: 0; background: rgba(13,28,44,.55); display: none; align-items: center; justify-content: center; z-index: 100; padding: 1rem; }
.modal-mask.open { display: flex; }
.modal { background: #fff; border-radius: 20px; width: min(480px, 100%); max-height: 92vh; overflow: auto; padding: 1.6rem; position: relative; }
.modal h3 { margin-bottom: 1rem; }
.modal .close { position: absolute; right: 1rem; top: .8rem; border: 0; background: none; font-size: 1.6rem; cursor: pointer; color: var(--muted); }
.form-row { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; }
.form-row label { font-size: .88rem; font-weight: 600; }
.form-row input, .form-row textarea { border: 1px solid var(--line); border-radius: 10px; padding: .7em .9em; font-size: 1rem; font-family: inherit; }
.form-row input:focus, .form-row textarea:focus { outline: 2px solid var(--teal-soft); border-color: var(--teal); }
.form-hint { font-size: .8rem; color: var(--muted); }
.form-check { display: flex; gap: .5rem; align-items: flex-start; font-size: .85rem; margin: .4rem 0 1rem; }
.form-error { color: #c0392b; font-size: .88rem; min-height: 1.2em; margin-bottom: .5rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.order-box { max-width: 560px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 1.8rem; }
.order-line { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; font-size: .95rem; }
.order-line span:first-child { color: var(--muted); white-space: nowrap; }
.order-line span:last-child { text-align: right; word-break: break-all; }
.pay-methods { display: grid; gap: .7rem; margin: 1.2rem 0; }
.pay-opt { display: flex; align-items: center; gap: .8rem; border: 1.5px solid var(--line); border-radius: 12px; padding: .9rem 1rem; cursor: pointer; background: #fff; font-size: 1rem; text-align: left; width: 100%; color: var(--text); }
.pay-opt:hover, .pay-opt.active { border-color: var(--teal); background: var(--teal-soft); }
.pay-opt small { display: block; color: var(--muted); font-size: .78rem; }
.pay-opt .ico { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .9rem; flex-shrink: 0; }
.ico-wx { background: #07c160; } .ico-ali { background: #1677ff; } .ico-mock { background: #8a8f98; }
.qr-box { text-align: center; padding: 1rem 0; }
.qr-box svg { width: 220px; height: 220px; }
.status-ok { text-align: center; padding: 1rem 0; }
.status-ok .big { font-size: 3rem; line-height: 1.2; }
.notice { background: var(--teal-soft); color: var(--teal); border-radius: 12px; padding: .8rem 1rem; font-size: .9rem; margin: 1rem 0; }
.notice.warn { background: #fdf1dc; color: #8a5a0c; }

.star-input { display: flex; gap: .3rem; font-size: 2rem; cursor: pointer; color: #ddd; user-select: none; }
.star-input span.on { color: #f5a623; }

.admin-table { width: 100%; border-collapse: collapse; background: #fff; font-size: .86rem; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--line); padding: .55rem .6rem; text-align: left; vertical-align: top; }
.admin-table th { background: var(--paper-2); white-space: nowrap; }
.admin-wrap { overflow-x: auto; }

@media (max-width: 1080px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .pd-grid { grid-template-columns: 1fr; gap: 1.4rem; } .pd-cover { max-width: 420px; } }
@media (max-width: 600px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: .8rem; }
  .p-card .p-body { padding: .7rem .75rem .9rem; }
  .p-card h3 { font-size: .92rem; }
  .price { font-size: 1.1rem; }
  .p-meta { flex-direction: column; align-items: flex-start; }
  .buy-bar.sticky { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; padding: .7rem 4%; margin: 0; box-shadow: 0 -6px 20px rgba(0,0,0,.08); z-index: 40; }
  .buy-bar.sticky .btn { flex: 1; }
  body.has-sticky { padding-bottom: 80px; }
  .order-box { padding: 1.2rem; border-radius: 14px; }
  .pd-section { padding: 1.1rem 1.1rem; }
  .pd-two { grid-template-columns: 1fr; }
}
