:root {
  --bg: #f6f8ff;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --text: #182235;
  --muted: #6f7d92;
  --line: #e9eef6;
  --blue: #4a74ff;
  --blue-soft: #edf3ff;
  --green: #19b97c;
  --green-soft: #ecfdf5;
  --orange: #ff9f43;
  --orange-soft: #fff5e9;
  --purple: #8b5cf6;
  --purple-soft: #f4efff;
  --yellow: #ffd666;
  --shadow: 0 14px 30px rgba(26, 47, 86, 0.08);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: linear-gradient(180deg, #fdfdff 0%, #f6f8ff 100%); color: var(--text); }
body { font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Segoe UI', sans-serif; }
a { color: inherit; text-decoration: none; }
.page-wrap {
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background: transparent;
  position: relative;
  isolation: isolate;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
.with-tabbar {
  padding-bottom: calc(148px + env(safe-area-inset-bottom));
}
.with-tabbar::after {
  content: "";
  display: block;
  height: calc(68px + env(safe-area-inset-bottom));
  width: 100%;
}
.with-tabbar:last-child,
.with-tabbar > *:last-child {
  margin-bottom: 0 !important;
}
.with-tabbar > .section-card:last-child,
.with-tabbar > .overview-card:last-child,
.with-tabbar > .list-card:last-child,
.with-tabbar > .review-card:last-child,
.with-tabbar > .notice-card:last-child,
.with-tabbar > .timeline-list:last-child,
.with-tabbar > .course-list:last-child,
.with-tabbar > .review-list:last-child,
.with-tabbar > .simple-list:last-child {
  margin-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
}
.mobile-top { padding: 22px 18px 16px; }
.mobile-top.home-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.playful-header { background: radial-gradient(circle at right top, rgba(255,214,102,.45), transparent 24%), radial-gradient(circle at left 20%, rgba(139,92,246,.12), transparent 26%), linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%); }
.brand-mini, .page-kicker, .eyebrow, .pill, .hero-badge { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.brand-mini, .page-kicker, .eyebrow { background: var(--blue-soft); color: var(--blue); }
.mobile-top h1 { margin: 10px 0 8px; font-size: 30px; line-height: 1.15; }
.mobile-top p { margin: 0; color: var(--muted); line-height: 1.7; font-size: 14px; }
.header-mascot { display:flex; flex-direction:column; align-items:center; gap:6px; }
.mascot-face { width:58px; height:58px; border-radius:20px; background:linear-gradient(135deg,#fff,#f3f8ff); box-shadow: var(--shadow); display:grid; place-items:center; font-size:28px; }
.header-mascot span { font-size:12px; color:var(--muted); }
.app-content { padding: 0 16px 20px; }
.hero-banner, .section-card, .overview-card, .detail-cover, .list-card, .timeline-card, .notice-card, .review-card, .auth-card, .score-card { background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow); border: 1px solid rgba(233,238,246,.85); }
.hero-banner { padding: 20px; color: #fff; background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.18), transparent 20%), linear-gradient(145deg, #6a86ff 0%, #8b5cf6 55%, #7cd8ff 100%); }
.hero-badge { background: rgba(255,255,255,.18); }
.hero-banner h2 { margin: 12px 0 10px; font-size: 26px; line-height: 1.25; }
.hero-banner p { color: rgba(255,255,255,.9); }
.hero-chip-row, .route-row, .detail-subtags, .feature-bubbles { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.fun-chip, .route-pill, .detail-subtags span, .feature-bubbles span { display:inline-flex; align-items:center; padding:8px 12px; border-radius:999px; font-size:12px; font-weight:700; }
.fun-chip { background:#eef3ff; color:var(--blue); }
.fun-chip.yellow { background:#fff5db; color:#d38a00; }
.fun-chip.green { background:#e9fbf3; color:var(--green); }
.route-pill { background: rgba(255,255,255,.18); color:#fff; border:1px solid rgba(255,255,255,.15); }
.section-card, .overview-card, .detail-cover, .list-card, .timeline-card, .notice-card, .review-card, .auth-card, .score-card { margin-top: 14px; padding: 16px; }
.section-title-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.section-title-row h3 { margin: 8px 0 0; font-size: 20px; }
.course-list, .menu-list, .review-list, .timeline-list, .simple-list { display: grid; gap: 12px; }
.course-card { border-radius: 22px; padding: 16px; display:block; border: 1px solid var(--line); position:relative; overflow:hidden; }
.course-card::after { content:""; position:absolute; right:-18px; top:-18px; width:84px; height:84px; border-radius:50%; background: rgba(255,255,255,.35); }
.orange-card { background: linear-gradient(180deg, #fff7ee 0%, #ffffff 100%); }
.green-card { background: linear-gradient(180deg, #eefcf6 0%, #ffffff 100%); }
.purple-card { background: linear-gradient(180deg, #f5f0ff 0%, #ffffff 100%); }
.blue-card { background: linear-gradient(180deg, #eef5ff 0%, #ffffff 100%); }
.course-card__top { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.course-tag { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.orange-tag { background: var(--orange-soft); color: var(--orange); }
.green-tag { background: var(--green-soft); color: var(--green); }
.purple-tag { background: var(--purple-soft); color: var(--purple); }
.blue-tag { background: var(--blue-soft); color: var(--blue); }
.course-emoji { width:42px; height:42px; border-radius:14px; background:#fff; display:grid; place-items:center; font-size:22px; box-shadow:0 8px 20px rgba(44,63,112,.08); position:relative; z-index:1; }
.course-card h4 { margin: 12px 0 8px; font-size: 18px; }
.course-card p { margin: 0; color: var(--muted); line-height: 1.7; font-size: 14px; }
.course-card__meta { margin-top: 14px; display: flex; justify-content: space-between; color: #334155; font-weight: 700; }
.detail-cover { color:#fff; background: linear-gradient(145deg, #8b5cf6 0%, #6e86ff 60%, #92d7ff 100%); position:relative; overflow:hidden; }
.detail-cover::after { content:""; position:absolute; right:-22px; top:-18px; width:110px; height:110px; border-radius:50%; background: rgba(255,255,255,.16); }
.detail-row { display:flex; justify-content:space-between; align-items:center; }
.detail-badge { display:inline-flex; padding:6px 10px; border-radius:999px; background: rgba(255,255,255,.18); color:#fff; font-size:12px; font-weight:700; }
.detail-emoji { width:48px; height:48px; border-radius:16px; background: rgba(255,255,255,.18); display:grid; place-items:center; font-size:24px; }
.detail-price { margin-top: 14px; font-size: 30px; font-weight: 800; }
.detail-price small { font-size: 14px; font-weight: 500; opacity:.9; }
.detail-content p { color: var(--muted); line-height: 1.85; margin: 0 0 14px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn { min-height: 44px; padding: 0 16px; border-radius: 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 0; }
.btn-light { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn-primary { background: linear-gradient(135deg, #6a86ff 0%, #8b5cf6 100%); color: #fff; }
.btn-fun { background: linear-gradient(135deg, #ffd666 0%, #ff9f43 100%); color: #6b4100; }
.overview-card { background: linear-gradient(180deg, #fff 0%, #fbfcff 100%); }
.profile-row { display:flex; align-items:center; gap:14px; margin-bottom:16px; }
.avatar { width:56px; height:56px; border-radius:18px; display:grid; place-items:center; background: linear-gradient(135deg, var(--blue), #7ba1ff); color:#fff; font-size:24px; font-weight:800; }
.profile-row h2 { margin:0 0 4px; font-size:22px; }
.profile-row p { margin:0; color:var(--muted); }
.stats-grid, .info-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap:10px; }
.stat-box, .info-box { background: var(--surface-soft); border:1px solid var(--line); border-radius:16px; padding:12px; }
.stat-box strong, .info-box strong { display:block; font-size:22px; margin-bottom:6px; }
.stat-box span, .info-box span { color: var(--muted); font-size:12px; }
.menu-item { display:grid; grid-template-columns: 28px 1fr auto; gap:12px; align-items:center; padding:14px 0; border-bottom:1px solid var(--line); }
.menu-item:last-child { border-bottom:0; padding-bottom:0; }
.menu-item strong { display:block; margin-bottom:4px; }
.menu-item small, .hint, .simple-row small { color:var(--muted); }
.menu-item b { color:#94a3b8; font-size:20px; }
.list-card { position:relative; overflow:hidden; }
.list-card::before { content:""; position:absolute; right:-30px; top:-30px; width:110px; height:110px; border-radius:50%; opacity:.16; }
.scratch-theme::before { background: var(--purple); }
.python-theme::before { background: var(--green); }
.list-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:12px; position:relative; z-index:1; }
.list-head h3 { margin:10px 0 0; font-size:20px; }
.list-head strong { font-size:22px; }
.info-grid { grid-template-columns: repeat(2, 1fr); position:relative; z-index:1; }
.timeline-item { display:grid; grid-template-columns: 18px 1fr; gap:10px; align-items:start; }
.timeline-dot { width:10px; height:10px; border-radius:50%; background: var(--blue); margin:18px 0 0 4px; box-shadow: 0 0 0 6px var(--blue-soft); }
.timeline-card h3 { margin:0 0 8px; font-size:18px; }
.timeline-head { display:flex; justify-content:space-between; gap:12px; align-items:center; margin-bottom:8px; }
.timeline-head strong { font-size:15px; }
.timeline-head span { color: var(--blue); font-weight:700; font-size:13px; }
.timeline-card p { margin:6px 0 0; color:var(--muted); line-height:1.6; }
.score-card { text-align:center; background: linear-gradient(145deg, #fff7e8, #ffffff); }
.score-card strong { display:block; font-size:42px; color:var(--orange); }
.review-card p { margin:0 0 12px; line-height:1.75; }
.review-body {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  line-height: 1.8;
}
.review-body > *:first-child { margin-top: 0 !important; }
.review-body > *:last-child { margin-bottom: 0 !important; }
.review-body img {
  display: block;
  max-width: 100% !important;
  width: auto;
  height: auto !important;
  margin: 8px auto;
  border-radius: 14px;
}
.review-body table {
  display: block;
  width: 100% !important;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}
.review-body iframe,
.review-body video,
.review-body canvas,
.review-body embed,
.review-body object {
  max-width: 100% !important;
}
.review-body * {
  max-width: 100%;
  word-break: break-word;
  box-sizing: border-box;
}
.review-body pre,
.review-body code {
  white-space: pre-wrap;
  word-break: break-word;
}
.review-meta { display:flex; justify-content:space-between; color:var(--muted); font-size:13px; }
.simple-row, .notice-row { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:12px 0; border-bottom:1px solid var(--line); }
.simple-row:last-child, .notice-row:last-child { border-bottom:0; padding-bottom:0; }
.simple-row strong { display:block; margin-bottom:4px; }
.plus { color: var(--green); font-style: normal; font-weight: 800; }
.minus { color: #ef4444; font-style: normal; font-weight: 800; }
.switch { width:46px; height:28px; border-radius:999px; position:relative; display:inline-block; }
.switch::after { content:""; width:22px; height:22px; border-radius:50%; position:absolute; top:3px; background:#fff; box-shadow:0 2px 8px rgba(15,23,42,.18); }
.switch.on { background: var(--blue); }
.switch.on::after { left:21px; }
.switch.off { background:#dbe3ef; }
.switch.off::after { left:3px; }
.auth-card { background: linear-gradient(180deg, #ffffff 0%, #fffefd 100%); }
.auth-profile { margin-top:14px; background: linear-gradient(180deg, #fff7fb 0%, #ffffff 100%); border:1px solid rgba(255,205,229,.7); border-radius:22px; box-shadow:var(--shadow); padding:16px; display:flex; align-items:center; gap:14px; }
.auth-avatar { width:54px; height:54px; border-radius:18px; display:grid; place-items:center; background: linear-gradient(135deg, #ff9ecf, #ffbf66); color:#fff; font-size:22px; font-weight:800; }
.auth-profile strong { display:block; font-size:18px; margin-bottom:4px; }
.auth-profile p { margin:0; color:var(--muted); line-height:1.7; }
.auth-form { display:grid; gap:12px; }
.field-label { font-size:13px; color:var(--muted); font-weight:700; }
.input-wrap { background:#fff; border:1px solid #dde6f6; border-radius:18px; padding:0 14px; box-shadow: inset 0 1px 0 rgba(255,255,255,.65); }
.text-input { width:100%; height:52px; border:0; outline:0; background:transparent; font-size:15px; color:var(--text); }
.text-input::placeholder { color:#a0aec0; }
.code-row { display:grid; grid-template-columns: 1fr auto; gap:10px; align-items:center; }
.result-list { display:grid; gap:10px; }
.result-list.two-cols { grid-template-columns: repeat(2, 1fr); }
.result-row { display:flex; justify-content:space-between; gap:10px; align-items:center; padding:12px 14px; border-radius:16px; background:var(--surface-soft); border:1px solid var(--line); }
.result-row span { color:var(--muted); font-size:13px; }
.result-row strong { font-size:15px; }
.footer-text { text-align:center; color:var(--muted); font-size:13px; line-height:1.7; padding:14px 10px 26px; }
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(480px, 100%);
  background: rgba(255,255,255,.98);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(233,238,246,.9);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 10px 8px calc(16px + env(safe-area-inset-bottom));
  min-height: 88px;
  z-index: 9999;
  box-shadow: 0 -10px 28px rgba(26,47,86,.12);
}
.tabbar-item { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; min-height:52px; color:#64748b; border-radius:14px; }
.tabbar-item span { font-size:18px; }
.tabbar-item em { font-style:normal; font-size:12px; }
.tabbar-item.active { color:var(--blue); background:var(--blue-soft); font-weight:700; }
@media (max-width: 380px) {
  .mobile-top h1 { font-size:24px; }
  .stats-grid, .info-grid, .result-list.two-cols, .code-row { grid-template-columns:1fr; }
  .page-wrap { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  .with-tabbar { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
  .with-tabbar::after { height: calc(78px + env(safe-area-inset-bottom)); }
}
