/* 轻量商品展示站 —— 全站样式 */

:root {
  --brand: #ff5000;
  --brand-dark: #e04600;
  --text: #1f2329;
  --text-2: #646a73;
  --text-3: #8f959e;
  --line: #e5e6eb;
  --line-2: #f0f1f3;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ok: #0f9d58;
  --err: #e5484d;
  --mygo: #3388BB;        /* MyGO!!!!! 官方主题色（Band Color） */
  --mygo-dark: #255F80;   /* 同色系加深，用于 LOGO 双色 */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 24, 32, .04);
  --shadow-lg: 0 8px 24px rgba(20, 24, 32, .10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------------- 顶部导航 ---------------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .wrap {
  display: flex;
  align-items: center;
  height: 60px;
  gap: 28px;
}
.brand {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--mygo);
  white-space: nowrap;
}
.brand em { color: var(--mygo-dark); font-style: normal; }
.topbar nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
  font-size: 14px;
}
.topbar nav a { color: var(--text-2); }
.topbar nav a:hover { color: var(--brand); }
.topbar nav a.on { color: var(--text); font-weight: 500; }
.topbar nav a.on::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 2px;
  background: var(--brand);
  border-radius: 2px;
}
.who { color: var(--text-3); }

/* ---------------- 提示条 ---------------- */
.toast {
  max-width: 1180px;
  margin: 16px auto 0;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.toast.ok { background: #eaf7ef; color: #0b7a44; }
.toast.err { background: #fdecec; color: #b32a2e; }

/* ---------------- 标题区 ---------------- */
.page-head { padding: 28px 0 16px; }
.page-head h1 { margin: 0; font-size: 20px; font-weight: 600; }
.page-head .sub { margin: 4px 0 0; color: var(--text-3); font-size: 13px; }

/* ---------------- 商品网格 ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 16px;
  padding-bottom: 40px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .18s ease, transform .18s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.thumb {
  aspect-ratio: 1 / 1;
  background: #fbfbfc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.noimg { color: var(--text-3); font-size: 13px; }
.card-body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 44px;
}
.summary {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.price {
  color: var(--brand);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
}

/* ---------------- 商品详情 ---------------- */
.detail {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
}
.detail .hero {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  background: #fbfbfc;
  overflow: hidden;
}
.detail .hero img { width: 100%; height: 100%; object-fit: cover; }
.detail .gallery { display: flex; flex-direction: column; gap: 10px; }
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery-thumbs img {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; opacity: .75;
}
.gallery-thumbs img.on { border-color: var(--brand); opacity: 1; }
.detail h1 { margin: 0 0 8px; font-size: 22px; font-weight: 600; line-height: 1.4; }
.detail .lead { color: var(--text-2); margin: 0 0 16px; }
.pricebox {
  background: #fff7f2;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 18px;
}
.pricebox .big { color: var(--brand); font-size: 30px; font-weight: 600; line-height: 1.2; }
.pricebox .meta { color: var(--text-3); font-size: 12px; margin-top: 6px; }
.spec { display: flex; gap: 28px; padding: 0 0 16px; color: var(--text-2); font-size: 13px; }
.spec b { color: var(--text); font-weight: 500; }
.block-title {
  font-size: 15px;
  font-weight: 600;
  margin: 32px 0 12px;
  padding-left: 10px;
  border-left: 3px solid var(--brand);
}
.prose { color: var(--text-2); white-space: pre-wrap; line-height: 1.9; }

/* ---------------- 收货地址卡片（详情页内） ---------------- */
.addr-inline {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: #fcfcfd;
}
.addr-inline .lab { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.addr-inline .val { font-size: 13px; color: var(--text); }
.addr-inline .empty { font-size: 13px; color: var(--text-3); }

/* ---------------- 通用面板 ---------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.panel h2 {
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 600;
}
.panel-narrow { max-width: 460px; margin: 40px auto; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }
input[type=text], input[type=password], input[type=number],
input[type=search], textarea, select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .15s ease;
}
input:focus, textarea:focus, select:focus { border-color: var(--brand); }
textarea { min-height: 96px; resize: vertical; }
.row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.check input { width: auto; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  transition: background .15s ease;
}
.btn:hover { background: var(--brand-dark); }
.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover { background: #f7f8fa; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-danger { background: #fff; border-color: #f4c7c9; color: var(--err); }
.btn-danger:hover { background: #fdecec; }
.btn-block { width: 100%; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------------- 表格 ---------------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line-2); }
th { background: #fafbfc; color: var(--text-2); font-weight: 500; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fcfcfd; }
td.mono, th.mono { font-variant-numeric: tabular-nums; }
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef0f3;
  color: var(--text-2);
}
.tag-on { background: #eaf7ef; color: #0b7a44; }
.tag-off { background: #fdecec; color: #b32a2e; }
.tag-def { background: #fff1e8; color: #c2410c; }

/* ---------------- 地址列表 ---------------- */
.addr-list { display: grid; gap: 12px; }
.addr-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
}
.addr-card.is-default { border-color: #ffd0b8; background: #fffcf9; }
.addr-card .info { flex: 1; min-width: 0; }
.addr-card .line1 { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.addr-card .line1 .tel { color: var(--text-2); font-weight: 400; margin-left: 10px; }
.addr-card .line2 { color: var(--text-2); font-size: 13px; }
.addr-card .ops { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------------- 空状态 ---------------- */
.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 24px;
}
.empty-state p { margin: 0 0 16px; }

/* ---------------- 统计卡 ---------------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat .k { font-size: 12px; color: var(--text-3); }
.stat .v { font-size: 26px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---------------- 后台布局 ---------------- */
.adminbar { background: #1f2329; color: #e8eaed; border-bottom: none; }
.adminbar .brand { color: #fff; }
.adminbar nav a { color: #b6bcc4; }
.adminbar nav a:hover { color: #fff; }
.adminbar nav a.on { color: #fff; }
.adminbar nav a.on::after { background: var(--brand); }
.searchbar { display: flex; gap: 10px; margin-bottom: 16px; }
.searchbar input { max-width: 320px; }
.breadcrumb { font-size: 13px; color: var(--text-3); margin: 20px 0 14px; }
.breadcrumb a:hover { color: var(--brand); }
.thumb-xs { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); }

/* ---------------- 积分相关 ---------------- */
.points-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 999px;
  background: #fff2e8;
  color: var(--brand);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.price .unit, .pricebox .big .unit {
  font-size: 13px;
  font-weight: 400;
  margin-left: 3px;
  color: var(--brand);
}
.meta-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag-virtual { background: #efecfd; color: #534ab7; }
.badge-sold {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(31, 35, 41, .72);
  color: #fff;
  font-size: 12px;
}
.card .thumb { position: relative; }

.redeem-label {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 2px;
}
.pointbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 16px;
}
.pointbar b { color: var(--brand); font-size: 15px; font-variant-numeric: tabular-nums; }
.redeem-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn:disabled {
  background: #dcdee3;
  color: #fff;
  cursor: not-allowed;
}
.tag-wait { background: #fff7e6; color: #b45309; }

.form-foot {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
}
.form-foot a { color: var(--brand); }

/* ---------------- 物流单号 ---------------- */
.express-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.express-line .mono { color: var(--text-2); }

/* ---------------- 提醒条 ---------------- */
.alert-warn {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 13px;
  color: #7c2d12;
}
.alert-warn strong { font-size: 14px; }
.alert-warn span { color: #9a5b3a; }
.alert-warn .btn { margin-left: auto; }

.redeem-hint.warn { color: #b45309; }

/* ---------------- 发货内容展开 ---------------- */
.deliver summary {
  cursor: pointer;
  color: var(--brand);
  font-size: 13px;
  list-style: none;
}
.deliver summary::-webkit-details-marker { display: none; }
.deliver summary::before { content: "▸ "; }
.deliver[open] summary::before { content: "▾ "; }
.deliver pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text);
  max-width: 320px;
}

/* ---------------- 地址选择 ---------------- */
.pick-list { display: grid; gap: 10px; }
.pick {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.pick:hover { background: #fcfcfd; border-color: #d9dbe0; }
.pick input { width: auto; margin-top: 3px; flex-shrink: 0; }
.pick:has(input:checked) { border-color: var(--brand); background: #fffaf7; }
.pick-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pick-line1 { font-size: 14px; font-weight: 500; }
.pick-line2 { font-size: 13px; color: var(--text-2); }

/* ---------------- 代码块（后台接口说明用） ---------------- */
.code-box {
  margin: 0;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
  color: var(--text);
}

.code-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------------- 批量操作条 ---------------- */
.batchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.batchbar-title { font-size: 13px; font-weight: 600; color: var(--text-2); }
.batchbar input[type="number"],
.batchbar input[type="text"] { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }

/* ---------------- 积分日志分页 ---------------- */
.pager {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 18px 0 6px;
}

/* ---------------- 页脚 ---------------- */
.foot {
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  padding: 36px 20px 44px;
}

/* ---------------- 自定义背景 + 毛玻璃 ---------------- */
/* 只有设置了自定义背景（body.has-bg）时才启用毛玻璃，默认外观保持不变 */

body { min-height: 100vh; }

body.has-bg.glass .topbar,
body.has-bg.glass .card,
body.has-bg.glass .panel,
body.has-bg.glass .detail,
body.has-bg.glass .table-wrap,
body.has-bg.glass .stat,
body.has-bg.glass .empty-state,
body.has-bg.glass .addr-card,
body.has-bg.glass .addr-inline,
body.has-bg.glass .pricebox,
body.has-bg.glass .pointbar,
body.has-bg.glass .alert-warn,
body.has-bg.glass .pick,
body.has-bg.glass .deliver pre,
body.has-bg.glass .toast {
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  border-color: rgba(255, 255, 255, .55);
}

/* 后台顶栏是深色的，毛玻璃要跟着变 */
body.has-bg.glass .adminbar {
  background: rgba(31, 35, 41, .68);
  border-bottom-color: rgba(255, 255, 255, .12);
}

/* 表格内部那些浅色块也要透一点，否则会显得很突兀 */
body.has-bg.glass th { background: rgba(255, 255, 255, .5); }
body.has-bg.glass .pick:has(input:checked) { background: rgba(255, 245, 240, .82); }
body.has-bg.glass .pricebox {
  background: rgba(255, 244, 237, .78);
}
body.has-bg.glass .addr-card.is-default {
  background: rgba(255, 250, 245, .8);
  border-color: rgba(255, 190, 150, .55);
}
body.has-bg.glass .pointbar,
body.has-bg.glass .deliver pre,
body.has-bg.glass .code-box,
body.has-bg.glass .addr-inline { background: rgba(255, 255, 255, .6); }

body.has-bg.glass .card:hover {
  box-shadow: 0 8px 28px rgba(20, 24, 32, .16);
  background: rgba(255, 255, 255, .86);
}

/* 页面级文字（不在白色卡片里的）在深色背景下要转成亮色 */
body.has-bg.bg-dark .page-head h1,
body.has-bg.bg-dark .block-title,
body.has-bg.bg-dark .breadcrumb,
body.has-bg.bg-dark .breadcrumb a { color: #fff; }

body.has-bg.bg-dark .page-head .sub { color: rgba(255, 255, 255, .8); }
body.has-bg.bg-dark .page-head .sub b { color: #fff; }
body.has-bg.bg-dark .foot { color: rgba(255, 255, 255, .55); }

/* 不支持 backdrop-filter 的老浏览器兜底：提高不透明度保证可读 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body.has-bg.glass .topbar,
  body.has-bg.glass .card,
  body.has-bg.glass .panel,
  body.has-bg.glass .detail,
  body.has-bg.glass .table-wrap,
  body.has-bg.glass .stat,
  body.has-bg.glass .empty-state { background: rgba(255, 255, 255, .95); }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; gap: 20px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .row { grid-template-columns: 1fr; }
  .topbar .wrap { height: auto; padding: 12px 20px; flex-wrap: wrap; gap: 12px; }
  .topbar nav { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .addr-card { flex-direction: column; }
  .table-wrap { overflow-x: auto; }
}
