/* =========================================================
   xiwei的小店 · 样式表
   配色集中在 :root，改这里就能换整站颜色
   ========================================================= */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #16181d;
  --ink-2: #4b5563;
  --muted: #8b93a1;
  --line: #e6e8ec;
  --accent: #0f766e;        /* 主色：墨绿 */
  --accent-soft: #e6f4f1;
  --price: #c2410c;         /* 价格色 */
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
  --font: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
/* 组件自己的 display 会盖掉 hidden 属性，统一兜底 */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }

.eyebrow {
  display: block;
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
}

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  transition: .18s ease;
  background: transparent;
  color: var(--ink);
}
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2b2f38; transform: translateY(-1px); }
.btn-ghost { border-color: var(--line); background: #fff; color: var(--ink-2); }
.btn-ghost:hover { border-color: #cfd4dc; color: var(--ink); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 16px;
}
.mainnav { display: flex; gap: 4px; margin-left: 8px; }
.navlink {
  padding: 7px 12px; border-radius: 9px;
  color: var(--ink-2); font-size: 14px; font-weight: 600;
  transition: .15s;
}
.navlink:hover { background: #f1f2f5; color: var(--ink); }
.navlink.active { background: var(--accent-soft); color: var(--accent); }
.topbar-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* 语言切换：中 / EN / 日本語 */
.lang-select {
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--line);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 8px 30px 8px 14px;
  font-family: inherit; font-size: 13.5px; font-weight: 600; line-height: 1.4;
  cursor: pointer; outline: none;
  transition: .18s ease;
}
.lang-select:hover { border-color: #cfd4dc; color: var(--ink); }
.lang-select:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- 布局 ---------- */
.layout {
  max-width: 1240px; margin: 26px auto 0;
  padding: 0 24px 40px;
  display: grid; grid-template-columns: 300px 1fr; gap: 22px;
  align-items: start;
}

/* ---------- 侧栏 ---------- */
.sidebar {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 14px;
  position: sticky; top: 86px;
}
.sidebar-head { padding: 0 8px 12px; }
.sidebar-head h2 { font-size: 17px; margin-top: 2px; }
.catlist { list-style: none; margin: 6px 0 0; padding: 0; scrollbar-width: none; }
.catlist::-webkit-scrollbar { display: none; }
.catlist li { margin-bottom: 2px; }
.cat {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 11px; border: 0; background: transparent;
  font-size: 14px; color: var(--ink-2); font-weight: 600; text-align: left;
  transition: .15s;
}
.cat:hover { background: #f5f6f8; color: var(--ink); }
.cat.active { background: var(--accent-soft); color: var(--accent); }
.cat .ico { font-size: 15px; width: 20px; text-align: center; }
.cat .ico.mini-badge {
  width: 20px; height: 20px; border-radius: 6px; flex: none;
  display: inline-grid; place-items: center;
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0;
}
.cat .count {
  margin-left: auto; font-size: 12px; font-weight: 700;
  color: var(--muted); background: #f1f2f5;
  border-radius: 999px; padding: 1px 8px; min-width: 26px; text-align: center;
}
.cat.active .count { background: #fff; color: var(--accent); }

/* ---------- 目录 ---------- */
.catalog {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.catalog-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.catalog-head h1 { font-size: 22px; margin-top: 2px; }
.searchbox { display: flex; gap: 8px; }
.searchbox .btn { flex: none; white-space: nowrap; }
.searchbox input {
  width: 260px; min-width: 0; padding: 10px 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: #fafbfc; font-size: 14px; outline: none;
  transition: .15s;
}
.searchbox input:focus { border-color: var(--accent); background: #fff; }

/* ---------- 商品表 ---------- */
.table-head, .row {
  display: grid;
  grid-template-columns: 1fr 120px 110px 110px;
  align-items: center;
  gap: 12px;
}
.table-head {
  padding: 12px 24px;
  font-size: 12px; color: var(--muted); font-weight: 700;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--line);
}
.col-price, .col-stock { text-align: right; }
.row {
  padding: 16px 24px;
  border-bottom: 1px solid #f0f1f4;
  transition: background .15s;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: #fafbfc; }
.row-main { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.row-ico {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; overflow: hidden;
  background: var(--accent-soft); font-size: 18px;
}
.row-ico img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 3px; }
.row-ico.letter {
  color: #fff; font-weight: 800; font-size: 17px;
  letter-spacing: -.02em;
}
.row-text { min-width: 0; }
.row-name {
  font-weight: 700; font-size: 14.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-tags { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.tag {
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 6px;
  background: #eef2ff; color: #4f46e5;
}
.tag.rec { background: #fff4e5; color: #b45309; }
.tag.out { background: #f3f4f6; color: #6b7280; }
.price { font-weight: 800; color: var(--price); font-size: 15px; text-align: right; }
.stock { font-size: 13px; color: var(--accent); text-align: right; font-weight: 600; }
.stock.none { color: var(--muted); }
.btn-buy {
  border: 0; border-radius: 999px; padding: 8px 16px;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
  transition: .15s;
}
.btn-buy:hover:not(:disabled) { background: var(--accent); }
.btn-buy:disabled { background: #e5e7eb; color: #9ca3af; cursor: not-allowed; }
.empty { padding: 60px 24px; text-align: center; color: var(--muted); }

/* ---------- 独立页面 ---------- */
.pageview { max-width: 900px; margin: 34px auto 60px; padding: 0 24px; }
.pageview h1 { font-size: 24px; }
.lead { color: var(--ink-2); margin: 8px 0 22px; }
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 24px; margin-bottom: 16px;
}
.panel h3 { font-size: 16px; margin-bottom: 10px; }
.panel ul { margin: 0; padding-left: 20px; color: var(--ink-2); }
.panel li { margin: 6px 0; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 14px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 11px; background: #fafbfc; outline: none;
}
.field input:focus { border-color: var(--accent); background: #fff; }
.hint { font-size: 13px; color: var(--muted); }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--line);
  background: #fff;
  text-align: center; padding: 20px 24px;
  font-size: 13px; color: var(--muted);
}
.footer-brand { color: var(--ink); font-weight: 700; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(17,20,26,.42);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fade .18s ease;
}
.modal-mask[hidden] { display: none; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  width: min(520px, 100%);
  max-height: 86vh; overflow: auto;
  background: #fff; border-radius: 22px;
  box-shadow: 0 24px 70px rgba(10,14,20,.28);
  padding: 26px 28px 22px;
  animation: pop .2s cubic-bezier(.2,.9,.3,1.2);
}
.modal.small { width: min(420px, 100%); }
.modal.pay-modal { width: min(460px, 100%); }
.notice-modal { width: min(560px, 100%); }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }
.modal-head h2 { font-size: 21px; margin-top: 2px; }
.modal-body { margin: 18px 0 22px; color: var(--ink-2); }
.modal-body h3 { font-size: 18px; color: var(--ink); margin-bottom: 8px; }
.modal-body p { margin: 8px 0; }
.notice-list { margin: 12px 0 0; padding-left: 18px; }
.notice-list li { margin: 8px 0; }
#noticeBody, #noticeItems li, #helpGrid li { white-space: pre-wrap; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; }
.modal-note { margin: 12px 0 0; font-size: 12px; color: var(--muted); text-align: right; }
.pd-desc { margin-top: 0; }
.pd-meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin: 16px 0;
}
.pd-meta > div {
  background: #f8f9fb; border-radius: 12px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.pd-meta span { font-size: 12px; color: var(--muted); }
.pd-rules { background: #fff8f3; border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.pd-rules b { color: #b45309; }

/* ---------- 支付 ---------- */
.pay-methods {
  display: flex; gap: 8px; margin-bottom: 18px;
  background: #f3f5f7; padding: 4px; border-radius: 12px;
}
.pm {
  flex: 1; border: 0; background: transparent; border-radius: 9px;
  padding: 9px 12px; font-size: 13.5px; font-weight: 700;
  color: var(--ink-2); transition: .15s;
}
.pm.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16,24,40,.1); }

.pay-addr {
  margin-top: 16px; padding: 14px;
  background: #f8f9fb; border-radius: 14px;
}
.pay-addr-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--muted); margin-bottom: 8px;
}
.net-tabs { display: flex; gap: 4px; }
.net {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 3px 10px; font-size: 12px; font-weight: 700; color: var(--ink-2);
}
.net.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.addr-row { display: flex; gap: 8px; align-items: center; }
.addr-row code {
  flex: 1; min-width: 0; font-size: 12.5px; word-break: break-all;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px;
}
.btn-copy { padding: 7px 14px; font-size: 13px; flex: none; }

.pay-box { display: flex; gap: 16px; align-items: center; }
.pay-qr {
  flex: none; width: 132px; height: 132px; border-radius: 14px;
  border: 2px dashed var(--line); display: grid; place-items: center;
  text-align: center; font-size: 12px; color: var(--muted); line-height: 1.5;
  background: #fafbfc;
}
.pay-info { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.pay-info > div { display: flex; flex-direction: column; gap: 3px; }
.pay-info span { font-size: 12px; color: var(--muted); }
.pay-info b { font-size: 15px; word-break: break-all; }
.pay-amount { font-size: 26px !important; color: var(--price); font-weight: 800; }
.pay-offline { display: flex; flex-direction: column; gap: 14px; }
.pay-offline .pay-info { flex: none; }
.pay-offline .hint { margin: 0; }
.pay-contact-list { display: flex; flex-direction: column; gap: 8px; }
.pay-contact {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: #fafbfc; color: var(--ink); text-decoration: none;
}
.pay-contact span { font-size: 12px; color: var(--muted); flex: none; }
.pay-contact b { font-size: 13.5px; word-break: break-all; text-align: right; }
.pay-contact:hover { border-color: #c7ccd4; background: #fff; }
.btn-copy-order { align-self: flex-start; }
.pay-result { margin-top: 16px; }
.pay-ok { font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.card-key {
  background: #f3f5f7; border: 1px dashed #cfd4dc; border-radius: 12px;
  padding: 14px 16px; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 15px; letter-spacing: .04em; word-break: break-all;
  user-select: all;
}

/* ---------- 客服 ---------- */
.service-btn {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 20px; border: 0; border-radius: 999px;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: 0 12px 30px rgba(15,23,42,.25);
  transition: .18s;
}
.service-btn:hover { transform: translateY(-2px); background: var(--accent); }
.service-panel {
  position: fixed; right: 22px; bottom: 84px; z-index: 91;
  width: 320px; background: #fff; border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 20px 50px rgba(15,23,42,.2);
  overflow: hidden;
}
.service-panel[hidden] { display: none; }
.sp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--ink); color: #fff; font-size: 14px;
}
.sp-close { background: none; border: 0; color: #fff; font-size: 20px; line-height: 1; }
.sp-body { padding: 16px; font-size: 14px; color: var(--ink-2); }
.sp-body p { margin: 6px 0; }
.sp-contact span { font-weight: 700; color: var(--ink); }
.sp-chat-btn { width: 100%; margin-top: 12px; }
.sp-chat-hint { margin-top: 6px !important; }

/* ---------- 在线留言 ---------- */
.modal.support-modal { width: min(560px, 100%); }
.support-modal textarea {
  width: 100%; min-height: 86px; padding: 11px 14px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 11px; background: #fafbfc;
  outline: none; resize: vertical; font-family: inherit; line-height: 1.5;
}
.support-modal textarea:focus { border-color: var(--accent); background: #fff; }
.support-thread-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 4px 0 10px;
}
.support-status { font-size: 12px; font-weight: 700; color: var(--accent); }
.support-status.closed { color: var(--muted); }
.support-messages {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 36vh; overflow: auto; padding: 10px 2px; margin-bottom: 12px;
}
.support-msg { max-width: 84%; padding: 9px 12px; border-radius: 13px; }
.support-msg.customer { align-self: flex-start; background: #f3f5f7; border-bottom-left-radius: 5px; }
.support-msg.admin { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 5px; }
.support-msg-text { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.support-msg-time { margin-top: 4px; font-size: 10.5px; opacity: .65; }
.support-empty { text-align: center; padding: 18px 0; }
.support-error { color: #b42318 !important; }

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 14px;
  padding: 11px 20px; border-radius: 999px; z-index: 200;
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
  animation: fade .18s ease;
}

/* ---------- 商品详情页 ---------- */
.detail-wrap { max-width: 1120px; margin: 24px auto 64px; padding: 0 24px; }
.crumbs {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-size: 13px; color: var(--muted); margin-bottom: 14px;
}
.crumbs a:hover { color: var(--ink); }
.crumb-sep { color: #cbd2dc; }
.missing { text-align: center; padding: 56px 24px; }
.missing h2 { font-size: 20px; margin-bottom: 8px; }
.missing .btn { margin-top: 18px; }

.detail-card { padding: 26px; }
.detail-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 34px; align-items: start;
}
.cover {
  position: relative; border-radius: 20px; aspect-ratio: 1 / 1;
  display: grid; place-items: center; overflow: hidden; color: #fff;
  background:
    radial-gradient(circle at 78% 16%, rgba(255,255,255,.30), transparent 44%),
    linear-gradient(150deg, var(--c, #0f766e), #14171d 135%);
  box-shadow: 0 18px 50px rgba(16,24,40,.18);
}
.cover-img {
  width: 54%; max-width: 230px; aspect-ratio: 1 / 1; object-fit: contain;
  background: rgba(255,255,255,.94); border-radius: 26px; padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.cover-letter {
  font-size: clamp(96px, 13vw, 150px); font-weight: 800; line-height: 1;
  letter-spacing: -.04em; opacity: .94;
}
.cover-name {
  position: absolute; left: 24px; bottom: 22px;
  font-size: 18px; font-weight: 800; letter-spacing: -.01em;
}
.cover-tag {
  position: absolute; top: 18px; right: 18px;
  font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px;
  background: rgba(255,255,255,.2);
}

.detail-form h1 { font-size: 24px; line-height: 1.35; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.badge-soft {
  font-size: 12px; font-weight: 700; padding: 3px 10px;
  border-radius: 999px; background: #f1f3f7; color: var(--ink-2);
}
.badge-soft.is-ok { background: var(--accent-soft); color: var(--accent); }
.badge-soft.is-out { background: #f3f4f6; color: #6b7280; }
.badge-soft.is-rec { background: #fff4e5; color: #b45309; }

.detail-price { display: flex; align-items: baseline; gap: 4px; color: var(--price); margin-bottom: 20px; }
.price-cur { font-size: 18px; font-weight: 800; }
.detail-price b { font-size: 38px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.price-unit { font-size: 13px; color: var(--muted); margin-left: 4px; }

.detail-field { margin-bottom: 16px; }
.detail-field > label {
  display: block; font-size: 13px; font-weight: 700;
  color: var(--ink-2); margin-bottom: 8px;
}
.detail-field input[type="text"] {
  width: 100%; padding: 12px 14px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fafbfc; outline: none;
}
.detail-field input[type="text"]:focus { border-color: var(--accent); background: #fff; }

.sku-list { display: flex; flex-wrap: wrap; gap: 10px; }
.sku {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  min-width: 132px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  transition: .15s;
}
.sku-price { font-size: 13px; font-weight: 800; color: var(--price); }
.sku-name { font-size: 13px; color: var(--ink-2); }
.sku:hover { border-color: #cfd4dc; }
.sku.active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sku.active .sku-name { color: var(--ink); font-weight: 700; }

.qty { display: flex; align-items: center; }
.qty button {
  width: 40px; height: 42px; font-size: 16px;
  border: 1px solid var(--line); background: #fafbfc; color: var(--ink);
}
.qty button:first-child { border-radius: 12px 0 0 12px; }
.qty button:last-of-type { border-radius: 0 12px 12px 0; }
.qty input {
  width: 64px; height: 42px; text-align: center; font-size: 15px; font-weight: 700;
  border: 1px solid var(--line); border-left: 0; border-right: 0;
  background: #fff; outline: none;
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-stock { margin-left: 12px; font-size: 12.5px; color: var(--muted); }

.paypick { display: flex; flex-wrap: wrap; gap: 10px; }
.pick {
  padding: 9px 16px; font-size: 13.5px; font-weight: 700;
  color: var(--ink-2); background: #fff;
  border: 1px solid var(--line); border-radius: 12px; transition: .15s;
}
.pick.active { color: var(--ink); border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.btn-buynow { width: 100%; padding: 15px; font-size: 16px; border-radius: 14px; margin-top: 6px; }
.btn-buynow:disabled { background: #e5e7eb; color: #9ca3af; cursor: not-allowed; transform: none; }
.buy-hint { font-size: 12.5px; color: var(--muted); margin-top: 10px; }

.detail-desc { padding: 26px 28px; }
.desc-head h2 { font-size: 20px; margin-top: 2px; }
.desc-body { color: var(--ink-2); font-size: 14px; }
.desc-body h3 { font-size: 15px; margin: 22px 0 8px; color: var(--ink); }
.desc-lead { font-size: 15px; color: var(--ink); margin: 12px 0 0; }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin: 6px 0; }

.related { margin-top: 26px; }
.related h2 { font-size: 18px; margin-bottom: 12px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.rel-card {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 14px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); transition: .15s;
}
.rel-card:hover { transform: translateY(-2px); }
.rel-ico {
  flex: none; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; color: #fff; font-weight: 800; overflow: hidden;
}
.rel-ico img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 3px; }
.rel-text { display: flex; flex-direction: column; min-width: 0; }
.rel-text b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-price { font-size: 13px; font-weight: 800; color: var(--price); }

.btn-copy-all { margin: 10px 0 4px; }
#payCards .card-key + .card-key { margin-top: 8px; }

/* 列表行整行可点 */
.row { color: inherit; }
.btn-buy.disabled { background: #e5e7eb; color: #9ca3af; }

/* ---------- 登录 / 注册 / 我的账号 ---------- */
.auth-tabs {
  display: flex; gap: 6px; margin-bottom: 18px;
  background: #f3f5f7; padding: 4px; border-radius: 12px;
}
.auth-tab {
  flex: 1; border: 0; background: transparent; border-radius: 9px;
  padding: 9px 10px; font-family: inherit; font-size: 13.5px; font-weight: 700;
  color: var(--ink-2); cursor: pointer; transition: .15s;
}
.auth-tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16,24,40,.1); }
.auth-error {
  color: #b91c1c; background: #fef2f2; border-radius: 10px;
  padding: 8px 11px; margin-top: 10px;
}
.auth-error.auth-ok {
  color: #065f46; background: #ecfdf5;
}
.auth-links {
  display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px;
}
.auth-link {
  border: 0; background: none; padding: 0; font-family: inherit;
  font-size: 13px; color: var(--ink-2); cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-link:hover { color: var(--ink); }
#authContact[readonly] { background: #f7f8fa; color: var(--ink-2); }
#authCode {
  font-size: 18px; letter-spacing: .32em; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.account-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
}
.account-head .lead { margin-bottom: 0; }
.account-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.account-panel-head h2 { font-size: 18px; }
.invite-panel {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px 24px;
}
.invite-copy { min-width: 220px; flex: 1 1 320px; }
.invite-copy h2 { font-size: 18px; margin: 4px 0 6px; }
.invite-copy .hint { margin: 0; }
.invite-code-box {
  display: flex; align-items: center; justify-content: flex-end;
  flex-wrap: wrap; gap: 10px;
}
.invite-code-box code {
  font-size: 19px; font-weight: 800; letter-spacing: .12em;
  padding: 10px 14px; border: 1px dashed var(--line); border-radius: 11px;
  background: #f6f7f9; color: var(--ink);
}
.invite-meta { flex: 1 1 100%; margin: 0 !important; }
.acct-order {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 12px; background: #fff;
}
.acct-order:last-of-type { margin-bottom: 0; }
.acct-order-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.acct-order-head code { font-size: 12px; color: var(--muted); word-break: break-all; }
.acct-status {
  flex: none; font-size: 12px; font-weight: 700; padding: 3px 9px;
  border-radius: 999px; background: #f1f2f5; color: var(--ink-2);
}
.acct-status.paid { background: #e8f7f1; color: #0f766e; }
.acct-status.pending { background: #fff4e5; color: #b45309; }
.acct-status.refunding { background: #feecec; color: #b91c1c; }
.acct-order-main {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 14px; color: var(--ink-2);
}
.acct-order-main b { color: var(--ink); }
.acct-order-main span { color: var(--price); font-weight: 800; white-space: nowrap; }
.acct-order-meta { margin-top: 6px; font-size: 12px; color: var(--muted); }
.acct-cards {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 10px; font-size: 12px; color: var(--muted);
}
.acct-cards code {
  background: #f4f5f7; border-radius: 7px; padding: 4px 8px;
  color: var(--ink); word-break: break-all;
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  /* minmax(0,1fr) 而不是 1fr：否则网格按内容最小宽度撑开，手机上会横向溢出 */
  .layout { grid-template-columns: minmax(0, 1fr); padding: 0 16px 32px; }
  .sidebar, .catalog, .catlist, .row { min-width: 0; }
  .sidebar { position: static; }
  .catlist { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
  .catlist li { flex: none; }
  .cat { white-space: nowrap; }
  .catalog-head { flex-direction: column; align-items: stretch; }
  .searchbox input { width: 100%; }
  .table-head { display: none; }
  .row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "main price" "stock action";
    row-gap: 8px;
  }
  .row-main { grid-area: main; }
  .price { grid-area: price; }
  .stock { grid-area: stock; text-align: left; }
  .row-act { grid-area: action; justify-self: end; }
  .mainnav { display: none; }
}

@media (max-width: 860px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .detail-media, .detail-form { min-width: 0; }
  .cover { max-width: 420px; margin: 0 auto; width: 100%; }
  .detail-card { padding: 20px; }
  .detail-desc { padding: 20px; }
  .detail-wrap { padding: 0 16px; }
}

@media (max-width: 560px) {
  .topbar-inner { gap: 8px; padding: 12px 16px; }
  .brand { font-size: 15px; gap: 8px; white-space: nowrap; }
  .brand-mark { width: 28px; height: 28px; border-radius: 9px; font-size: 14px; }
  .brand-name { max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-right { gap: 5px; }
  .topbar-right .btn { padding: 7px 9px; font-size: 12px; white-space: nowrap; flex: none; }
  /* 手机上只留一个「登录」入口，注册在弹窗的标签页里切换，避免顶栏挤不下 */
  #btnRegister { display: none; }
  .lang-select { padding: 6px 22px 6px 8px; font-size: 12px; background-position: right 7px center; flex: none; }
  .brand { min-width: 0; }
  .brand-name { max-width: 96px; }
  .row { padding: 14px 16px; }
  .detail-form h1 { font-size: 21px; }
  .detail-price b { font-size: 32px; }
  .pay-box { gap: 12px; }
  .pay-qr { width: 108px; height: 108px; font-size: 11px; }
  .pay-info b { font-size: 14px; }
  .pay-amount { font-size: 21px !important; }
  .modal { padding: 22px 20px 18px; }
  .account-head { flex-direction: column; align-items: flex-start; }
  .account-panel-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .invite-panel { flex-direction: column; align-items: flex-start; }
  .invite-code-box { justify-content: flex-start; }
  .acct-order-main { flex-direction: column; gap: 4px; }
}
