/* AI增长学苑 H5 Demo */
:root {
  --ink: #0b1f33;
  --ink-soft: #1e3a5f;
  --navy: #123a63;
  --accent: #e8782a;
  --accent-deep: #c45f18;
  --gold: #f0b429;
  --mint: #1fa97a;
  --rose: #e24b6a;
  --bg: #f3f1ec;
  --bg-card: #ffffff;
  --bg-soft: #e9eef5;
  --line: rgba(18, 58, 99, 0.1);
  --text: #152033;
  --text-2: #5b677a;
  --text-3: #8b95a5;
  --shadow: 0 8px 28px rgba(11, 31, 51, 0.1);
  --shadow-soft: 0 2px 10px rgba(11, 31, 51, 0.06);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --phone-w: 390px;
  --font-display: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(232, 120, 42, 0.12), transparent 50%),
    radial-gradient(ellipse 70% 40% at 90% 80%, rgba(18, 58, 99, 0.18), transparent 45%),
    #0a1420;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ========== Device shell ========== */
.device-frame {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.phone {
  width: min(100%, var(--phone-w));
  height: min(100%, 844px);
  max-height: 100%;
  background: var(--bg);
  border-radius: 40px;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 0 0 11px #1a1d24,
    0 0 0 13px #3d4450,
    0 30px 80px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

@media (max-width: 430px) {
  .device-frame { padding: 0; }
  .phone {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ========== Status bar ========== */
.status-bar {
  height: 44px;
  padding: 0 22px 4px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  z-index: 40;
  color: var(--text);
  background: transparent;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}

.signal {
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 11px;
}

.signal i {
  width: 3px;
  background: currentColor;
  border-radius: 1px;
}

.signal i:nth-child(1) { height: 3px; }
.signal i:nth-child(2) { height: 5px; }
.signal i:nth-child(3) { height: 8px; }
.signal i:nth-child(4) { height: 11px; }

.battery {
  width: 22px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 2.5px;
  padding: 1px;
  position: relative;
}

.battery::after {
  content: "";
  position: absolute;
  right: -3.5px;
  top: 2.5px;
  width: 2px;
  height: 4px;
  background: currentColor;
  border-radius: 0 1px 1px 0;
}

.battery b {
  display: block;
  height: 100%;
  width: 72%;
  background: currentColor;
  border-radius: 1px;
}

/* ========== App shell ========== */
.app {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg);
}

.pages {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s;
  z-index: 1;
}

.page.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  z-index: 2;
}

.page-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 20px);
  overscroll-behavior-y: contain;
}

.page-scroll::-webkit-scrollbar { width: 0; height: 0; }

/* ========== Tabbar ========== */
.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 6px 8px var(--safe-b);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(11, 31, 51, 0.05);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 500;
  transition: color 0.2s;
}

.tab-item .icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

.tab-item.active {
  color: var(--navy);
  font-weight: 600;
}

.tab-item.active .icon {
  transform: scale(1.08);
}

/* ========== Common UI ========== */
.topbar {
  padding: 4px 16px 12px;
  flex-shrink: 0;
}

.brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1.2;
}

.brand-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.01em;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: var(--shadow-soft);
  display: grid;
  place-items: center;
  font-size: 18px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.icon-btn:active { transform: scale(0.95); }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 10px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.section-more {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-soft);
  color: var(--navy);
  white-space: nowrap;
}

.chip.orange {
  background: rgba(232, 120, 42, 0.12);
  color: var(--accent-deep);
}

.chip.green {
  background: rgba(31, 169, 122, 0.12);
  color: var(--mint);
}

.chip.gold {
  background: rgba(240, 180, 41, 0.18);
  color: #9a6b00;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.12s, opacity 0.2s, background 0.2s;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(232, 120, 42, 0.35);
}

.btn-navy {
  background: linear-gradient(135deg, var(--navy) 0%, var(--ink) 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(18, 58, 99, 0.3);
}

.btn-ghost {
  background: var(--bg-card);
  color: var(--navy);
  border: 1px solid var(--line);
}

.btn-block { width: 100%; }

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

/* ========== Banner / notice ========== */
.source-banner {
  margin: 0 16px 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(232, 120, 42, 0.14), rgba(18, 58, 99, 0.08));
  border: 1px solid rgba(232, 120, 42, 0.25);
  font-size: 12px;
  color: var(--ink-soft);
  display: none;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.45;
}

.source-banner.show { display: flex; }

.source-banner strong { color: var(--accent-deep); }

.demo-entries {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  overflow-x: auto;
}

.demo-entries::-webkit-scrollbar { display: none; }

.demo-entry {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px dashed rgba(18, 58, 99, 0.25);
  color: var(--navy);
}

.demo-entry:active { background: var(--bg-soft); }

/* ========== Course feed ========== */
.course-feed {
  position: relative;
  min-height: calc(100% - 20px);
  padding: 0 16px;
}

.course-nav-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

.course-card {
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: cardIn 0.35s ease;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ========== Video stage ========== */
.video-stage {
  position: relative;
  height: 240px;
  color: #fff;
  overflow: hidden;
  background: #0a1624;
  user-select: none;
}

.video-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(232, 120, 42, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 50% at 15% 80%, rgba(31, 169, 122, 0.18), transparent 50%),
    linear-gradient(165deg, #122a45 0%, #0b1a2c 48%, #13261c 100%);
}

.video-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.55;
  animation: orbFloat 8s ease-in-out infinite;
}

.video-orb.o1 {
  width: 140px;
  height: 140px;
  right: -20px;
  top: -30px;
  background: radial-gradient(circle, rgba(240, 180, 41, 0.55), transparent 70%);
}

.video-orb.o2 {
  width: 100px;
  height: 100px;
  left: 10%;
  bottom: 10%;
  background: radial-gradient(circle, rgba(90, 160, 255, 0.35), transparent 70%);
  animation-delay: -3s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-8px, 10px) scale(1.06); }
}

.video-grid {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, #000 20%, transparent 90%);
}

.video-stage.playing .video-bg {
  animation: stagePulse 2.4s ease-in-out infinite;
}

@keyframes stagePulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}

.video-topbar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.video-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(232, 120, 42, 0.92);
  color: #fff;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 12px rgba(232, 120, 42, 0.35);
}

.video-stage.playing .video-badge {
  background: rgba(226, 75, 106, 0.95);
  animation: pulseDot 1.4s ease infinite;
}

.video-status-pill {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
}

.video-play-btn {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 4;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s, background 0.2s, opacity 0.25s;
}

.video-play-btn:active { transform: translate(-50%, -50%) scale(0.94); }

.video-stage.playing .video-play-btn {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.8);
}

.video-play-btn .play-icon {
  font-size: 22px;
  margin-left: 3px;
  color: #fff;
  line-height: 1;
}

.video-play-btn .play-icon.pause {
  display: flex;
  gap: 5px;
  margin-left: 0;
}

.video-play-btn .play-icon.pause i {
  display: block;
  width: 5px;
  height: 18px;
  border-radius: 2px;
  background: #fff;
}

.video-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 72px;
  z-index: 3;
  padding: 0 16px;
  pointer-events: none;
}

.video-caption::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -72px;
  height: 160px;
  background: linear-gradient(to top, rgba(8, 14, 24, 0.92) 20%, transparent);
  z-index: -1;
  pointer-events: none;
}

.video-academy {
  font-size: 11px;
  opacity: 0.8;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.video-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  max-width: 95%;
}

.video-learn-prog {
  margin-top: 6px;
  font-size: 11px;
  opacity: 0.8;
  min-height: 14px;
}

.video-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 8px 14px 12px;
}

.video-time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  opacity: 0.85;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.video-time-row #previewLabel {
  flex: 1;
  text-align: center;
  opacity: 0.75;
}

.video-track {
  position: relative;
  height: 16px;
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  cursor: pointer;
}

.video-track-bg {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
}

.video-track .preview-bar {
  position: absolute;
  left: 0;
  height: 3px;
  border-radius: 2px;
  width: 0%;
  background: linear-gradient(90deg, #ff9a4a, #f0b429);
  box-shadow: 0 0 8px rgba(240, 180, 41, 0.45);
  transition: width 0.1s linear;
}

.video-knob {
  display: none;
}

.video-ctrl-btns {
  display: flex;
  gap: 8px;
}

.vctrl {
  flex: 1;
  height: 34px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
}

.vctrl:active { transform: scale(0.97); }

.vctrl.ghost {
  flex: 0.75;
  background: transparent;
  opacity: 0.9;
}

/* Engage bar */
.engage-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: -4px 0 14px;
  padding: 4px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f7f5f1, #fff);
  border: 1px solid var(--line);
}

.engage-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px 8px;
  border-radius: 12px;
  transition: background 0.15s, transform 0.12s;
  color: var(--text-2);
}

.engage-btn:active {
  transform: scale(0.94);
  background: var(--bg-soft);
}

.engage-btn.on {
  color: var(--accent-deep);
  background: rgba(232, 120, 42, 0.08);
}

.engage-btn.on .engage-ico {
  transform: scale(1.08);
}

.engage-ico {
  font-size: 20px;
  line-height: 1.2;
  transition: transform 0.15s;
}

.engage-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.engage-btn.on .engage-num { color: var(--accent-deep); }

.engage-lab {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 500;
}

.engage-btn.on .engage-lab { color: var(--accent-deep); }

/* Share sheet */
.share-card {
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #163a62, #0b1f33);
  color: #fff;
  margin-bottom: 14px;
}

.share-course {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.35;
}

.share-desc {
  font-size: 12px;
  opacity: 0.85;
  line-height: 1.45;
}

.share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.share-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.share-item:active {
  transform: scale(0.97);
  background: var(--bg-soft);
}

.si-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: var(--shadow-soft);
}

.course-body { padding: 14px 16px 16px; }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.meta-block {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.meta-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.45;
}

.meta-item .label {
  color: var(--text-3);
  font-weight: 500;
}

.meta-item .value { color: var(--text); }

.hook-box {
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(232, 120, 42, 0.08), rgba(18, 58, 99, 0.04));
  border: 1px solid rgba(232, 120, 42, 0.15);
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 14px;
}

.hook-box em {
  font-style: normal;
  color: var(--accent-deep);
  font-weight: 600;
}

.course-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.course-actions .btn-primary { grid-column: 1 / -1; }

.swipe-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 8px;
}

.swipe-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(18, 58, 99, 0.15);
  transition: all 0.2s;
}

.swipe-dots span.active {
  width: 16px;
  border-radius: 4px;
  background: var(--navy);
}

.course-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
}

.pager-btn {
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--navy);
  font-size: 12px;
  font-weight: 500;
}

.pager-btn:disabled {
  opacity: 0.4;
}

.recommend-strip {
  margin-top: 16px;
  padding-bottom: 8px;
}

.recommend-strip h4 {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 8px;
}

.rec-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.rec-scroll::-webkit-scrollbar { display: none; }

.rec-chip {
  flex-shrink: 0;
  max-width: 180px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  text-align: left;
}

.rec-chip .t {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rec-chip .s {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-3);
}

/* ========== Activity page ========== */
.page-hero {
  margin: 0 16px 14px;
  padding: 16px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(232, 120, 42, 0.2), transparent 50%),
    linear-gradient(160deg, #123a63, #0b1f33);
  color: #fff;
  box-shadow: var(--shadow);
}

.page-hero h2 {
  font-family: var(--font-display);
  font-size: 20px;
  margin-bottom: 6px;
}

.page-hero p {
  font-size: 12.5px;
  opacity: 0.88;
  line-height: 1.5;
}

.member-banner {
  margin: 0 16px 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(90deg, #fff8ef, #fff);
  border: 1px solid rgba(232, 120, 42, 0.25);
  display: flex;
  align-items: center;
  gap: 12px;
}

.member-banner .emoji {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(232, 120, 42, 0.12);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.member-banner .txt { flex: 1; min-width: 0; }
.member-banner .txt b { display: block; font-size: 13px; color: var(--ink); }
.member-banner .txt span { font-size: 11px; color: var(--text-2); }

.activity-list {
  padding: 0 16px;
  display: grid;
  gap: 10px;
}

.activity-card {
  padding: 14px;
  text-align: left;
  width: 100%;
  transition: transform 0.12s;
}

.activity-card:active { transform: scale(0.99); }

.activity-card .top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.activity-card .title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

.activity-card .sub {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.45;
  margin-bottom: 10px;
}

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 11px;
  color: var(--text-3);
}

.activity-meta span { display: inline-flex; align-items: center; gap: 3px; }

.badge-member {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(232, 120, 42, 0.12);
  color: var(--accent-deep);
  font-weight: 600;
  flex-shrink: 0;
}

.badge-done {
  background: rgba(31, 169, 122, 0.12);
  color: var(--mint);
}

.spacer-sm { height: 8px; }
.spacer-md { height: 16px; }

/* ========== Mine page ========== */
.profile-head {
  margin: 0 16px 14px;
  padding: 18px 16px;
  border-radius: 20px;
  background:
    linear-gradient(145deg, #163a62 0%, #0b1f33 60%, #1a2f24 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.profile-head::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -30px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 120, 42, 0.3), transparent 65%);
}

.profile-head > * { position: relative; z-index: 1; }

.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f0b429, #e8782a);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.profile-info h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.identity-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.identity-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.identity-pill.member {
  background: rgba(240, 180, 41, 0.25);
  border-color: rgba(240, 180, 41, 0.4);
}

.identity-pill.partner {
  background: rgba(31, 169, 122, 0.22);
  border-color: rgba(31, 169, 122, 0.35);
}

.member-card {
  margin: 0 16px 14px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff9f0, #fff);
  border: 1px solid rgba(232, 120, 42, 0.22);
  box-shadow: var(--shadow-soft);
}

.member-card.on {
  background: linear-gradient(135deg, #1a3a24, #0f2a1a);
  border-color: rgba(31, 169, 122, 0.35);
  color: #fff;
}

.member-card .mc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.member-card .mc-title {
  font-size: 15px;
  font-weight: 700;
}

.member-card .mc-price {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-deep);
}

.member-card.on .mc-price { color: #8dffc4; }

.member-card .mc-desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 12px;
}

.member-card.on .mc-desc { color: rgba(255, 255, 255, 0.78); }

.stat-grid {
  margin: 0 16px 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stat-item {
  padding: 12px 6px;
  text-align: center;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
}

.stat-item .n {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.stat-item .l {
  margin-top: 2px;
  font-size: 10px;
  color: var(--text-3);
}

.mine-block {
  margin: 0 16px 14px;
  padding: 14px;
}

.mine-block h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mine-block .empty {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
  padding: 4px 0;
}

.list-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.list-line:last-child { border-bottom: none; }

.list-line .lt { color: var(--text); font-weight: 500; flex: 1; min-width: 0; }
.list-line .lr { color: var(--text-3); font-size: 12px; flex-shrink: 0; }

.partner-panel {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: none;
}

.partner-panel.open { display: block; }

.partner-panel ul {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.partner-panel li {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.45;
  padding-left: 14px;
  position: relative;
}

.partner-panel li::before {
  content: "·";
  position: absolute;
  left: 2px;
  color: var(--accent);
  font-weight: 700;
}

.partner-note {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.45;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: var(--bg-soft);
  border-radius: 8px;
}

/* ========== Overlays / sheets ========== */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 200;
  background: rgba(8, 14, 24, 0.48);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.overlay.open {
  opacity: 1;
  visibility: visible;
}

.overlay.center {
  align-items: center;
  padding: 20px;
}

.sheet {
  width: 100%;
  max-height: 88%;
  background: var(--bg-card);
  border-radius: 22px 22px 0 0;
  transform: translateY(24px);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.overlay.open .sheet { transform: translateY(0); }

.sheet-half { max-height: 72%; }

.modal-card {
  width: 100%;
  max-width: 340px;
  background: var(--bg-card);
  border-radius: 20px;
  padding: 20px;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.28s ease;
  box-shadow: var(--shadow);
}

.overlay.open .modal-card { transform: scale(1) translateY(0); }

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.12);
  margin: 10px auto 6px;
  flex-shrink: 0;
}

.sheet-header {
  padding: 6px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.sheet-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  font-size: 16px;
  color: var(--text-2);
}

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px calc(20px + var(--safe-b));
  -webkit-overflow-scrolling: touch;
}

.sheet-body::-webkit-scrollbar { width: 0; }

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.detail-block {
  margin-bottom: 14px;
}

.detail-block h5 {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 6px;
  font-weight: 600;
}

.detail-block p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}

.chapter-list {
  display: grid;
  gap: 8px;
}

.chapter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  text-align: left;
  width: 100%;
}

.chapter-item .idx {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
}

.chapter-item .info { flex: 1; min-width: 0; }
.chapter-item .info .t {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.chapter-item .info .d {
  font-size: 11px;
  color: var(--text-3);
}

.chapter-item .lock {
  font-size: 11px;
  color: var(--accent-deep);
  font-weight: 600;
  flex-shrink: 0;
}

.chapter-item.free .lock { color: var(--mint); }

.sheet-footer {
  padding: 12px 16px calc(12px + var(--safe-b));
  border-top: 1px solid var(--line);
  background: var(--bg-card);
  flex-shrink: 0;
  display: grid;
  gap: 8px;
}

/* Member flow */
.member-hero {
  text-align: center;
  padding: 8px 0 16px;
}

.member-hero .price {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--accent-deep);
  line-height: 1.1;
}

.member-hero .period {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
}

.benefit-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.benefit-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 12px;
}

.benefit-list li .ico {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.steps {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.step-dot {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-soft);
}

.step-dot.on { background: var(--accent); }
.step-dot.done { background: var(--mint); }

.flow-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink);
}

.flow-desc {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 14px;
}

.fake-auth {
  padding: 14px;
  border-radius: 14px;
  background: #f7f8fa;
  border: 1px solid var(--line);
  margin-bottom: 14px;
}

.fake-auth .row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}

.fake-auth .row:last-child { border-bottom: none; }
.fake-auth .k { color: var(--text-3); }
.fake-auth .v { color: var(--text); font-weight: 500; }

.form-field {
  margin-bottom: 12px;
}

.form-field label {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 6px;
}

.form-field input,
.form-field select {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
}

.form-field input:focus,
.form-field select:focus {
  border-color: rgba(232, 120, 42, 0.5);
  box-shadow: 0 0 0 3px rgba(232, 120, 42, 0.12);
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(31, 169, 122, 0.12);
  color: var(--mint);
  display: grid;
  place-items: center;
  font-size: 32px;
  margin: 8px auto 14px;
}

/* Xiaoyuan */
.search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.search-box input {
  flex: 1;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: var(--bg);
}

.search-box input:focus {
  border-color: rgba(18, 58, 99, 0.35);
  background: #fff;
}

.preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.preset-btn {
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  font-size: 12px;
  color: var(--navy);
  font-weight: 500;
  border: 1px solid transparent;
}

.preset-btn:active {
  border-color: rgba(18, 58, 99, 0.2);
  background: #fff;
}

.xy-note {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.45;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: rgba(18, 58, 99, 0.04);
  border-radius: 8px;
}

.xy-results {
  display: grid;
  gap: 8px;
}

.xy-card {
  padding: 12px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  text-align: left;
  width: 100%;
}

.xy-card .t {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 4px;
}

.xy-card .s {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.4;
}

/* Poster */
.poster-preview {
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(160deg, #123a63, #0b1f33 60%, #1f3a28);
  color: #fff;
  padding: 24px 18px;
  text-align: center;
  margin-bottom: 12px;
}

.poster-preview .logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}

.poster-preview .slogan {
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: 18px;
  opacity: 0.95;
}

.poster-qr {
  width: 88px;
  height: 88px;
  margin: 0 auto 12px;
  border-radius: 12px;
  background:
    repeating-linear-gradient(0deg, #fff 0 4px, #111 4px 8px),
    repeating-linear-gradient(90deg, #fff 0 4px, #111 4px 8px);
  background-blend-mode: difference;
  border: 6px solid #fff;
}

.poster-preview .foot {
  font-size: 11px;
  opacity: 0.7;
}

/* Toast */
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px);
  transform: translateX(-50%) translateY(12px);
  max-width: 80%;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: rgba(11, 31, 51, 0.9);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  z-index: 400;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  pointer-events: none;
  text-align: center;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Utility */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-8 { margin-bottom: 8px; }
.fw-6 { font-weight: 600; }

.filter-placeholder {
  margin: 0 16px 12px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.filter-placeholder span {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
}

.filter-placeholder span.on {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* ========== V1.1: preview / role / progress / compare ========== */
.role-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px 12px;
  overflow-x: auto;
}

.role-bar::-webkit-scrollbar { display: none; }

.role-label {
  font-size: 11px;
  color: var(--text-3);
  flex-shrink: 0;
  font-weight: 600;
}

.role-chip {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text-2);
}

.role-chip.on {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(226, 75, 106, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(226, 75, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(226, 75, 106, 0); }
}

.compare-table {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 14px;
  font-size: 12px;
}

.compare-head,
.compare-row {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr;
  gap: 4px;
  padding: 10px 12px;
  align-items: center;
}

.compare-head {
  background: var(--bg-soft);
  font-weight: 700;
  color: var(--ink);
}

.compare-row {
  border-top: 1px solid var(--line);
  color: var(--text-2);
}

.compare-head .hl,
.compare-row .hl {
  color: var(--accent-deep);
  font-weight: 700;
  text-align: center;
}

.compare-row span:nth-child(2),
.compare-head span:nth-child(2) {
  text-align: center;
}

.fit-box {
  padding: 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  margin-bottom: 12px;
}

.fit-box b {
  display: block;
  font-size: 12px;
  color: var(--ink);
  margin-bottom: 4px;
}

.fit-box b + p {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.45;
  margin-bottom: 10px;
}

.fit-box b:last-of-type + p { margin-bottom: 0; }

.learn-row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.learn-row:last-child { border-bottom: none; }

.learn-row-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}

.learn-row-top .lt { font-weight: 600; color: var(--text); }
.learn-row-top .lr { font-size: 12px; color: var(--accent-deep); font-weight: 600; }

.progress-track {
  height: 6px;
  border-radius: 3px;
  background: var(--bg-soft);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--navy), var(--accent));
  transition: width 0.3s ease;
}

.mine-sub {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.45;
}

.material-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.material-item:last-child { border-bottom: none; }

.mi-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.mi-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mi-files span {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--text-2);
}

.file-list {
  display: grid;
  gap: 8px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.file-ico { font-size: 18px; }
.file-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
