/* =====================================================================
 *  子页共享框架 (subpage.css)
 *  用于 /benefits/ /club/ /honors/ 等独立详情页。
 *  在 styles.css 之后加载，复用主站设计令牌（--navy / --gold / --ivory 等）。
 * ===================================================================== */

/* ---------- 子页顶栏（深蓝，与主站导航同族） ---------- */
/* 启动闸门：页面内容由 JS 渲染，首次绘制前隐藏，避免"先画空框架再注入卡片"
 * 造成的布局位移（CLS）。JS 渲染完成后由页面内联脚本移除 booting。
 * 禁用 JS 时该类不会被添加，内容正常显示。 */
html.booting body { visibility: hidden; }

.sub-topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy-900);
  border-bottom: 1px solid rgba(197, 161, 91, 0.25);
}
.sub-topbar__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
  min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.sub-topbar__brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: #fff; min-height: 44px; }
.sub-topbar__brand img { width: 32px; height: 32px; object-fit: contain; }
.sub-topbar__brand span {
  overflow: hidden; font-size: 14.5px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis;
}
.sub-topbar__back {
  flex: 0 0 auto; min-height: 44px; display: inline-flex; align-items: center;
  color: var(--gold-lt); font-size: 14px; font-weight: 600;
}

/* ---------- 子页页头 ---------- */
.sub-hero { padding: 40px 0 8px; text-align: center; }
.sub-hero__title {
  margin: 0; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(28px, 7vw, 38px); color: var(--navy-900); letter-spacing: 0.01em;
}
.sub-hero__en {
  margin: 6px 0 0; font-size: 11.5px; letter-spacing: 0.28em; color: var(--gold-deep);
  text-transform: uppercase; font-weight: 600;
}
/* ≤360px 小屏隐藏低优先级英文副标题，节省首屏纵向空间 */
@media (max-width: 360px) {
  .sub-hero__en { display: none; }
}
.sub-hero__lead {
  margin: 14px auto 0; max-width: 640px; color: var(--muted); font-size: 16px; line-height: 1.7;
}

/* ---------- 页面级分享按钮（data-share-page，微信转发高频页） ---------- */
.share-page {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px; padding: 9px 16px; min-height: 40px;
  font-size: 13px; font-weight: 600; color: var(--navy-800);
  background: var(--white); border: 1.5px solid rgba(10, 35, 66, 0.2); border-radius: 999px;
  cursor: pointer;
}
.share-page svg { width: 15px; height: 15px; }
.share-page:active { transform: scale(0.96); }
@media (prefers-reduced-motion: reduce) {
  .share-page:active { transform: none; }
}

/* ---------- 子页区块 ---------- */
.sub-sec { padding: 28px 0 8px; }
.sub-sec__title {
  margin: 0 0 16px; font-size: 19px; font-weight: 800; color: var(--navy-800);
  display: flex; align-items: baseline; gap: 10px;
}
.sub-sec__title small { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 0.08em; }

/* ---------- 筛选 Chips（横向滑动，不挤成多行小按钮） ---------- */
.chip-row {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  /* 右缘渐隐：提示可横滑，避免最后一个 chip 被裁成像破版 */
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent 100%);
}
.chip-row::-webkit-scrollbar { display: none; }
/* hidden 属性优先：组件 display 不可盖掉原生隐藏（否则筛选器"隐藏"失效） */
.chip-row[hidden], .viewer[hidden], .sheet[hidden] { display: none; }
.chip {
  flex: 0 0 auto; min-height: 44px; display: inline-flex; align-items: center;
  padding: 8px 16px; border-radius: 999px; border: 1.5px solid rgba(10, 35, 66, 0.18);
  background: var(--white); color: var(--navy-800); font-size: 14px; cursor: pointer;
}
.chip.is-active { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.chip-search {
  flex: 1 1 160px; min-height: 44px; min-width: 140px;
  padding: 8px 14px; border-radius: 999px; border: 1.5px solid rgba(10, 35, 66, 0.18);
  font-size: 14px; background: var(--white); color: var(--ink);
}

/* ---------- 权益 / 球场卡 ---------- */
.course-list { display: grid; gap: 18px; }
/* 会员臻选商品：桌面端两栏，手机保持单栏 */
@media (min-width: 761px) {
  #productList { grid-template-columns: 1fr 1fr; }
}
.course-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(7, 21, 34, 0.05);
  display: flex; flex-direction: column;
}
.course-card__cover {
  aspect-ratio: 16 / 9; background: var(--navy-800); position: relative; overflow: hidden;
}
.course-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.course-card__badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--gold); color: var(--navy-900);
  font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px;
}
.course-card__badge.is-soon { background: var(--navy-800); color: var(--gold-lt); }
.course-card__badge.is-off { background: #4d5560; color: #fff; } /* 对比度 ≥4.5:1（a11y） */
.course-card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.course-card__name { margin: 0 0 4px; font-size: 18px; font-weight: 800; color: var(--navy-800); }
.course-card__meta { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.course-card__perk { margin: 0 0 10px; color: #75591B; font-size: 14px; font-weight: 700; line-height: 1.5; }
.course-card__items { margin: 0 0 12px; padding: 0; list-style: none; }
.course-card__items li {
  font-size: 14px; color: #36405a; line-height: 1.6; padding-left: 16px; position: relative;
}
.course-card__items li::before {
  content: ""; position: absolute; left: 2px; top: 9px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--gold);
}
.course-card__foot {
  margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line);
  font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px;
}
/* 信息待复核标记（lastVerifiedAt 超过 benefitFreshness.reviewAfterDays） */
.course-card__recheck {
  color: #9A6A00; background: rgba(197,161,91,0.16); border-radius: 999px;
  padding: 1px 10px; font-size: 12px; font-weight: 600;
}
.course-card__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.course-card__actions .btn { flex: 1 1 110px; text-align: center; white-space: nowrap; }
.course-card.is-off { opacity: 0.72; }
.course-card.is-off .course-card__cover img { filter: grayscale(0.5); }

/* ---------- 空状态 ---------- */
.sub-empty {
  border: 1px dashed var(--gold); border-radius: var(--radius);
  background: rgba(201, 162, 74, 0.06); padding: 28px 22px; text-align: center;
}
.sub-empty__title { font-weight: 800; color: var(--navy-800); font-size: 16px; }
.sub-empty__desc { margin: 8px 0 16px; color: var(--muted); font-size: 14px; line-height: 1.7; }

/* ---------- 底部动作面板 / 详情面板（同一层 sheet） ---------- */
.sheet { position: fixed; inset: 0; z-index: 90; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(7, 21, 34, 0.55); }
.sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88dvh;
  background: var(--paper); border-radius: 18px 18px 0 0;
  display: flex; flex-direction: column; overflow: hidden;
  animation: sheet-up .22s ease;
  transition: transform .18s ease; /* 下滑关闭松手后回弹 */
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
/* 单手操作 grabber：面板顶部抓握条 */
.sheet__grabber {
  flex: 0 0 auto; width: 40px; height: 4px; border-radius: 2px;
  background: rgba(10, 35, 66, 0.22); margin: 8px auto 0;
  touch-action: none;
}
.sheet__head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--white);
}
.sheet__title { flex: 1; min-width: 0; font-weight: 800; font-size: 16px; color: var(--navy-800);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sheet__close {
  flex: 0 0 auto; width: 44px; height: 44px; border: none; background: none;
  font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1;
}
.sheet__body { flex: 1; overflow-y: auto; padding: 18px 18px calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 761px) {
  .sheet__panel {
    left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%);
    width: min(640px, 92vw); max-height: 86vh; border-radius: 18px;
    animation: sheet-pop .18s ease;
  }
  @keyframes sheet-pop { from { opacity: 0.4; } to { opacity: 1; } }
}

/* 详情面板内容 */
.sheet__cover { margin: -18px -18px 16px; }
.sheet__cover img { width: 100%; max-height: 300px; object-fit: cover; }
.sheet__perk {
  margin: 0 0 14px; padding: 12px 16px; border-radius: 10px;
  background: rgba(201, 162, 74, 0.12); border: 1px dashed var(--gold);
  color: #75591B; font-weight: 700; font-size: 15px; line-height: 1.6;
}
.info-rows { margin: 0 0 14px; border-top: 1px solid var(--line); }
.info-rows__row { display: flex; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.info-rows__k { flex: 0 0 76px; color: var(--muted); }
.info-rows__v { flex: 1; color: var(--ink); line-height: 1.55; }
.sheet__desc p { margin: 0 0 12px; font-size: 16px; line-height: 1.72; color: #2b3344; }
.sheet__photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.sheet__photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; cursor: zoom-in; }

/* 动作面板列表 */
.sheet-actions { display: grid; gap: 8px; }
.sheet-action {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 52px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--white); cursor: pointer;
  text-align: left; font-size: 15px; color: var(--ink);
}
.sheet-action:active { transform: scale(0.98); }
.sheet-action__ic { flex: 0 0 auto; width: 24px; height: 24px; color: var(--navy-800); }
.sheet-action__label { font-weight: 700; color: var(--navy-800); }
.sheet-action__sub { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.sheet-action__qr { width: 100%; max-width: 240px; margin: 6px auto; display: block; border-radius: 10px; }

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: var(--navy-900); color: var(--gold-lt); font-size: 14px;
  padding: 10px 18px; border-radius: 999px; z-index: 135; box-shadow: var(--shadow);
}

/* ---------- 微信分享引导浮层（复制链接 + 指引右上角「···」转发） ---------- */
.share-guide { position: fixed; inset: 0; z-index: 125; background: rgba(4, 12, 20, 0.82); }
.share-guide[hidden] { display: none; }
.share-guide__arrow {
  position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 14px;
  width: 72px; height: 72px; color: var(--gold-lt);
}
.share-guide__card {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(320px, 86vw); background: var(--white); border-radius: 16px;
  padding: 22px 20px 18px; text-align: center;
}
.share-guide__title { font-size: 17px; font-weight: 800; color: var(--navy-800); margin-bottom: 12px; }
.share-guide__steps {
  margin: 0 0 14px; padding-left: 20px; text-align: left;
  font-size: 14.5px; line-height: 1.9; color: #2b3344;
}
.share-guide__steps b { color: var(--navy-800); }
.share-guide__link {
  width: 100%; padding: 9px 12px; margin-bottom: 14px; font-size: 13px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--muted);
}
.share-guide__close {
  width: 100%; min-height: 44px; border: none; border-radius: 999px;
  background: var(--navy-800); color: var(--gold-lt); font-size: 15px; font-weight: 700; cursor: pointer;
}

/* ---------- 全屏单图查看器 ---------- */
.viewer { position: fixed; inset: 0; z-index: 110; background: rgba(4, 12, 20, 0.96); display: flex; align-items: center; justify-content: center; }
.viewer__img { max-width: 100vw; max-height: 100dvh; object-fit: contain; }
.viewer__close {
  position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px;
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 26px; cursor: pointer;
}
.viewer__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 26px; cursor: pointer;
}
.viewer__nav--prev { left: 10px; }
.viewer__nav--next { right: 10px; }
.viewer__count {
  position: absolute; bottom: calc(14px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8); font-size: 13px;
}

/* ---------- 子页页脚 ---------- */
.sub-footer {
  margin-top: 44px; padding: 32px 20px calc(34px + env(safe-area-inset-bottom));
  background: var(--navy-950); color: rgba(255, 255, 255, 0.75); text-align: center;
}
.sub-footer img { width: 40px; height: 40px; object-fit: contain; margin: 0 auto; }
.sub-footer p { margin: 10px 0; font-size: 13px; letter-spacing: 0.1em; }
.sub-footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 8px; }
.sub-footer__links a {
  min-height: 44px; display: inline-flex; align-items: center;
  color: var(--gold-lt); font-size: 13px;
}

/* ---------- 文档型内容（/club/ /honors/ 用） ---------- */
.doc-sec { padding: 22px 0; border-top: 1px solid var(--line); }
.doc-sec:first-of-type { border-top: none; }
.doc-sec__title { margin: 0 0 12px; font-size: 20px; font-weight: 800; color: var(--navy-800); font-family: var(--font-display); }
.doc-sec p { margin: 0 0 12px; font-size: 16px; line-height: 1.72; color: #2b3344; }

@media (prefers-reduced-motion: reduce) {
  .sheet__panel { animation: none; }
  .sheet-action:active { transform: none; }
}

/* ---------- 赛事中心：历史回顾行 / 今日提示（TASK-006A） ---------- */
.ev-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 13px 16px; margin-bottom: 8px; min-height: 44px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 15.5px; font-weight: 700; color: var(--navy-800); cursor: pointer;
}
.ev-row:active { transform: scale(0.98); }
.ev-row__title { flex: 0 1 auto; }
.ev-row__meta { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); font-weight: 400;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: right; }
.ev-row__go { color: var(--gold-deep); font-size: 20px; line-height: 1; }
.ev-today-note { text-align: center; color: var(--muted); font-size: 13px; margin: 10px 0 0; }

/* 详情面板底部动作行：分享 + 主动作并排（TASK-006A 四节） */
.sheet__foot-actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet__foot-actions .btn { flex: 1; }
.sheet-actions .sheet-action { width: 100%; }
