/* ============================================================
   mobile.css — 用户端样式（首页 / 分类页 / 活动详情页）
   移动端优先，适配 320px ~ 480px，桌面端最大 480px 居中
   ============================================================ */

/* ---------- 首页 Hero ---------- */
.home-hero {
  padding: 26px 18px 14px;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

.home-hero h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.home-hero .subtitle {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-2);
}

.home-body {
  padding: 0 14px 10px;
}

/* ---------- 首页公告 ---------- */
.home-notice {
  margin: 4px 14px 0;
}

/* ---------- 分类网格 ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.cat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 8px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.06s;
  -webkit-tap-highlight-color: transparent;
}

.cat-card:active {
  transform: scale(0.96);
}

.cat-card .cat-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--primary-weak);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  overflow: hidden;
}

.cat-card .cat-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cat-card .cat-name {
  font-size: 14px;
  font-weight: 600;
}

.cat-card .cat-sub {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  padding: 0 4px;
}

/* ---------- 推荐活动卡片 ---------- */
.reco-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reco-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.reco-card:active {
  background: #fafbfc;
}

.reco-card .reco-cover {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  flex: none;
  object-fit: cover;
  background: var(--primary-weak);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  overflow: hidden;
}

.reco-card .reco-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reco-card .reco-info {
  flex: 1;
  min-width: 0;
}

.reco-card .reco-name {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reco-card .reco-sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reco-card .reco-tags {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  overflow: hidden;
}

.reco-card .go {
  flex: none;
  color: var(--text-3);
  font-size: 14px;
}

/* ---------- 推荐活动：主推样式 ---------- */
.reco-card.featured {
  position: relative;
  border: 1px solid #cfe2ff;
  background: linear-gradient(180deg, #f2f8ff 0%, #ffffff 55%);
}

.reco-card .reco-badge {
  position: absolute;
  top: -9px;
  right: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.reco-card.featured .reco-cover {
  width: 64px;
  height: 64px;
}

/* ---------- 使用说明 ---------- */
.usage-card {
  padding: 14px 16px;
}

.usage-card ol {
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.usage-card li {
  counter-increment: step;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-2);
}

.usage-card li::before {
  content: counter(step);
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-weak);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

/* ---------- 分类页：分类头 ---------- */
.cat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px 4px;
}

.cat-header .cat-big-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--primary-weak);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex: none;
  overflow: hidden;
}

.cat-header .cat-big-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cat-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.cat-header .cat-sub {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}

/* ---------- 分类页：活动入口卡片 ---------- */
.act-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}

.act-card {
  padding: 14px;
}

.act-card .act-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.act-card .act-cover {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  flex: none;
  object-fit: cover;
  background: var(--primary-weak);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  overflow: hidden;
}

.act-card .act-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.act-card .act-info {
  flex: 1;
  min-width: 0;
}

.act-card .act-name {
  font-size: 16px;
  font-weight: 600;
}

.act-card .act-sub {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.act-card .act-tags {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.act-card .act-desc {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.act-card .act-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.act-card .act-footer .detail-link {
  font-size: 13px;
  color: var(--text-3);
}

/* ---------- 活动详情页 ---------- */
.act-detail {
  padding: 0 14px 90px;
}

.act-cover {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-top: 14px;
  background: var(--primary-weak);
}

.act-cover.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  background: var(--primary-weak);
}

.act-detail-title {
  margin-top: 16px;
}

.act-detail-title h2 {
  font-size: 20px;
  font-weight: 700;
}

.act-detail-title .sub {
  font-size: 14px;
  color: var(--text-2);
  margin-top: 4px;
}

.act-detail-title .tags {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.act-detail .block {
  margin-top: 16px;
}

.act-detail .block-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.act-detail .block-card {
  padding: 14px 16px;
}

.act-detail .desc-text {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.act-steps {
  counter-reset: astep;
}

.act-steps li {
  counter-increment: astep;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-2);
}

.act-steps li::before {
  content: counter(astep);
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 3px;
}

.act-notice {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.act-notice li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}

.act-notice li::before {
  content: "·";
  flex: none;
  font-weight: 700;
  color: var(--text-3);
}

/* ---------- 底部领取按钮（sticky） ---------- */
.act-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 30;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
}

/* ---------- 弹窗内容 ---------- */
.qr-img {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.qr-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
  margin-top: 10px;
}

.copy-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
  line-height: 1.8;
  user-select: all;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
}

.copy-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
}

.inst-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inst-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
}

.inst-list li .num {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-weak);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 3px;
}

/* ---------- SVG 图标徽章（内联 SVG + 渐变底） ---------- */
.cat-svg svg {
  flex: none;
  display: block;
}

/* ---------- 小屏适配（320px 左右） ---------- */
@media (max-width: 359px) {
  body { font-size: 14px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .home-hero h1 { font-size: 21px; }
}
