/* ================= 无货源开店 =================
   服务于 store-apply.html（开店申请）、store.html（店主后台）、shop.html（店铺对外页）。
   颜色统一走 site.css + theme.css 的变量，深色模式与四套主题自动跟随。
   ============================================ */

/* ---------- 通用容器 ---------- */
.st-card {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.st-card + .st-card { margin-top: 20px; }
.st-card h3 { margin: 0 0 6px; font-size: 18px; color: var(--ink); }
.st-card > p { margin: 0 0 16px; color: var(--ink-sub); font-size: 14px; line-height: 1.8; }
.st-hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.st-empty { padding: 40px 20px; text-align: center; color: var(--ink-sub); }
.st-empty a { color: var(--red); }

/* ---------- 两栏（店主后台） ---------- */
.st-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.st-side { padding: 12px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.st-tab {
  display: block;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 6px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-sub);
  font-family: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: .2s ease;
}
.st-tab:hover { background: var(--bg-warm); color: var(--ink); }
.st-tab.is-active { background: var(--grad-soft); color: var(--red); font-weight: 700; }
.st-main { min-width: 0; }

/* ---------- 统计与徽标 ---------- */
.st-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.st-stat { padding: 14px; border-radius: var(--radius-sm); background: var(--bg-warm); text-align: center; }
.st-stat b { display: block; font-size: 24px; color: var(--red); line-height: 1.3; }
.st-stat span { font-size: 12px; color: var(--ink-sub); }
.st-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--tag-orange-bg);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}
.st-badge--on { background: var(--tag-green-bg); color: var(--green); }
.st-badge--off { background: var(--bg-warm); color: var(--muted); }

/* ---------- 表单 ---------- */
.st-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.st-field { display: flex; flex-direction: column; gap: 6px; }
.st-field label { font-size: 14px; color: var(--ink); font-weight: 600; }
.st-field input,
.st-field select,
.st-field textarea {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
}
.st-field textarea { height: auto; min-height: 92px; padding: 10px 12px; line-height: 1.7; resize: vertical; }
.st-field input:focus,
.st-field select:focus,
.st-field textarea:focus { outline: 2px solid var(--orange); outline-offset: 1px; }
.st-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.st-error { margin: 10px 0 0; color: var(--red); font-size: 13px; }

/* ---------- 店铺链接 ---------- */
.st-links { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.st-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-warm);
  font-size: 13px;
  color: var(--ink-sub);
  word-break: break-all;
}
.st-link code { font-family: inherit; color: var(--ink); }
.st-link .btn { flex: 0 0 auto; }

/* ---------- 工具栏与表格 ---------- */
.st-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.st-toolbar input,
.st-toolbar select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
}
.st-tbl-wrap { overflow-x: auto; }
.st-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.st-tbl th,
.st-tbl td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.st-tbl th { color: var(--ink); font-weight: 700; white-space: nowrap; }
.st-tbl td { color: var(--ink-sub); }
.st-tbl img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.st-pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.st-pager button { min-height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font-family: inherit; }
.st-pager button:disabled { opacity: .5; cursor: not-allowed; }
.st-pager span { color: var(--muted); font-size: 13px; }

/* ---------- 商品网格（选品 / 店铺页） ---------- */
.st-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.st-item {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: .2s ease;
}
.st-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.st-item__cover { position: relative; aspect-ratio: 4 / 3; background: var(--bg-warm); overflow: hidden; }
.st-item__cover img { width: 100%; height: 100%; object-fit: cover; }
.st-item__tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(76, 175, 90, .92);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.st-item__body { display: flex; flex-direction: column; gap: 6px; padding: 14px; }
.st-item__name {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.st-item__meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.st-item__price { color: var(--red); font-size: 17px; font-weight: 700; }
.st-item__price em { font-style: normal; font-size: 12px; font-weight: 400; color: var(--muted); }
.st-item__supplier { color: var(--muted); font-size: 12px; }
.st-item__foot { display: flex; gap: 8px; margin-top: auto; padding-top: 10px; }
.st-item__foot .btn { flex: 1; }

/* ---------- 店铺对外页头部 ---------- */
.st-shop-head {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--grad-soft);
}
.st-shop-logo {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  object-fit: cover;
  background: var(--card);
  border: 1px solid var(--line);
}
.st-shop-info h1 { margin: 0 0 6px; font-size: 26px; color: var(--ink); }
.st-shop-info p { margin: 0; color: var(--ink-sub); font-size: 14px; line-height: 1.8; }
.st-shop-info .st-hint { margin-top: 8px; }
.st-shop-mini { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.st-shop-mini__qr {
  width: 108px;
  height: 108px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--card);
  border: 1px solid var(--line);
}
.st-shop-mini span { font-size: 12px; color: var(--ink-sub); }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .st-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .st-shell { grid-template-columns: 1fr; }
  .st-side { display: flex; gap: 8px; overflow-x: auto; }
  .st-side .st-tab { width: auto; margin-bottom: 0; white-space: nowrap; }
}

@media (max-width: 767px) {
  .st-card { padding: 18px 16px; }
  .st-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .st-stat { padding: 10px 6px; }
  .st-stat b { font-size: 20px; }
  .st-form-grid { grid-template-columns: 1fr; }
  .st-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .st-shop-head { grid-template-columns: 72px minmax(0, 1fr); gap: 14px; padding: 16px; }
  .st-shop-logo { width: 72px; height: 72px; border-radius: 16px; }
  .st-shop-info h1 { font-size: 20px; }
  .st-shop-mini { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; }
  .st-shop-mini__qr { width: 72px; height: 72px; }
  .st-link { flex-direction: column; align-items: flex-start; }
}
