:root {
  --bg: #f3f6f8;
  --card: #ffffff;
  --text: #14212b;
  --muted: #7b8794;
  --line: #e8eef2;
  --primary: #0f766e;
  --primary-2: #14b8a6;
  --accent: #f97316;
  --price: #e11d48;
  --radius: 16px;
  --shadow: 0 10px 28px rgba(20, 33, 43, 0.07);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(1200px 400px at 50% -80px, rgba(20,184,166,.18), transparent 60%),
    linear-gradient(180deg, #e8f4f2 0%, #f3f6f8 28%, #eef2f5 100%);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; }

.page {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: transparent;
  padding-bottom: calc(72px + var(--safe-bottom));
  position: relative;
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(145deg, #0f766e 0%, #0d9488 48%, #14b8a6 100%);
  color: #fff;
  padding: 14px 16px 16px;
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.22);
}
.topbar.simple {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}
.topbar .brand {
  font-family: "Avenir Next", "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 4px;
  line-height: 1.15;
}
.topbar .slogan {
  margin: 0 0 12px;
  font-size: 12px;
  opacity: .86;
}
.topbar h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  flex: 1;
}
.back-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.16);
  color: #fff;
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
}

.search {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.96);
  border-radius: 999px;
  padding: 0 4px 0 14px;
  height: 40px;
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.12);
}
.search input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text);
}
.search input::placeholder { color: #9aa6b2; }
.search button {
  border: 0;
  height: 32px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.banner {
  margin: 14px 16px 0;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: rise .45s ease both;
}
.banner-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.banner-track::-webkit-scrollbar { display: none; }
.banner-item {
  min-width: 100%;
  scroll-snap-align: start;
  height: 168px;
  position: relative;
}
.banner-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(10,20,28,.55));
}
.banner-item img {
  width: 100%;
  height: 168px;
  object-fit: cover;
  background: #d7e4e8;
}
.banner-item span {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 1;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.banner-dots {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 2;
  display: flex;
  gap: 5px;
}
.banner-dots i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.45);
  transition: .25s;
}
.banner-dots i.on {
  width: 16px;
  background: #fff;
}

.section {
  margin: 16px 16px 0;
  animation: rise .5s ease both;
}
.section:nth-of-type(2) { animation-delay: .04s; }
.section:nth-of-type(3) { animation-delay: .08s; }
.section:nth-of-type(4) { animation-delay: .12s; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.section-head a {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.entry-item {
  background: var(--card);
  border-radius: 16px;
  padding: 16px 8px 14px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.entry-item:active {
  transform: scale(.97);
}
.entry-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 8px;
}
.entry-icon svg { width: 22px; height: 22px; display: block; }
.entry-icon.works { background: linear-gradient(145deg, #0f766e, #14b8a6); }
.entry-icon.review { background: linear-gradient(145deg, #ea580c, #f97316); }
.entry-icon.group { background: linear-gradient(145deg, #0369a1, #0ea5e9); }
.entry-item p {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
}

.course-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.course-card {
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s ease;
}
.course-card:active { transform: scale(.985); }
.course-card .cover-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #d7e4e8;
  overflow: hidden;
}
.course-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.course-card .tag {
  position: absolute;
  left: 8px;
  top: 8px;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(15,118,110,.92);
  color: #fff;
}
.course-card .meta { padding: 10px 10px 12px; }
.course-card h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  height: 36px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.course-card .row,
.course-row .row,
.detail-box .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  gap: 8px;
}
.price { color: var(--price); font-weight: 700; }
.free { color: #059669; font-weight: 700; }
.muted { color: var(--muted); }

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(58px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  box-shadow: 0 -8px 24px rgba(20,33,43,.08);
  border-top: 1px solid rgba(232,238,242,.9);
}
.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #93a0ad;
  gap: 3px;
  transition: color .2s;
}
.tabbar a svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}
.tabbar a.active {
  color: var(--primary);
  font-weight: 600;
}
.tabbar a.active svg { fill: rgba(15,118,110,.12); }

.course-list { display: flex; flex-direction: column; gap: 12px; }
.course-row {
  display: flex;
  gap: 12px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  padding: 10px;
}
.course-row img {
  width: 112px;
  height: 80px;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 12px;
  background: #d7e4e8;
}
.course-row .meta { padding: 2px 2px 2px 0; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.course-row h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  max-height: 40px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.course-row .row { margin-top: auto; }

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 18px 0 8px;
}
.pager a, .pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  box-shadow: var(--shadow);
}
.pager .off { color: #c0c4cc; box-shadow: none; background: #eef2f5; }
.pager .cur {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.cover {
  width: 100%;
  height: 230px;
  object-fit: cover;
  background: #d7e4e8;
}
.player-box {
  width: 100%;
  height: 230px;
  background: #0b1220;
  overflow: hidden;
}
.player-box video,
.player-box iframe,
.player-box .cover {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: cover;
  background: #0b1220;
}
.ep-item.playable { cursor: pointer; }
.ep-item.playable.active {
  background: #ecfdf8;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: 10px;
}
.ep-item.locked { opacity: .72; }
.ep-flag {
  flex-shrink: 0;
  font-size: 12px;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 600;
}
.detail-box {
  margin: -22px 14px 0;
  position: relative;
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.detail-box h1 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
}
.badges { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e6f7f5;
  color: var(--primary);
  font-weight: 500;
}
.badge.hot { background: #fff1f2; color: #e11d48; }
.badge.vip { background: #fff7ed; color: #ea580c; }
.content-card, .ep-card {
  margin: 12px 14px 0;
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.content-card h2, .ep-card h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
}
.content-html {
  font-size: 14px;
  line-height: 1.75;
  color: #44515c;
  word-break: break-word;
}
.content-html img { border-radius: 10px; margin: 8px 0; }
.content-html p { margin: 0 0 10px; }
.ep-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.ep-item:last-child { border-bottom: 0; }
.ep-item > span:first-child {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}
.ep-item .ep-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ep-no {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #e6f7f5;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  margin-right: 10px;
  flex-shrink: 0;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
  font-size: 14px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.empty::before {
  content: "∅";
  display: block;
  font-size: 28px;
  margin-bottom: 8px;
  opacity: .35;
}
.login-hint {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px;
  font-size: 14px;
  line-height: 1.7;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.login-qr {
  display: block;
  width: 196px;
  height: 196px;
  margin: 16px auto;
  border-radius: 12px;
  background: #fff;
}

.mine-hero {
  margin: 16px;
  border-radius: 20px;
  padding: 22px 16px;
  text-align: center;
  color: #fff;
  background: linear-gradient(145deg, #0f766e 0%, #14b8a6 100%);
  box-shadow: 0 12px 28px rgba(15,118,110,.25);
}
.mine-hero img {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  margin: 0 auto 10px;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,.55);
  background: #fff;
}
.mine-hero h2 { margin: 0 0 6px; font-size: 18px; }
.mine-hero p { margin: 0; font-size: 12px; opacity: .88; }

.mine-menu {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.mine-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 500;
}
.mine-menu a:last-child { border-bottom: 0; }
.mine-menu a::after {
  content: "›";
  color: #b4bec7;
  font-size: 18px;
  line-height: 1;
}

.buy-bar {
  position: fixed;
  left: 50%;
  bottom: calc(58px + var(--safe-bottom));
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  box-shadow: 0 -8px 24px rgba(20,33,43,.08);
  border-top: 1px solid var(--line);
}
.buy-bar .btn {
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 11px 26px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(15,118,110,.28);
}
.page.has-buy { padding-bottom: calc(130px + var(--safe-bottom)); }

.works-grid { display: flex; flex-direction: column; gap: 12px; }
.works-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.works-card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  background: #d7e4e8;
}
.works-player {
  width: 100%;
  height: 200px;
  background: #0b1220;
}
.works-player video,
.works-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #0b1220;
}
.works-card .meta { padding: 12px 14px 14px; }
.works-card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.works-card .desc { margin: 8px 0 0; font-size: 13px; color: #556371; line-height: 1.55; }

.review-list { display: flex; flex-direction: column; gap: 12px; }
.review-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.review-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.review-head .avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(145deg, #ccfbf1, #99f6e4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  overflow: hidden;
}
.review-head .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.review-head .name { font-size: 14px; font-weight: 700; }
.review-head .stars { font-size: 12px; color: #f59e0b; margin-top: 3px; letter-spacing: 1px; }
.review-content { margin: 0; font-size: 14px; line-height: 1.65; color: #44515c; }

.group-list { display: flex; flex-direction: column; gap: 10px; }
.group-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 16px;
  padding: 12px 12px 12px 10px;
  box-shadow: var(--shadow);
  min-height: 76px;
}
.group-row .group-no {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #ecfdf8;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.group-row img,
.group-row .group-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
  background: linear-gradient(145deg, #ccfbf1, #99f6e4);
}
.group-row .group-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
}
.group-row .meta { flex: 1; min-width: 0; }
.group-row h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.group-row .group-tag {
  display: inline-block;
  max-width: 100%;
  font-size: 11px;
  line-height: 1.4;
  color: var(--primary);
  background: #ecfdf8;
  border-radius: 999px;
  padding: 3px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.group-row .group-tag.empty {
  color: var(--muted);
  background: #f3f6f8;
}
.group-row .group-go {
  flex-shrink: 0;
  font-size: 12px;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 600;
}
.content-card .group-row {
  box-shadow: none;
  background: #f3f6f8;
  padding: 10px;
}
.group-card {
  background: #fff;
  border-radius: 18px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.group-card h3 { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.group-card .qrcode {
  width: 210px;
  height: 210px;
  object-fit: contain;
  margin: 14px auto;
  background: #f3f6f8;
  border-radius: 14px;
  padding: 10px;
}
.group-card .tip { font-size: 12px; }
.group-course {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f3f6f8;
  border-radius: 12px;
  padding: 8px 10px;
  margin: 0 auto 12px;
  max-width: 100%;
  text-align: left;
}
.group-course img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.group-course span {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.group-card-mini {
  box-shadow: none;
  background: #f3f6f8;
  padding: 14px;
}
.group-card-mini .qrcode {
  width: 180px;
  height: 180px;
}
.join-btn {
  display: inline-block;
  margin-top: 10px;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff !important;
  padding: 11px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 481px) {
  body { background: #dce7ec; }
  .page {
    box-shadow: 0 0 0 1px rgba(20,33,43,.04), 0 20px 60px rgba(20,33,43,.12);
    background: linear-gradient(180deg, #e8f4f2 0%, #f3f6f8 28%, #eef2f5 100%);
  }
}
