/* ===== Yvenjex 外贸独立站样式（AliExpress 风格）===== */
:root {
  --brand: #ff4747;
  --brand-dark: #e63939;
  --ink: #222;
  --muted: #777;
  --line: #e5e5e5;
  --bg: #f5f5f5;
  --card: #fff;
  --ok: #0a8f4e;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Sans", "Noto Sans JP", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------- 顶部条 ---------- */
.topbar { background: #0a1240; color: #c9d2f2; font-size: 12px; }
.topbar .inner {
  max-width: 1200px; margin: 0 auto; padding: 6px 16px;
  display: flex; justify-content: flex-end; gap: 18px; align-items: center;
}
.topbar select {
  background: transparent; color: #fff; border: 1px solid #4a586b;
  border-radius: 4px; padding: 3px 6px; font-size: 12px; cursor: pointer;
}
.topbar select option { color: #222; background: #fff; }
.topbar .tb-item { display: flex; align-items: center; gap: 6px; }

/* ---------- 头部 ---------- */
.header { background: #fff; border-bottom: 1px solid var(--line); }
.header .inner {
  max-width: 1200px; margin: 0 auto; padding: 14px 16px;
  display: flex; align-items: center; gap: 32px;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo img.mark { height: 46px; width: auto; display: block; }
.logo .name { font-size: 24px; font-weight: 800; color: #141a4e; letter-spacing: -0.5px; }
.logo .tag { font-size: 11px; color: var(--muted); display: block; margin-top: -3px; }
.search { flex: 1; display: flex; max-width: 560px; }
.search input {
  flex: 1; border: 2px solid var(--brand); border-right: none;
  border-radius: 6px 0 0 6px; padding: 9px 14px; outline: none;
}
.search button {
  background: var(--brand); color: #fff; border: 2px solid var(--brand);
  border-radius: 0 6px 6px 0; padding: 0 26px; font-weight: 600;
}
.search button:hover { background: var(--brand-dark); }
.hdr-right { display: flex; gap: 20px; font-size: 13px; color: var(--muted); flex-shrink: 0; }
.hdr-right a:hover { color: var(--brand); }

/* ---------- 分类导航 ---------- */
.catnav { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.catnav .inner {
  max-width: 1200px; margin: 0 auto; padding: 0 16px;
  display: flex; gap: 6px; overflow-x: auto;
}
.catnav a {
  padding: 12px 14px; white-space: nowrap; font-weight: 500; border-bottom: 2px solid transparent;
}
.catnav a:hover, .catnav a.active { color: var(--brand); border-bottom-color: var(--brand); }
.catnav a.first { font-weight: 700; color: var(--brand); }

/* ---------- Hero 轮播 ---------- */
.hero { max-width: 1200px; margin: 16px auto 0; padding: 0 16px; }
.hero .banner {
  border-radius: 14px; color: #fff; position: relative; overflow: hidden;
  min-height: 340px; box-shadow: 0 10px 30px rgba(10,18,64,.25);
  background: radial-gradient(1200px 500px at 85% -10%, #1c2a6b 0%, transparent 60%),
              linear-gradient(115deg, #0a1240 0%, #111b52 45%, #1c2a6b 80%, #274086 100%);
}
.hero .banner::before {
  content: "⚡"; position: absolute; right: 40px; top: 50%; transform: translateY(-50%);
  font-size: 160px; opacity: .08; pointer-events: none;
}
.hero .slide {
  position: relative; padding: 44px 48px 66px; display: none;
  flex-direction: column; justify-content: center;
}
.hero .slide.on { display: flex; animation: slideIn .6s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
.hero .slide h1 { font-size: 26px; font-weight: 800; margin-bottom: 12px; max-width: 760px; line-height: 1.3; }
.hero .slide p {
  font-size: 13.5px; opacity: .92; max-width: 860px; line-height: 1.8; margin-bottom: 14px;
}
.hero .more-link { color: #ffd28a; font-size: 13px; font-weight: 700; cursor: pointer; margin-bottom: 18px; align-self: flex-start; }
.hero .more-link:hover { color: #ffe7b8; text-decoration: underline; }
.hero .cta {
  display: inline-block; align-self: flex-start; font-weight: 700;
  padding: 12px 36px; border-radius: 8px; font-size: 15px; border: none;
  background: linear-gradient(90deg, #ff6a3d, #ff4747); color: #fff;
  box-shadow: 0 6px 18px rgba(255,71,71,.35);
}
.hero .cta:hover { filter: brightness(1.08); }
.hero .dots { position: absolute; bottom: 16px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.hero .dots .dot {
  width: 9px; height: 9px; border-radius: 50%; border: none; background: rgba(255,255,255,.35); padding: 0;
  transition: .2s;
}
.hero .dots .dot.on { background: #fff; width: 26px; border-radius: 6px; }

/* 信任徽章 */
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
@media (max-width: 800px) { .badges { grid-template-columns: repeat(2, 1fr); } }
.badge {
  background: linear-gradient(135deg, #fff, #f3f6ff); border: 1px solid #e3e8f7; border-radius: 12px;
  padding: 14px 16px; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 13px;
  color: #1c2650; box-shadow: 0 2px 8px rgba(20,26,78,.05);
}
.badge .bic { font-size: 22px; }

/* ---------- 主容器 ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 24px 16px 60px; }
.sec-title { font-size: 20px; font-weight: 800; margin: 8px 0 16px; display: flex; align-items: center; gap: 10px; }
.sec-title::before { content: ""; width: 4px; height: 20px; background: var(--brand); border-radius: 2px; }

/* 分类卡片 */
.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 28px; }
.cat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; text-align: center; transition: .15s;
}
.cat-card:hover { box-shadow: 0 8px 20px rgba(20,26,78,.12); transform: translateY(-3px); border-color: #c9d4f5; }
.cat-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: #fff; }
.cat-card .cname { margin-top: 10px; font-weight: 600; font-size: 13px; }

/* 产品网格 */
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 1000px) { .grid, .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .grid, .cat-grid { grid-template-columns: repeat(2, 1fr); } .header .inner{flex-wrap:wrap;gap:12px;} .search{min-width:100%;} }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  transition: .18s; display: flex; flex-direction: column;
}
.card:hover { box-shadow: 0 8px 22px rgba(20,26,78,.13); transform: translateY(-3px); border-color: #c9d4f5; }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; cursor: pointer; background: #fff; }
.card .body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .pname { font-size: 13px; line-height: 1.45; min-height: 38px; cursor: pointer; }
.card .pname:hover { color: var(--brand); }
.card .price { color: var(--brand); font-size: 18px; font-weight: 800; }
.card .price small { font-size: 11px; color: var(--muted); font-weight: 400; }
.card .buy {
  margin-top: auto; border: none; color: #fff; border-radius: 7px; padding: 9px 0;
  font-weight: 700; font-size: 13px; background: linear-gradient(90deg, #ff6a3d, #ff4747);
}
.card .buy:hover { filter: brightness(1.08); box-shadow: 0 4px 12px rgba(255,71,71,.3); }

/* ---------- 产品详情（速卖通风格三栏） ---------- */
.pd { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 28px; display: grid; grid-template-columns: 0.9fr 1.15fr 0.62fr; gap: 30px; align-items: start; }
@media (max-width: 1000px) { .pd { grid-template-columns: 1fr 1fr; } .pd-side { grid-column: 1 / -1; } }
@media (max-width: 720px) { .pd { grid-template-columns: 1fr; } }
.pd-gallery img.main, .pd-gallery > img { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.pd-thumbs { display: flex; gap: 8px; margin-top: 10px; }
.pd-thumbs img { width: 54px; height: 54px; object-fit: cover; border: 2px solid var(--line); border-radius: 6px; cursor: pointer; }
.pd-thumbs img.on { border-color: var(--brand); }
.pd-info h1 { font-size: 19px; line-height: 1.5; margin-bottom: 10px; }
.pd .starline { font-size: 13px; margin-bottom: 8px; color: #444; }
.pd .starline .stars { color: #ff9800; font-weight: 800; }
.pd .starline .lnk { color: var(--brand); cursor: pointer; }
.pd .starline .sold { color: var(--muted); }
.pd .sales { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.pd .pricebox { background: #fff5f5; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.pd .pricebox .big { color: var(--brand); font-size: 28px; font-weight: 800; }
.pd .pricebox .was { color: #999; font-size: 12px; margin-top: 4px; }
.pd .pricebox .was s { color: #b66; }
.pd .pricebox .note { color: var(--muted); font-size: 12px; margin-top: 4px; }
.pd .pd-sec { font-size: 13px; font-weight: 800; margin: 4px 0 8px; }
.vchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.vchip {
  border: 1.5px solid var(--line); background: #fff; border-radius: 6px;
  padding: 8px 14px; font-size: 13px; transition: .15s;
}
.vchip:hover { border-color: var(--brand); }
.vchip.on { border-color: var(--brand); color: var(--brand); background: #fff5f5; font-weight: 700; }
.pd .qtyrow { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.pd .qtyrow input { width: 70px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; text-align: center; }
.pd-actions { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.btn-brand {
  background: linear-gradient(90deg, #ff6a3d, #ff4747); color: #fff; border: none; border-radius: 7px;
  padding: 12px 42px; font-size: 15px; font-weight: 700;
}
.btn-brand:hover { filter: brightness(1.08); box-shadow: 0 4px 14px rgba(255,71,71,.3); }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 12px 24px; font-size: 14px; }
.btn-ghost:hover { border-color: #bbb; }
.btn-cart {
  background: #fff; color: var(--brand); border: 2px solid var(--brand); border-radius: 7px;
  padding: 12px 30px; font-size: 15px; font-weight: 700;
}
.btn-cart:hover { background: #fff5f5; }

/* 运输方式选项 */
.shipopts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.shipopt {
  display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line);
  border-radius: 8px; padding: 10px 12px; cursor: pointer; transition: .15s; position: relative;
}
.shipopt:hover { border-color: #c9b28a; }
.shipopt input { accent-color: var(--brand); }
.shipopt.rec::after { content: "★"; position: absolute; right: 10px; top: -9px; color: #f5a623; font-size: 12px; }
.shipopt .so-ic { font-size: 20px; }
.shipopt .so-main { flex: 1; display: flex; flex-direction: column; }
.shipopt .so-main b { font-size: 13px; }
.shipopt .so-main small { color: var(--muted); font-size: 11.5px; }
.shipopt .so-fee { font-weight: 800; color: var(--ink); font-size: 14px; }
.shipopt:has(input:checked) { border-color: var(--brand); background: #fffafa; }

/* 右侧卖家卡片 */
.pd-side { display: flex; flex-direction: column; gap: 14px; }
.side-block { border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: #fcfcff; }
.side-lab { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.side-store { font-weight: 800; font-size: 15px; color: #141a4e; margin-bottom: 4px; }
.side-seller { font-size: 11.5px; color: var(--muted); margin-bottom: 12px; line-height: 1.5; }
.side-btn {
  display: block; border: 1px solid var(--line); border-radius: 7px; padding: 9px 12px;
  font-size: 12.5px; margin-bottom: 8px; text-align: center; font-weight: 600;
}
.side-btn:hover { border-color: var(--brand); color: var(--brand); background: #fff8f8; }
.side-list { list-style: none; font-size: 12px; color: #444; line-height: 1.6; display: flex; flex-direction: column; gap: 7px; }
.specbox { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 22px; margin-top: 4px; }
.specbox h3 { margin-bottom: 10px; font-size: 15px; }
.crumb { max-width: 1200px; margin: 0 auto; padding: 14px 16px 0; font-size: 12px; color: var(--muted); }
.crumb a:hover { color: var(--brand); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 40px 16px;
}
.modal {
  background: #fff; border-radius: 12px; width: 640px; max-width: 100%;
  padding: 26px 28px; position: relative; margin-bottom: 40px;
}
.modal h2 { font-size: 18px; margin-bottom: 4px; }
.modal .sub { color: var(--muted); font-size: 12px; margin-bottom: 18px; }
.x { position: absolute; right: 16px; top: 14px; border: none; background: none; font-size: 22px; color: #999; }
.x:hover { color: #333; }

/* 购买方式选择 */
.opt { border: 2px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 14px; display: flex; gap: 16px; align-items: flex-start; transition: .15s; }
.opt:hover { border-color: var(--brand); }
.opt .ic { font-size: 30px; line-height: 1; margin-top: 2px; }
.opt h3 { font-size: 15px; margin-bottom: 6px; }
.opt p { color: var(--muted); font-size: 12.5px; line-height: 1.55; margin-bottom: 10px; }
.opt .btn { border: none; border-radius: 6px; padding: 9px 20px; font-weight: 700; font-size: 13px; }
.opt.a .btn { background: #ff8c00; color: #fff; }
.opt.b .btn { background: var(--brand); color: #fff; }
.secure-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 6px; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; outline: none;
}
.field input:focus, .field select:focus { border-color: var(--brand); }
.err { color: var(--brand); font-size: 12px; margin-top: 8px; min-height: 16px; }
.actions { display: flex; gap: 10px; margin-top: 16px; }
.actions .spacer { flex: 1; }

/* 合同 */
.contract {
  border: 1px solid var(--line); border-radius: 8px; padding: 18px;
  background: #fcfcf7; font-size: 12.5px; line-height: 1.7; max-height: 300px; overflow-y: auto;
}
.contract h3 { text-align: center; font-size: 15px; margin-bottom: 12px; }
.contract table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 12px; }
.contract td { border: 1px solid #ddd; padding: 6px 8px; }
.contract td:first-child { background: #f2f2ec; width: 38%; color: #555; }
.sig-wrap { margin-top: 14px; }
.sig-wrap .lbl { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
#sigCanvas {
  border: 1.5px dashed #bbb; border-radius: 8px; width: 100%; height: 140px;
  background: #fff; touch-action: none; cursor: crosshair; display: block;
}
.sig-row { display: flex; gap: 10px; margin-top: 10px; }

/* 收款账号 */
.bankbox { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.bankbox .bankname { background: #0a1240; color: #fff; font-weight: 700; font-size: 13.5px; padding: 10px 14px; }
.bankbox table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bankbox td { padding: 10px 14px; border-bottom: 1px solid var(--line); word-break: break-all; }
.bankbox tr:last-child td { border-bottom: none; }
.bankbox td:first-child { background: #f7f7f7; color: var(--muted); width: 42%; }
.amount-big {
  background: #fff5f5; border: 1px solid #ffd9d9; border-radius: 8px;
  padding: 14px; text-align: center; margin-bottom: 14px;
}
.amount-big .lab { font-size: 12px; color: var(--muted); }
.amount-big .val { font-size: 26px; font-weight: 800; color: var(--brand); margin-top: 2px; }
.note { background: #fff8e6; border: 1px solid #ffe3a3; border-radius: 6px; padding: 10px 12px; font-size: 12px; color: #8a6100; margin-bottom: 14px; line-height: 1.5; }

/* 完成页 */
.done { text-align: center; padding: 20px 0 6px; }
.done .ic { font-size: 52px; margin-bottom: 12px; }
.done h2 { margin-bottom: 10px; }
.done p { color: var(--muted); font-size: 13px; line-height: 1.7; max-width: 460px; margin: 0 auto 16px; }
.done .ono { background: #f5f7fa; border-radius: 8px; display: inline-block; padding: 10px 22px; font-weight: 700; margin-bottom: 18px; }

/* 订单状态页 */
.statusline { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; }
.step { flex: 1; text-align: center; font-size: 12px; color: var(--muted); }
.step .dot { width: 30px; height: 30px; border-radius: 50%; background: #e5e5e5; color: #999; display: flex; align-items: center; justify-content: center; margin: 0 auto 6px; font-weight: 700; }
.step.on .dot { background: var(--ok); color: #fff; }
.step.on { color: var(--ok); font-weight: 700; }

/* ---------- 页脚 ---------- */
footer { background: #fff; border-top: 1px solid var(--line); margin-top: 20px; }
footer .inner { max-width: 1200px; margin: 0 auto; padding: 28px 16px; display: grid; grid-template-columns: 2fr 1.2fr 1fr; gap: 30px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
footer h4 { color: var(--ink); margin-bottom: 8px; font-size: 13px; }
footer .copy { border-top: 1px solid var(--line); text-align: center; padding: 14px; color: #aaa; font-size: 12px; }
@media (max-width: 800px) { footer .inner { grid-template-columns: 1fr; } }

/* ---------- 管理页 ---------- */
.admin-wrap { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
table.orders { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.orders th, table.orders td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12.5px; vertical-align: top; }
table.orders th { background: #f7f7f7; font-size: 12px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.pill.pending { background: #fff3d6; color: #9a6b00; }
.pill.confirmed { background: #dff5e8; color: var(--ok); }
.pill.shipped { background: #e2ecff; color: #2456b8; }
table.orders img.sigthumb { height: 36px; border: 1px solid #eee; border-radius: 4px; }
.muted { color: var(--muted); }

/* 合同弹窗加宽 + 合同纸张打印样式 */
.modal.wide { width: 860px; max-width: 96vw; }
@media print {
  body * { visibility: hidden; }
  .ctdoc, .ctdoc * { visibility: visible; }
  .ctdoc { position: absolute; left: 0; top: 0; width: 100%; padding: 0; }
}
