/* 优品甄选 · 商城样式 */
:root {
  --ink: #1c1c1e;
  --ink-2: #4a4a4f;
  --ink-3: #86868b;
  --line: #e6e6ea;
  --bg: #ffffff;
  --bg-2: #f7f7f9;
  --accent: #d2451e;
  --ok: #1a7f4b;
  --bad: #c0272d;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .04em;
}
.topbar nav a {
  margin-left: 20px;
  color: var(--ink-2);
  font-size: 14px;
}
.topbar nav a:hover { color: var(--accent); }

/* 容器 */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

/* 首屏 */
.hero {
  padding: 24px 0 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.hero h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -.01em;
}
.hero p {
  margin: 0;
  color: var(--ink-3);
  font-size: 14px;
}

/* 商品网格 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 22px;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #d9d9de;
}
.cover {
  aspect-ratio: 1 / 1;
  background: var(--bg-2);
  overflow: hidden;
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card .body { padding: 14px 16px 18px; }
.card h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .sub {
  margin: 0 0 10px;
  color: var(--ink-3);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.price {
  color: var(--accent);
  font-weight: 700;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.tag {
  font-size: 11px;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}

/* 占位与空态 */
.ph, .empty, .loading {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-size: 14px;
  background: var(--bg-2);
  border-radius: var(--radius);
  min-height: 140px;
  padding: 24px;
  text-align: center;
}
.empty { border: 1px dashed var(--line); }

/* 详情页 */
.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}
.gallery .big {
  aspect-ratio: 1 / 1;
  background: var(--bg-2);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
.gallery .big img { width: 100%; height: 100%; object-fit: cover; }
.thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.thumb {
  width: 68px;
  height: 68px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-2);
  cursor: pointer;
}
.thumb.on { border-color: var(--accent); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.info h1 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: -.01em;
}
.info .sub { margin: 0 0 16px; color: var(--ink-3); font-size: 14px; }
.pricebox {
  padding: 16px 0 18px;
  border-bottom: 1px solid var(--line);
}
.points {
  margin: 18px 0;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 14px;
}
.points li { margin-bottom: 6px; }

.specs {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 13.5px;
}
.specs th, .specs td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}
.specs th {
  width: 34%;
  color: var(--ink-3);
  font-weight: 500;
  background: var(--bg-2);
}

/* 下单表单 */
.orderform {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
  padding: 20px;
  background: var(--bg-2);
  border-radius: var(--radius);
}
.orderform label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-2);
}
.orderform label.wide { grid-column: 1 / -1; }
.orderform input,
.orderform textarea,
.pform input,
.pform textarea,
.panel input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.orderform input:focus,
.orderform textarea:focus,
.pform input:focus,
.pform textarea:focus {
  border-color: var(--accent);
}
.orderform button[type=submit] {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 13px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .02em;
}
.orderform button[type=submit]:hover { filter: brightness(1.06); }
.msg {
  grid-column: 1 / -1;
  font-size: 13px;
  min-height: 18px;
  color: var(--ink-3);
}
.msg.ok { color: var(--ok); }
.msg.bad { color: var(--bad); }

/* 内容区 */
.block { margin-top: 48px; }
.block h2 {
  font-size: 18px;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.pv {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius);
  background: #000;
}
.rt {
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.75;
}
.rt img { margin: 14px 0; border-radius: 8px; }
.rt h3 { font-size: 16px; color: var(--ink); margin: 22px 0 8px; }

/* 后台 */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 22px;
}
.panel h1 { font-size: 22px; margin: 0 0 16px; }
.panel h2 { font-size: 17px; margin: 0 0 14px; }
.panel .hint { color: var(--ink-3); font-size: 13px; margin: -6px 0 16px; }
.tok { display: block; margin-bottom: 14px; font-size: 13px; color: var(--ink-2); }
.row2 { display: flex; gap: 10px; }
.panel button {
  padding: 10px 20px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.panel button.ghost {
  background: #fff;
  color: var(--ink-2);
  border: 1px solid var(--line);
}

.pform {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.pform label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-2);
}
.pform label.wide { grid-column: 1 / -1; }
.pform button[type=submit] {
  grid-column: 1 / -1;
  padding: 12px;
}

/* 订单表 */
.ot {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ot th, .ot td {
  border-bottom: 1px solid var(--line);
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
}
.ot th {
  color: var(--ink-3);
  font-weight: 500;
  background: var(--bg-2);
  white-space: nowrap;
}
.ot td.addr { max-width: 220px; color: var(--ink-2); }

/* 页脚 */
.foot {
  border-top: 1px solid var(--line);
  padding: 22px 24px;
  text-align: center;
  color: var(--ink-3);
  font-size: 12.5px;
}

/* 响应式 */
@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; gap: 26px; }
  .wrap { padding: 20px 16px 48px; }
  .hero h1 { font-size: 23px; }
  .orderform, .pform { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .card .body { padding: 11px 12px 14px; }
  .price { font-size: 16px; }
  .ot { display: block; overflow-x: auto; white-space: nowrap; }
}
