/* 布局：PC 顶栏 + 侧栏可选；手机顶栏 + 底部 Tab */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 16px;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.site-logo__img {
  height: 36px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--color-primary);
  background: rgba(230, 46, 4, 0.08);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: var(--color-bg);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

/* PC：主内容区可带左侧分类 */
.page-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding: 24px 0 48px;
  align-items: start;
}

.sidebar {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 16px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.sidebar h3 {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar li a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--color-text);
}

.sidebar li a:hover {
  background: var(--color-bg);
}

.page-main {
  min-width: 0;
}

.hero {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  aspect-ratio: 21 / 6;
  background: linear-gradient(135deg, #1a1a2e 0%, #e62e04 100%);
  display: flex;
  align-items: flex-end;
  padding: 32px;
  color: #fff;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.product-card {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
}

.product-card__img {
  aspect-ratio: 1;
  background: var(--color-bg);
  object-fit: cover;
  width: 100%;
}

.product-card__body {
  padding: 12px 14px 16px;
}

.product-card__title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__price {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1.1rem;
}

/* 手机底部导航 */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-h);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav__inner {
  display: flex;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.bottom-nav a.is-active {
  color: var(--color-primary);
}

.mobile-drawer {
  display: none;
}

.site-footer {
  margin-top: 0;
  padding: 24px 0 32px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-border);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin-bottom: 12px;
}

.site-footer__links a {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.site-footer__links a:hover {
  color: var(--color-primary);
}

.site-footer__about {
  margin: 0 0 8px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.site-footer__copy {
  margin: 0;
}

.page-static {
  padding: 24px 0 48px;
}

.page-static__body {
  padding: 24px 28px;
  max-width: 800px;
  margin: 0 auto;
}

.page-static__body h1 {
  margin: 0 0 20px;
  font-size: 1.5rem;
}

.page-static__content {
  white-space: pre-wrap;
  line-height: 1.75;
  color: var(--color-text);
}

.page-static__empty {
  color: var(--color-text-muted);
}

/* 右下角悬浮客服已关闭 */
.store-cs-fab {
  display: none !important;
}

.store-pause-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.store-pause-mask__box {
  max-width: 420px;
  text-align: center;
  color: #fff;
}

.store-pause-mask__box h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.store-pause-mask__box p {
  margin: 0;
  opacity: 0.9;
  line-height: 1.6;
}

.wallet-page {
  padding: 16px 0 48px;
  max-width: 520px;
}

.wallet-form {
  padding: 20px;
}

.wallet-form h1 {
  margin: 0 0 12px;
  font-size: 1.25rem;
}

.wallet-form__label {
  display: block;
  margin: 12px 0 6px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.wallet-form__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-sizing: border-box;
  font: inherit;
}

.wallet-form__hint {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.wallet-form__status {
  margin: 0 0 8px;
  font-size: 0.875rem;
  color: #15803d;
  font-weight: 600;
}

.wallet-form__msg {
  margin: 12px 0 0;
  font-size: 0.875rem;
  color: var(--color-primary);
}

.wallet-form--offline p {
  margin: 0 0 8px;
  line-height: 1.6;
}

/* 在线客服页 */
.cs-page {
  padding: 16px 0 48px;
  max-width: 720px;
}

.cs-panel {
  padding: 20px;
}

.cs-panel__status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.cs-panel__status.is-open {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.cs-panel__status.is-closed {
  background: rgba(148, 163, 184, 0.2);
  color: #64748b;
}

.cs-panel__hours {
  margin: 0 0 16px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.cs-panel__offline {
  margin: 12px 0 0;
  padding: 12px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 8px;
  font-size: 0.875rem;
}

.cs-chat {
  padding: 16px 20px 20px;
}

.cs-chat__title {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.cs-messages {
  padding: 12px;
  min-height: 200px;
  max-height: 400px;
  overflow: auto;
  background: var(--color-bg, #f8fafc);
  border-radius: 8px;
}

.cs-msg {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.cs-compose {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.cs-compose input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.cs-conv-item {
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

.cs-conv-item:hover {
  border-color: var(--color-primary);
}

.cs-empty {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* 站点营销弹窗（总后台「网站设置 → 弹窗」） */
body.store-site-popup-open {
  overflow: hidden;
}

.store-site-popup {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.store-site-popup[hidden] {
  display: none !important;
}

.store-site-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.store-site-popup__panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 520px);
  max-height: calc(100vh - 40px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.store-site-popup__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.store-site-popup__close-icon {
  width: 16px;
  height: 16px;
  display: block;
  pointer-events: none;
}

.store-site-popup__close:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.store-site-popup__close:active {
  transform: scale(0.94);
}

.store-site-popup__close:focus {
  outline: none;
}

.store-site-popup__close:focus-visible {
  outline: 2px solid #e62e04;
  outline-offset: 2px;
}

.store-site-popup__title {
  margin: 0;
  padding: 14px 48px 10px 16px;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
}

.store-site-popup__media {
  display: block;
  color: inherit;
  text-decoration: none;
}

.store-site-popup__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  background: #f8fafc;
}

.store-site-popup__content {
  padding: 16px 18px 20px;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #334155;
  white-space: normal;
  word-break: break-word;
}

.store-site-popup__panel--text .store-site-popup__content {
  padding-top: 20px;
}

.store-site-popup__title + .store-site-popup__content {
  padding-top: 12px;
}

.store-site-popup__img + .store-site-popup__content {
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}
