/* ============================================================
   前台现代化皮肤（参考千寻权益商城的版式）
   仅作用于首页，独立文件，删除链接即可还原
   ============================================================ */

:root {
  --qx-primary: #2f6bff;
  --qx-primary-dark: #1e4fd8;
  --qx-text: #172033;
  --qx-muted: #8a94a6;
  --qx-line: #e9eef7;
  --qx-radius-lg: 24px;
  --qx-radius: 16px;
  --qx-shadow: 0 12px 32px rgba(47, 107, 255, .10);
  --qx-shadow-hover: 0 18px 40px rgba(47, 107, 255, .18);
}

body {
  background: linear-gradient(180deg, #e9f1ff 0%, #f4f8ff 420px, #f7f9fd 100%);
  color: var(--qx-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.qx-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- 顶栏 ---------- */
.header {
  background: #ffffff;
  border-bottom: 1px solid rgba(47, 107, 255, .08);
  box-shadow: 0 1px 2px rgba(17, 24, 39, .03);
}

.header .navbar-brand {
  font-weight: 600;
  color: var(--qx-text) !important;
}

.header .nav-link {
  color: #4b5563 !important;
  font-weight: 500;
  border-radius: 10px;
  padding: 6px 14px !important;
  transition: background .15s, color .15s;
}

.header .nav-link:hover,
.header .nav-link.active {
  background: #eef4ff;
  color: var(--qx-primary) !important;
}

.header .form-control {
  border-radius: 10px;
  border-color: var(--qx-line);
}

.header .btn-secondary {
  background: var(--qx-primary);
  border-color: var(--qx-primary);
  border-radius: 10px;
}

/* ---------- Hero ---------- */
.qx-hero {
  padding: 34px 0 10px;
}

.qx-hero-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
  align-items: center;
  padding: 40px 44px;
  border-radius: var(--qx-radius-lg);
  background: linear-gradient(120deg, #2f6bff 0%, #4d86ff 55%, #6ea2ff 100%);
  box-shadow: 0 24px 60px rgba(47, 107, 255, .28);
  overflow: hidden;
}

.qx-hero-card::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -120px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .10);
}

.qx-hero-title {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.25;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
}

.qx-hero-sub {
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-size: 15px;
  line-height: 1.8;
}

.qx-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 12.5px;
  letter-spacing: .3px;
}

.qx-notice {
  position: relative;
  z-index: 1;
  padding: 20px 22px;
  border-radius: var(--qx-radius);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 24px rgba(10, 30, 80, .12);
}

.qx-notice-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--qx-primary);
}

.qx-notice-body {
  font-size: 13.5px;
  line-height: 1.8;
  color: #5b6577;
  max-height: 132px;
  overflow-y: auto;
}

/* 公告为空时的卖点列表 */
.qx-feature {
  list-style: none;
  margin: 0;
  padding: 0;
}

.qx-feature li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed #edf1f8;
}

.qx-feature li:last-child {
  border-bottom: 0;
}

.qx-feature b {
  flex: 0 0 74px;
  color: #1f2937;
  font-size: 13.5px;
  font-weight: 600;
}

.qx-feature span {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.7;
}

/* ---------- 分类 ---------- */
.qx-cats {
  padding: 26px 0 6px;
}

.qx-cats-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.qx-cats-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
}

.qx-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.qx-chip {
  border: 1px solid var(--qx-line);
  background: #fff;
  color: #4b5563;
  border-radius: 999px;
  padding: 9px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all .16s ease;
}

.qx-chip:hover {
  border-color: #c7d8ff;
  color: var(--qx-primary);
}

.qx-chip.active {
  background: var(--qx-primary);
  border-color: var(--qx-primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(47, 107, 255, .28);
}

/* 二级分类行 */
.qx-subrow {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e2eafb;
}

.qx-sub {
  font-size: 13px;
  padding: 7px 16px;
  background: #f7faff;
}

.qx-sub.active {
  background: var(--qx-primary-dark);
  border-color: var(--qx-primary-dark);
}

/* ---------- 品牌宫格 ---------- */
.qx-brands {
  padding: 26px 0 8px;
}

.qx-head-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qx-reset {
  border: 1px solid var(--qx-line);
  background: #fff;
  color: #4b5563;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
}

.qx-reset:hover {
  border-color: #c7d8ff;
  color: var(--qx-primary);
}

.brand-group {
  margin-bottom: 22px;
}

.brand-group-title {
  margin: 0 0 10px 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: #9aa4b2;
  letter-spacing: .4px;
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
}

.brand-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px 12px;
  background: #fff;
  border: 1px solid var(--qx-line);
  border-radius: 16px;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.brand-tile:hover {
  transform: translateY(-3px);
  border-color: #d6e3ff;
  box-shadow: 0 12px 26px rgba(47, 107, 255, .14);
}

.brand-tile.active {
  border-color: var(--qx-primary);
  box-shadow: 0 10px 24px rgba(47, 107, 255, .20);
}

.brand-tile img {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: contain;
  display: block;
  background: #fff;
}

.brand-logo {
  padding: 0;
  box-shadow: 0 4px 12px rgba(17, 24, 39, .08);
}

.brand-badge {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, hsl(var(--h, 220) 88% 62%), hsl(var(--h, 220) 82% 48%));
  box-shadow: 0 6px 14px hsla(var(--h, 220), 80%, 55%, .28);
}

.brand-ph {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: #eef4ff;
  color: var(--qx-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}

.brand-name {
  max-width: 100%;
  font-size: 12.5px;
  color: #4b5563;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-tile.active .brand-name {
  color: var(--qx-primary);
  font-weight: 600;
}

.qx-more {
  display: flex;
  justify-content: center;
  margin: 4px 0 6px;
}

.qx-more-btn {
  border: 1px solid var(--qx-line);
  background: #fff;
  color: #4b5563;
  border-radius: 999px;
  padding: 9px 24px;
  font-size: 13px;
  cursor: pointer;
  transition: all .16s ease;
}

.qx-more-btn:hover {
  border-color: #c7d8ff;
  color: var(--qx-primary);
  box-shadow: 0 8px 18px rgba(47, 107, 255, .12);
}

/* ---------- 商品详情弹层 ---------- */
.qx-card { cursor: pointer; }

.qx-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}

.qx-modal.show {
  opacity: 1;
  visibility: visible;
}

.qx-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .45);
}

.qx-modal-panel {
  position: relative;
  width: min(760px, 92vw);
  height: min(86vh, 900px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .30);
  overflow: hidden;
  transform: translateY(14px) scale(.98);
  transition: transform .22s ease;
}

.qx-modal.show .qx-modal-panel {
  transform: none;
}

.qx-modal-panel iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.qx-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .16);
  font-size: 22px;
  line-height: 1;
  color: #374151;
  cursor: pointer;
}

.qx-modal-close:hover {
  background: #f3f4f6;
}

@media (max-width: 640px) {
  .qx-modal-panel {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
}

@media (max-width: 1100px) {
  .brand-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .brand-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .brand-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .brand-tile { padding: 12px 6px 10px; }
  .brand-tile img, .brand-ph { width: 46px; height: 46px; }
  .brand-name { font-size: 12px; }
}

/* ---------- 商品网格 ---------- */
.qx-grid-section {
  padding: 22px 0 60px;
}

.qx-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
}

.qx-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--qx-line);
  border-radius: var(--qx-radius);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.qx-card:hover {
  transform: translateY(-4px);
  border-color: #d6e3ff;
  box-shadow: var(--qx-shadow-hover);
}

.qx-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #f6f9ff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.qx-card-media img {
  box-sizing: border-box;
  max-width: 76%;
  max-height: 76%;
  width: auto;
  height: auto;
  object-fit: contain;
  padding: 0;
}

.qx-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  color: #fff;
}

.qx-tag.ok { background: #12b76a; }
.qx-tag.warn { background: #f79009; }

.qx-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px 16px 16px;
}

/* 第一层：品牌 */
.qx-brand {
  font-size: 12px;
  color: #8a94a6;
  letter-spacing: .2px;
  margin-bottom: 4px;
}

/* 第二层：商品名（品类） */
.qx-card-title {
  margin: 0 0 10px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--qx-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 44px;
}

/* 第三层：时长（压在图片右上角） */
.qx-duration {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .95);
  color: var(--qx-primary);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(17, 24, 39, .10);
}

/* 第四层：支持方式 + 库存 */
.qx-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.qx-method {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  background: #eef4ff;
  color: #2f6bff;
  font-size: 11.5px;
  font-weight: 500;
}

.qx-stock {
  font-size: 11.5px;
  color: #9aa4b2;
}

.qx-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.qx-price {
  color: #f04438;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -.2px;
}

.qx-price span {
  font-size: 13px;
  margin-right: 1px;
}

.qx-buy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--qx-primary);
  color: #fff !important;
  font-size: 13px;
  text-decoration: none;
  transition: background .15s ease, box-shadow .15s ease;
}

.qx-buy:hover {
  background: var(--qx-primary-dark);
  box-shadow: 0 8px 18px rgba(47, 107, 255, .30);
}

.qx-empty {
  padding: 60px 0;
  text-align: center;
  color: var(--qx-muted);
}

/* ---------- 页脚 ---------- */
.footer {
  background: transparent;
  color: var(--qx-muted);
  font-size: 13px;
}

.footer a { color: var(--qx-primary); }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .qx-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .qx-hero-card {
    grid-template-columns: 1fr;
    padding: 28px 24px;
  }
  .qx-hero-title { font-size: 26px; }
  .qx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}

@media (max-width: 640px) {
  .qx-wrap { padding: 0 14px; }
  .qx-hero { padding-top: 20px; }
  .qx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .qx-card-title { font-size: 13.5px; min-height: 40px; }
  .qx-price { font-size: 17px; }
  .qx-buy { padding: 7px 12px; font-size: 12px; }
}
