/*
 * 电商模板配色：全部跟随「模板风格」style-variants
 *（--accent-primary / --bg-* / --text-* / --gradient-*）
 * 下方数值仅为 style-variants 加载前的 ocean 浅色回退。
 */
:root,
html[data-theme="light"] {
  --bg-primary: #f6f8fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #eaeef2;
  --border-color: #d0d7de;
  --text-primary: #1f2328;
  --text-secondary: #656d76;
  --text-muted: #8c959f;
  --accent-primary: #0969da;
  --accent-secondary: #218bff;
  --gradient-start: #0969da;
  --gradient-end: #218bff;
  --btn-primary-fg: #ffffff;
}

html {
  --shop-bg: var(--bg-primary);
  --shop-card: var(--bg-secondary);
  --shop-ink: var(--text-primary);
  --shop-ink-2: var(--text-secondary);
  --shop-ink-3: var(--text-muted);
  --shop-line: var(--border-color);
  --shop-brand: var(--accent-primary);
  --shop-brand-2: var(--accent-secondary);
  --shop-accent: var(--accent-primary);
  --shop-accent-2: var(--accent-secondary);
  --shop-accent-soft: color-mix(in srgb, var(--accent-primary) 10%, var(--bg-secondary));
  --shop-accent-soft-2: color-mix(in srgb, var(--accent-primary) 18%, var(--bg-secondary));
  --shop-price: var(--accent-primary);
  --shop-btn-fg: var(--btn-primary-fg, #fff);
  --shop-radius: 8px;
  --shop-shadow-sm: 0 1px 2px color-mix(in srgb, var(--text-primary) 6%, transparent);
  --shop-shadow-md: 0 6px 18px color-mix(in srgb, var(--accent-primary) 14%, transparent);
}

* { box-sizing: border-box; }

body.shop-body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  color: var(--shop-ink);
  background: var(--shop-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body.shop-body a { color: inherit; text-decoration: none; }
body.shop-body button { font-family: inherit; cursor: pointer; }

.shop-wrap { max-width: 1760px; margin: 0 auto; padding: 0 24px; }

/* ---------- 促销条（跟随风格渐变） ---------- */
.shop-promo {
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  color: var(--shop-btn-fg);
  text-align: center;
  font-size: 12px;
  letter-spacing: .02em;
  padding: 8px 16px;
}
.shop-promo b { font-weight: 700; }

/* ---------- 顶部导航 ---------- */
.shop-top {
  background: var(--shop-card);
  border-bottom: 1px solid var(--shop-line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.shop-top-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 66px;
}
.shop-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 21px;
  min-width: 0;
}
.shop-brand img.shop-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
}
.shop-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  display: grid;
  place-items: center;
  color: var(--shop-btn-fg);
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 10px color-mix(in srgb, var(--accent-primary) 28%, transparent);
}
.shop-brand-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
  color: var(--shop-ink);
}
.shop-search {
  flex: 1;
  display: flex;
  max-width: 520px;
  height: 40px;
  border: 2px solid var(--shop-accent);
  border-radius: 20px;
  overflow: hidden;
  background: var(--shop-card);
}
.shop-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 16px;
  font-size: 14px;
  background: transparent;
  min-width: 0;
  color: var(--shop-ink);
}
.shop-search input::placeholder { color: var(--shop-ink-3); }
.shop-search button {
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  color: var(--shop-btn-fg);
  border: none;
  padding: 0 24px;
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
  border-radius: 0 18px 18px 0;
}
.shop-search button:hover { filter: brightness(1.05); }
.shop-top-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}
.shop-top-links { display: flex; align-items: center; gap: 8px; }
.shop-btn-login {
  font-size: 14px;
  color: var(--shop-ink-2);
  padding: 8px 14px;
  border-radius: 4px;
}
.shop-btn-login:hover { color: var(--shop-accent); background: var(--shop-accent-soft); }
.shop-btn-reg {
  font-size: 14px;
  color: var(--shop-btn-fg);
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 600;
}
.shop-btn-reg:hover { filter: brightness(1.05); }
.shop-btn-ghost {
  font-size: 13px;
  color: var(--shop-ink-2);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--shop-line);
  background: var(--shop-card);
}
.shop-btn-ghost:hover { color: var(--shop-accent); border-color: var(--shop-accent); }

/* ---------- 主体布局：左分类 / 中商品 / 右快捷（参考商城三栏） ---------- */
.shop-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 280px;
  gap: 20px;
  padding: 20px 0 48px;
  align-items: start;
}

/* ---------- 左侧菜单 ---------- */
.shop-side {
  background: var(--shop-card);
  border-radius: var(--shop-radius);
  border: 1px solid var(--shop-line);
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 100px);
  overflow: auto;
  box-shadow: var(--shop-shadow-sm);
}
.shop-side-title {
  font-size: 15px;
  font-weight: 700;
  padding: 15px 18px;
  border-bottom: 1px solid var(--shop-line);
  display: flex;
  align-items: center;
  gap: 7px;
}
.shop-side-menu { padding: 8px; }
.shop-side-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--shop-ink-2);
  cursor: pointer;
  transition: .15s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.shop-side-item:hover { background: var(--bg-tertiary); color: var(--shop-ink); }
.shop-side-item.active {
  background: var(--shop-accent-soft);
  color: var(--shop-accent);
  font-weight: 700;
}
.shop-side-item .cnt {
  font-size: 11px;
  color: var(--shop-ink-3);
  background: var(--bg-tertiary);
  border-radius: 10px;
  padding: 1px 8px;
}
.shop-side-item.active .cnt {
  background: var(--shop-accent-soft-2);
  color: var(--shop-accent);
}

/* ---------- 中间商品区 ---------- */
.shop-main {
  min-width: 0;
  background: var(--shop-card);
  border: 1px solid var(--shop-line);
  border-radius: var(--shop-radius);
  padding: 16px 16px 20px;
  box-shadow: var(--shop-shadow-sm);
}
.shop-main-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--shop-line);
}
.shop-main-head h2 { font-size: 18px; font-weight: 800; margin: 0; }
.shop-main-head .count { font-size: 13px; color: var(--shop-ink-3); }

/* ---------- 右侧快捷栏 ---------- */
.shop-aside {
  position: sticky;
  top: 86px;
  display: grid;
  align-content: start;
  gap: 16px;
}
.shop-panel {
  background: var(--shop-card);
  border: 1px solid var(--shop-line);
  border-radius: var(--shop-radius);
  overflow: hidden;
  box-shadow: var(--shop-shadow-sm);
}
.shop-panel__header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--shop-line);
}
.shop-panel__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--shop-accent-soft);
  color: var(--shop-accent);
  font-size: 16px;
  font-weight: 700;
}
.shop-panel__header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--shop-ink);
}
.shop-panel__header p {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--shop-ink-3);
}
.shop-panel__body { padding: 12px; }
.shop-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.shop-action-grid a {
  min-height: 72px;
  padding: 10px 7px;
  border: 1px solid var(--shop-line);
  border-radius: 7px;
  background: var(--bg-tertiary);
  color: var(--shop-ink-2);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  transition: .15s;
}
.shop-action-grid a:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 40%, var(--border-color));
  background: var(--shop-accent-soft);
  color: var(--shop-accent);
}
.shop-action-grid .act-ico {
  font-size: 20px;
  line-height: 1;
  color: var(--shop-accent);
}
.shop-callout {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-radius: 7px;
  background: var(--bg-tertiary);
  color: var(--shop-ink-2);
  line-height: 1.55;
  font-size: 12.5px;
  padding: 12px;
}
.shop-callout .call-ico {
  flex-shrink: 0;
  color: var(--shop-accent);
  font-size: 18px;
  line-height: 1.2;
}
.shop-aside-links {
  display: grid;
  gap: 6px;
}
.shop-aside-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--shop-ink-2);
  background: transparent;
}
.shop-aside-links a:hover {
  background: var(--shop-accent-soft);
  color: var(--shop-accent);
}
.shop-aside-links a span.arrow { color: var(--shop-ink-3); font-size: 12px; }
.shop-sort { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.shop-sort-btn {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--shop-ink-2);
  background: var(--shop-card);
  border: 1px solid var(--shop-line);
}
.shop-sort-btn.active {
  color: var(--shop-accent);
  border-color: var(--shop-accent);
  background: var(--shop-accent-soft);
  font-weight: 600;
}

.shop-empty {
  display: none;
  text-align: center;
  padding: 48px 20px;
  color: var(--shop-ink-2);
  background: var(--shop-card);
  border-radius: var(--shop-radius);
  border: 1px solid var(--shop-line);
  font-size: 15px;
  line-height: 1.65;
}

/* ---------- 产品网格 / 服务卡片（电商风） ---------- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.shop-grid .service-hub-card,
.shop-grid .shop-card {
  background: var(--shop-card);
  border-radius: var(--shop-radius);
  border: 1px solid var(--shop-line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: .2s;
  position: relative;
  padding: 0;
  color: inherit;
  text-decoration: none;
  box-shadow: none;
}
.shop-grid .service-hub-card:hover,
.shop-grid .shop-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shop-shadow-md);
  border-color: color-mix(in srgb, var(--accent-primary) 35%, var(--border-color));
}

.shop-card-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  font-size: 64px;
  position: relative;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  overflow: hidden;
}
.shop-card-img--cover {
  font-size: 0;
  color: transparent;
  padding: 0;
}
.shop-card-img--cover > img.service-hub-card-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
}
.shop-card-img--cover > .cat-tag {
  font-size: 11px;
  z-index: 1;
}
.shop-grid .service-hub-card > .service-hub-card-icon {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  font-size: 64px;
  margin: 0;
  background: var(--bg-tertiary);
  border-radius: 0;
  border-bottom: 1px solid var(--shop-line);
  position: relative;
  overflow: hidden;
}
.shop-grid .service-hub-card > .service-hub-card-icon.service-hub-card-icon--cover {
  font-size: 0;
  color: transparent;
  padding: 0;
}
.shop-grid .service-hub-card > .service-hub-card-icon > img.service-hub-card-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}
.shop-grid .service-hub-card:nth-child(3n+2) > .service-hub-card-icon {
  background: color-mix(in srgb, var(--accent-primary) 8%, var(--bg-tertiary));
}
.shop-grid .service-hub-card:nth-child(3n) > .service-hub-card-icon {
  background: color-mix(in srgb, var(--accent-secondary) 8%, var(--bg-tertiary));
}
.shop-grid .service-hub-card:nth-child(3n+1) > .service-hub-card-icon {
  background: color-mix(in srgb, var(--accent-primary) 5%, var(--bg-tertiary));
}

/* 商品图区：底色跟随风格 accent */
.img-a { background: color-mix(in srgb, var(--accent-primary) 8%, var(--bg-tertiary)); }
.img-b { background: color-mix(in srgb, var(--accent-secondary) 10%, var(--bg-tertiary)); }
.img-c { background: var(--bg-tertiary); }
.img-d { background: color-mix(in srgb, var(--accent-primary) 5%, var(--bg-tertiary)); }
.img-e { background: color-mix(in srgb, var(--accent-secondary) 6%, var(--bg-tertiary)); }
.img-f { background: var(--bg-tertiary); }

.cat-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, .95);
  padding: 2px 8px;
  border-radius: 2px;
  color: var(--shop-accent);
  border: 1px solid var(--shop-accent-soft-2);
}

.shop-card-body,
.shop-grid .service-hub-card {
  padding-bottom: 0;
}
.shop-card-body {
  padding: 14px 15px 15px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.shop-grid .service-hub-card > h2,
.shop-card-body h2,
.shop-card-body h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 14px 15px 5px;
  line-height: 1.35;
  padding: 0;
}
.shop-card-body h2,
.shop-card-body h3 { margin: 0 0 5px; }

.shop-grid .service-hub-card > .service-hub-intro,
.shop-card-body .desc,
.shop-card-body .service-hub-intro {
  font-size: 12.5px;
  color: var(--shop-ink-2);
  margin: 0 15px 10px;
  min-height: 38px;
  line-height: 1.5;
}
.shop-card-body .desc,
.shop-card-body .service-hub-intro { margin: 0 0 10px; }

.shop-grid .service-hub-card > .service-hub-panel,
.shop-grid .service-hub-card > .service-hub-fit-scope,
.shop-grid .service-hub-card > .service-hub-card-tag {
  display: none !important;
}

.shop-grid .service-hub-card-bottom,
.shop-card-body .service-hub-card-bottom {
  margin-top: auto;
  padding: 0 15px 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  width: 100%;
  box-sizing: border-box;
}
.shop-card-body .service-hub-card-bottom {
  padding: 0;
}
.shop-grid .service-hub-card-price,
.shop-card-body .service-hub-card-price {
  color: var(--shop-price);
  font-weight: 800;
  font-size: 16px;
  margin-right: auto;
  flex-shrink: 0;
  line-height: 1.2;
}
.shop-grid .service-hub-card-cta,
.shop-card-body .service-hub-card-cta,
.shop-buy {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  color: var(--shop-btn-fg) !important;
  border: none;
  padding: 9px 0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  transition: filter .15s;
  text-align: center;
  white-space: nowrap;
}
.shop-grid .service-hub-card-cta:hover,
.shop-card-body .service-hub-card-cta:hover,
.shop-buy:hover { filter: brightness(1.06); }

.shop-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}
.shop-price {
  color: var(--shop-price);
  font-weight: 800;
  font-size: 19px;
}
.shop-price .unit { font-size: 12px; font-weight: 700; }
.shop-price .start { font-size: 12px; color: var(--shop-ink-3); font-weight: 400; }
.shop-price.none { font-size: 14px; color: var(--shop-price); font-weight: 700; }
.shop-sold {
  font-size: 11.5px;
  color: var(--shop-ink-3);
  margin-bottom: 12px;
}
.shop-card-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

/* 分类容器：电商首页仍用扁平网格 */
#serviceHubCategories { display: none !important; }

.gf-home-copy-blocks {
  max-width: 100%;
  margin: 0 0 16px;
  display: grid;
  gap: 12px;
}
.gf-home-copy-block {
  padding: 14px 16px;
  border-radius: var(--shop-radius);
  border: 1px solid var(--shop-line);
  background: var(--shop-card);
}
.gf-home-copy-block__title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
}
.gf-home-copy-block__body {
  font-size: 13px;
  line-height: 1.65;
  color: var(--shop-ink-2);
}
.gf-home-copy-block__body p { margin: 0 0 0.5em; }
.gf-home-copy-block__body p:last-child { margin-bottom: 0; }

.shop-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: .3s;
  z-index: 120;
}
.shop-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 电商模板不使用门户页脚 */
body.shop-body .subsite-portal-site-footer,
.subsite-portal-site-footer { display: none !important; }

/* 左下角客服浮层：首页也必须可见（样式主文件为 site-chrome.css） */
body.shop-body .site-chrome-stack {
  z-index: 100100 !important;
  pointer-events: auto;
}

@media (max-width: 1400px) {
  .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .shop-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .shop-aside { display: none; }
}
@media (max-width: 900px) {
  .shop-layout { grid-template-columns: 1fr; }
  .shop-side { position: static; }
  .shop-side-menu { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .shop-side-item { flex: 0 0 auto; width: auto; }
  .shop-main { padding: 14px; }
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-search { display: none; }
  .shop-aside {
    display: grid;
    position: static;
    order: 3;
  }
}
@media (max-width: 540px) {
  .shop-grid { grid-template-columns: 1fr; }
  .shop-top-links .shop-btn-login { display: none; }
  .shop-brand-title { max-width: 140px; font-size: 17px; }
  .shop-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
