/**
 * 共秀 H5 — 对齐小程序视觉（对应 xcx/app.wxss + 各页 wxss）
 */
:root {
  --gx-orange: #ff6700;
  --gx-orange-2: #ff8533;
  --gx-orange-3: #ff9900;
  --gx-brand: #8b0000;
  --gx-bg: #f5f5f5;
  --gx-bg-warm: #fff7f2;
  --gx-text: #333;
  --gx-muted: #999;
  --gx-card: #fff;
  --gx-radius: 12px;
  --gx-tab-h: 50px;
  --gx-safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--gx-bg);
  color: var(--gx-text);
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.gx-page {
  min-height: 100vh;
  padding-bottom: calc(var(--gx-tab-h) + var(--gx-safe-bottom) + 16px);
  background: linear-gradient(180deg, var(--gx-bg-warm) 0%, #f6f5f4 40%, #f3f2f1 100%);
}

.gx-page--plain { background: var(--gx-bg); }

.gx-safe-bottom {
  padding-bottom: calc(var(--gx-tab-h) + var(--gx-safe-bottom) + 12px);
}

/* ---- TabBar（对齐 xcx/custom-tab-bar） ---- */
.gx-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  height: var(--gx-tab-h);
  padding-bottom: var(--gx-safe-bottom);
  background: #fff;
  border-top: 1px solid #eee;
  z-index: 999;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
}

.gx-tabbar-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 10px;
  cursor: pointer;
  user-select: none;
}

.gx-tabbar-item.active { color: var(--gx-orange); }

.gx-tabbar-icon {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gx-tabbar-text {
  margin-top: 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
}

/* ---- 通用卡片 / 按钮 ---- */
.gx-card {
  background: var(--gx-card);
  border-radius: var(--gx-radius);
  margin: 10px 12px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.gx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.gx-btn--primary {
  background: linear-gradient(135deg, var(--gx-orange) 0%, var(--gx-orange-3) 100%);
  color: #fff;
}

.gx-btn--outline {
  background: #fff;
  color: var(--gx-orange);
  border: 1px solid #ffb380;
}

.gx-btn--block { width: 100%; display: flex; }

.gx-muted { color: var(--gx-muted); }
.gx-brand { color: var(--gx-brand); }
.gx-orange { color: var(--gx-orange); }

.gx-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--gx-muted);
  font-size: 13px;
}

.gx-loading {
  text-align: center;
  padding: 24px;
  color: var(--gx-muted);
}

/* ---- 首页 ---- */
.gx-nav-custom {
  padding: 12px 16px 8px;
}

.gx-nav-brand {
  font-size: 22px;
  font-weight: 800;
  color: var(--gx-brand);
  letter-spacing: 0.5px;
}

.gx-nav-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #a06050;
}

.gx-search-card {
  margin: 0 12px 10px;
  background: #fff;
  border-radius: 14px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(255, 103, 0, 0.08);
}

.gx-search-card input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
  background: transparent;
  min-width: 0;
}

.gx-search-share {
  flex-shrink: 0;
  background: var(--gx-orange);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.gx-entrance-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 12px 10px;
}

.gx-entrance-item {
  background: #fff;
  border-radius: 12px;
  padding: 12px 6px;
  text-align: center;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  cursor: pointer;
}

.gx-entrance-item img {
  width: 36px;
  height: 36px;
  margin: 0 auto 6px;
  border-radius: 10px;
  object-fit: cover;
}

.gx-entrance-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 6px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--gx-orange), var(--gx-orange-3));
}

.gx-tone-0 .gx-entrance-icon { background: linear-gradient(135deg, #ff6700, #ff9900); }
.gx-tone-1 .gx-entrance-icon { background: linear-gradient(135deg, #ff8533, #ffb84d); }
.gx-tone-2 .gx-entrance-icon { background: linear-gradient(135deg, #e85d04, #f48c06); }
.gx-tone-3 .gx-entrance-icon { background: linear-gradient(135deg, #dc2f02, #e85d04); }
.gx-tone-4 .gx-entrance-icon { background: linear-gradient(135deg, #9d0208, #d00000); }
.gx-tone-5 .gx-entrance-icon { background: linear-gradient(135deg, #370617, #6a040f); }
.gx-tone-6 .gx-entrance-icon { background: linear-gradient(135deg, #03071e, #370617); }
.gx-tone-7 .gx-entrance-icon { background: linear-gradient(135deg, #f48c06, #ffba08); }

.gx-notice-bar {
  margin: 0 12px 10px;
  background: #fff8f0;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  color: #8b4513;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}

.gx-banner-wrap {
  margin: 0 12px 10px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  height: 120px;
  background: linear-gradient(135deg, var(--gx-orange), var(--gx-orange-3));
}

.gx-banner-wrap img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.gx-cat-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 12px 10px;
  -webkit-overflow-scrolling: touch;
}

.gx-cat-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  background: #fff;
  border-radius: 16px;
  font-size: 12px;
  color: var(--gx-orange);
  border: 1px solid #ffe0cc;
  cursor: pointer;
}

.gx-cat-chip.active {
  background: var(--gx-orange);
  color: #fff;
  border-color: var(--gx-orange);
}

.gx-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px 8px;
  font-size: 15px;
  font-weight: 700;
}

.gx-section-more {
  font-size: 12px;
  color: var(--gx-muted);
  font-weight: 400;
  cursor: pointer;
}

.gx-goods-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 12px 12px;
}

.gx-goods-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  cursor: pointer;
}

.gx-goods-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #f0f0f0;
}

.gx-goods-info { padding: 8px; }

.gx-goods-name {
  font-size: 13px;
  line-height: 1.35;
  height: 2.7em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.gx-goods-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 6px;
  gap: 4px;
}

.gx-goods-price {
  color: #e54d42;
  font-weight: 700;
  font-size: 14px;
}

.gx-goods-commission {
  color: var(--gx-orange);
  font-size: 11px;
  white-space: nowrap;
}

/* ---- 分类页 ---- */
.gx-cat-layout {
  display: flex;
  min-height: calc(100vh - var(--gx-tab-h) - 100px);
}

.gx-cat-side {
  width: 88px;
  flex-shrink: 0;
  background: #f7f7f7;
  overflow-y: auto;
  max-height: calc(100vh - var(--gx-tab-h) - 100px);
}

.gx-cat-side-item {
  padding: 14px 8px;
  font-size: 12px;
  text-align: center;
  color: #666;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.gx-cat-side-item.active {
  background: #fff;
  color: var(--gx-orange);
  font-weight: 600;
  border-left-color: var(--gx-orange);
}

.gx-cat-main {
  flex: 1;
  min-width: 0;
  background: #fff;
  overflow-y: auto;
  max-height: calc(100vh - var(--gx-tab-h) - 100px);
  padding: 8px;
}

.gx-goods-row {
  display: flex;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid #f2f2f2;
  cursor: pointer;
}

.gx-goods-row img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f5f5f5;
}

.gx-goods-row-body { flex: 1; min-width: 0; }

/* ---- 本地生活 ---- */
.gx-ll-hero {
  margin: 12px;
  padding: 20px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ff6700 0%, #ff9900 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.gx-ll-hero h1 { margin: 0; font-size: 20px; }
.gx-ll-hero p { margin: 8px 0 0; font-size: 12px; opacity: 0.9; }

.gx-ll-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.gx-ll-tag {
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 11px;
}

.gx-ll-entries {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 12px 12px;
}

.gx-ll-entry {
  background: #fff;
  border-radius: 12px;
  padding: 14px 12px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.gx-ll-entry b { display: block; font-size: 14px; margin-bottom: 4px; }
.gx-ll-entry span { font-size: 11px; color: var(--gx-muted); }

/* ---- 发圈 ---- */
.gx-moments-hero {
  margin: 12px;
  padding: 18px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #8b0000, #ff6700);
  color: #fff;
}

.gx-moments-stats {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: 12px;
}

.gx-moments-stats b { display: block; font-size: 18px; }

.gx-moment-card {
  margin: 0 12px 10px;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.gx-moment-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.gx-moment-card p {
  margin: 0;
  font-size: 12px;
  color: var(--gx-muted);
  line-height: 1.4;
}

/* ---- 我的 ---- */
.gx-mine-profile {
  margin: 12px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #8b0000 0%, #ff6700 100%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
}

.gx-mine-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255,255,255,0.3);
  border: 2px solid rgba(255,255,255,0.5);
}

.gx-mine-name { font-size: 17px; font-weight: 700; }
.gx-mine-sub { font-size: 12px; opacity: 0.85; margin-top: 4px; }

.gx-mine-finance {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 12px 10px;
  background: #fff;
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.gx-mine-finance .v { font-size: 16px; font-weight: 700; color: var(--gx-orange); }
.gx-mine-finance .l { font-size: 11px; color: var(--gx-muted); margin-top: 4px; }

.gx-icon-matrix {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 12px 10px;
  background: #fff;
  border-radius: 12px;
  padding: 12px 8px;
}

.gx-icon-matrix-item {
  text-align: center;
  font-size: 11px;
  color: #555;
  cursor: pointer;
  padding: 6px 0;
}

.gx-icon-matrix-item .ico {
  width: 36px;
  height: 36px;
  margin: 0 auto 6px;
  border-radius: 10px;
  background: #fff7f0;
  color: var(--gx-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}

.gx-menu-list {
  margin: 0 12px 16px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.gx-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
  cursor: pointer;
}

.gx-menu-item:last-child { border-bottom: none; }
.gx-menu-item .arrow { color: #ccc; font-size: 12px; }

/* ---- 登录 ---- */
.gx-login-page {
  min-height: 100vh;
  background: linear-gradient(160deg, #fff7f2 0%, #ffe8d6 45%, #fff 100%);
  padding: 48px 24px 32px;
  position: relative;
  overflow: hidden;
}

.gx-login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.35;
  pointer-events: none;
}
.gx-login-orb-1 { width: 180px; height: 180px; background: #ff6700; top: -40px; right: -40px; }
.gx-login-orb-2 { width: 140px; height: 140px; background: #8b0000; bottom: 80px; left: -50px; }

.gx-login-hero { position: relative; z-index: 1; text-align: center; margin-bottom: 36px; }
.gx-login-logo {
  width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 18px;
  background: linear-gradient(135deg, #ff6700, #ff9900); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800;
}
.gx-login-hero h1 { margin: 0; font-size: 24px; color: var(--gx-brand); }
.gx-login-hero p { margin: 8px 0 0; color: #a06050; font-size: 13px; }

.gx-login-panel {
  position: relative; z-index: 1;
  background: #fff;
  border-radius: 16px;
  padding: 20px 16px;
  box-shadow: 0 8px 24px rgba(139, 0, 0, 0.08);
}

.gx-login-field {
  margin-bottom: 12px;
}
.gx-login-field label { display: block; font-size: 12px; color: #888; margin-bottom: 4px; }
.gx-login-field input {
  width: 100%;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  outline: none;
}
.gx-login-field input:focus { border-color: var(--gx-orange); }

.gx-login-tabs {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 14px;
}
.gx-login-tabs span { color: #999; cursor: pointer; padding-bottom: 4px; }
.gx-login-tabs span.active {
  color: var(--gx-orange);
  font-weight: 700;
  border-bottom: 2px solid var(--gx-orange);
}

.gx-wx-btn {
  background: #07c160 !important;
  margin-top: 12px;
}

.gx-code-row { display: flex; gap: 8px; }
.gx-code-row input { flex: 1; }
.gx-code-row button {
  flex-shrink: 0;
  border: none;
  background: #fff7f0;
  color: var(--gx-orange);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 12px;
  cursor: pointer;
}
