:root {
  color-scheme: light;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --danger: #b42318;
  --paper: #ffffff;
  --ink: #111827;
  --muted: #64748b;
  --line: #e6e9ef;
  --surface-tint: #f5f8ff;
  --surface-float: rgba(255, 255, 255, .94);
  --shadow: 0 12px 40px rgba(17, 24, 39, .08);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #eef2f7; }
body {
  margin: 0;
  color: var(--ink);
  background: #eef2f7;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
button, input { font: inherit; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 3px solid rgba(37, 99, 235, .35); outline-offset: 3px; }
[hidden] { display: none !important; }

.mobile-shell {
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 20px max(28px, env(safe-area-inset-bottom));
  background: var(--paper);
}
.container { width: 100%; margin-inline: auto; }
.site-header { height: 64px; border-bottom: 1px solid var(--line); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-size: 16px; font-weight: 750; letter-spacing: -.03em; }
.nav { color: var(--muted); font-size: 12px; white-space: nowrap; }
.back-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--muted); font-size: 14px; }
.back-link svg { flex: 0 0 auto; }
.muted { color: var(--muted); }

.hero { padding: 32px 0 28px; }
.eyebrow { display: inline-flex; color: var(--brand); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 700; line-height: 1.4; letter-spacing: .1em; }
.hero h1 { margin: 14px 0 10px; font-size: clamp(30px, 8vw, 36px); font-weight: 800; line-height: 1.28; letter-spacing: -.055em; }
.hero > p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.hero-art { position: relative; overflow: hidden; margin-top: 22px; aspect-ratio: 16 / 9; border-radius: 16px; background: #dbeafe; }
.hero-art img, .cover img, .detail-cover img { width: 100%; height: 100%; display: block; object-fit: cover; }
.hero-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(17, 24, 39, .68), transparent 62%); }
.hero-art-tag { position: absolute; z-index: 1; left: 16px; bottom: 14px; display: inline-flex; align-items: center; gap: 8px; color: #fff; font-size: 13px; font-weight: 600; }
.hero-art-tag svg { color: #93c5fd; }

.course-section { padding-top: 4px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head h2 { margin: 0; font-size: 22px; letter-spacing: -.04em; }
.section-head .muted { font-size: 13px; }
.course-list { display: flex; flex-direction: column; gap: 14px; }
.grid { display: flex; flex-direction: column; gap: 14px; }
.course-card, .card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.course-card:hover, .card:hover { border-color: #bfdbfe; transform: translateY(-2px); box-shadow: 0 12px 28px rgba(37, 99, 235, .12); }
.cover { position: relative; width: 100%; aspect-ratio: 3 / 2; align-self: center; overflow: hidden; border-radius: 10px; background: #dbeafe; }
.cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(17, 24, 39, .5), transparent 65%); }
.cover img { position: absolute; inset: 0; }
.cover-label { position: absolute; z-index: 1; left: 9px; bottom: 7px; color: #fff; font-size: 12px; font-weight: 600; }
.card-body { min-width: 0; min-height: 126px; display: flex; flex-direction: column; align-items: flex-start; }
.course-meta { display: flex; flex-wrap: wrap; gap: 5px; margin: 1px 0 7px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.card-body h3, .card-body h2 { margin: 0; font-size: 16px; line-height: 1.45; letter-spacing: -.03em; }
.card-body > .muted { display: -webkit-box; overflow: hidden; margin: 5px 0 9px; font-size: 13px; line-height: 1.5; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-bottom { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-top: auto; }
.price { color: var(--brand); font-family: ui-monospace, SFMono-Regular, Menlo, sans-serif; font-size: 17px; font-weight: 800; line-height: 1.35; white-space: nowrap; }
.card-cta { display: inline-flex; align-items: center; gap: 3px; color: var(--brand); font-size: 13px; font-weight: 600; white-space: nowrap; }
.trust-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-tint); }
.trust-mark { flex: 0 0 auto; display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--brand); border-radius: 50%; color: var(--brand); font-family: Georgia, serif; font-size: 14px; font-weight: 700; line-height: 1; }
.trust-note p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.site-footer, footer { margin-top: 24px; padding: 20px 0 8px; border-top: 1px solid var(--line); }
.site-footer p, footer p { margin: 0 0 10px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.support-note { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; color: var(--muted); font-size: 13px; }
.support-note svg { color: var(--brand); }

.detail-main { padding-bottom: 112px; }
.detail-cover { position: relative; overflow: hidden; aspect-ratio: 16 / 9; margin: 16px 0 24px; border-radius: 16px; background: #dbeafe; }
.detail-tag { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; color: var(--brand); background: var(--surface-tint); font-size: 12px; font-weight: 700; }
.detail-title { margin: 12px 0 8px; font-size: 29px; line-height: 1.34; letter-spacing: -.055em; }
.detail-summary { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.75; }
.detail-price-line { display: flex; align-items: baseline; gap: 9px; margin: 18px 0 22px; }
.detail-price-line .price { font-size: 27px; }
.detail-price-line span:last-child { color: var(--muted); font-size: 13px; }
.detail-content { padding: 19px 0; border-top: 1px solid var(--line); }
.detail-content h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 18px; letter-spacing: -.03em; }
.detail-content h2 svg { flex: 0 0 auto; color: var(--brand); }
.detail-content p, .detail-content li { color: var(--muted); font-size: 14px; line-height: 1.75; }
.detail-content p { margin: 0; }
.detail-content ul { margin: 8px 0 0; padding-left: 20px; }
.detail-content li { padding-left: 3px; }
.rule-card { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-tint); }
.buybar { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; padding: 12px max(20px, calc((100vw - 440px) / 2)) max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface-float); backdrop-filter: blur(14px); }
.buybar-inner { width: min(100%, 440px); display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 auto; }
.buybar-label { display: block; margin-bottom: 3px; color: var(--muted); font-size: 12px; }
.buybar .price { font-size: 22px; }

.btn { min-height: 50px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 0 22px; border: 0; border-radius: 11px; color: #fff; background: var(--brand); font-size: 15px; font-weight: 700; cursor: pointer; transition: transform .18s, box-shadow .18s, filter .18s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(.96); box-shadow: 0 7px 18px rgba(37, 99, 235, .24); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn.secondary { color: var(--brand); background: var(--surface-tint); }
.btn.full { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.status-page { min-height: calc(100dvh - 64px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 2px 64px; text-align: center; }
.status-page h1 { margin: 18px 0 8px; font-size: 26px; line-height: 1.35; letter-spacing: -.04em; }
.status-page > p, .status-copy { max-width: 360px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.status-page .spinner { margin-inline: auto; }
.status { min-height: calc(100dvh - 64px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 0 64px; text-align: center; }
.status h1 { margin: 18px 0 8px; font-size: 26px; line-height: 1.35; letter-spacing: -.04em; }
.status > p { max-width: 360px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.spinner { width: 38px; height: 38px; border: 3px solid #e2e8f0; border-top-color: var(--brand); border-radius: 50%; animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.status-icon, .success-mark { width: 64px; height: 64px; display: grid; place-items: center; margin-inline: auto; border-radius: 50%; color: #fff; background: var(--brand); font-size: 28px; box-shadow: 0 10px 26px rgba(37, 99, 235, .2); }
.status-icon { border: 1px solid var(--line); color: var(--muted); background: var(--surface-tint); box-shadow: none; }
.error { margin: 16px 0; padding: 14px; border: 1px solid #fecaca; border-radius: 11px; color: var(--danger); background: #fef3f2; font-size: 13px; line-height: 1.65; text-align: left; }
.notice { width: 100%; margin: 20px 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--surface-tint); font-size: 13px; line-height: 1.65; text-align: left; }
.status-actions { width: 100%; display: flex; flex-direction: column; gap: 11px; margin-top: 24px; }
.pay-card { width: 100%; margin-top: 24px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
.pay-card .spinner { margin: 2px auto 18px; }
.pay-order { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; word-break: break-all; }
.demo-label { display: inline-flex; margin-bottom: 14px; padding: 5px 10px; border-radius: 999px; color: var(--brand); background: #eff6ff; font-size: 12px; font-weight: 700; }
.pay-card .btn { margin-top: 12px; }
.mini-program-card { width: 100%; display: flex; align-items: center; gap: 14px; margin: 20px 0 22px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); text-align: left; }
.mini-code { flex: 0 0 70px; height: 70px; display: grid; place-items: center; border: 1px dashed #cbd5e1; border-radius: 10px; color: var(--muted); background: #f8fafc; font-size: 12px; }
.mini-program-card strong { display: block; margin-bottom: 4px; font-size: 14px; }
.mini-program-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.success-copy { margin-top: 7px !important; }
.empty { padding: 48px 16px; color: var(--muted); font-size: 14px; text-align: center; }

@media (min-width: 520px) {
  body { padding: 24px 0; }
  .mobile-shell { min-height: calc(100dvh - 48px); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); overflow: clip; }
  .buybar { bottom: 24px; }
}
@media (max-width: 370px) {
  .mobile-shell { padding-inline: 16px; }
  .course-card, .card { grid-template-columns: 118px minmax(0, 1fr); gap: 12px; padding: 10px; }
  .card-body { min-height: 132px; }
  .card-body h3, .card-body h2 { font-size: 15px; }
  .nav { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
