/* 互动课件 门户样式。只用系统字体，不引用任何外部资源。 */
:root {
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "WenQuanYi Micro Hei", sans-serif;
  --bg: #f5f7fb;
  --card: #fff;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --wx: #07c160;
  --wx-dark: #06a552;
  --xhs: #ff2442;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .06);
  --c: #2563eb;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 15px/1.7 var(--font); color: var(--text); background: var(--bg); }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.35; }
p { margin: 0; }
svg { flex: none; }
[hidden] { display: none !important; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 48px 0; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 16px; border-radius: 12px; }
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-wx { background: var(--wx); border-color: var(--wx); color: #fff; }
.btn-wx:hover { background: var(--wx-dark); border-color: var(--wx-dark); }
.btn-xhs { background: #fff; border-color: #ffd0d7; color: var(--xhs); }
.btn-xhs:hover { background: #fff4f6; }
.btn-ghost { background: transparent; }
.btn-ghost:hover, .btn:not(.btn-wx):not(.btn-primary):not(.btn-xhs):hover { background: #f1f5f9; }

/* 顶栏 */
.topnav { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.6) blur(10px); -webkit-backdrop-filter: saturate(1.6) blur(10px); border-bottom: 1px solid var(--line); }
.topnav-in { display: flex; align-items: center; height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.topnav-actions { margin-left: auto; display: flex; gap: 8px; }

/* 首屏 */
.hero { background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%); border-bottom: 1px solid var(--line); }
/* 大屏上收窄标题区，文字和联系卡片靠拢，不再左右拉得很开 */
.hero-in { max-width: 1320px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; padding-top: 22px; padding-bottom: 22px; }
.hero h1 { font-size: 30px; letter-spacing: 1px; }
.tagline { margin-top: 2px; font-size: 17px; font-weight: 600; color: var(--primary); }
.intro { margin-top: 8px; color: #475569; font-size: 14px; max-width: 560px; }
.hero-stats { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-stats span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 13px; color: #475569; }
.hero-contacts { display: flex; gap: 12px; }
.hc-card { display: flex; gap: 12px; align-items: center; width: 290px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.hc-qr { width: 96px; height: 96px; flex: none; border-radius: 8px; border: 1px solid var(--line); background: #fff; object-fit: contain; -webkit-touch-callout: default; }
.hc-info { flex: 1; min-width: 0; display: grid; gap: 6px; justify-items: start; }
.hc-title { display: flex; align-items: center; gap: 5px; font-weight: 700; font-size: 14px; }
.hc-wechat .hc-title svg { color: var(--wx); }
.hc-xiaohongshu .hc-title svg { color: var(--xhs); }
.hc-guide { font-size: 12px; color: var(--muted); line-height: 1.4; }
.hc-acc { display: flex; align-items: center; gap: 6px; max-width: 100%; }
.hc-acc .c-acc-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.hc-acc .btn, .hc-info > .btn { height: 28px; padding: 0 10px; font-size: 12.5px; }

/* 联系方式 */
.contacts { display: grid; gap: 12px; }
.contact { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfc; }
.contact .qr { width: 120px; height: 120px; border-radius: 8px; background: #fff; border: 1px solid var(--line); object-fit: contain; flex: none; -webkit-touch-callout: default; }
.c-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.c-label { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.c-guide { font-size: 13px; color: var(--muted); line-height: 1.5; }
.c-acc { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.c-acc-text { font-family: ui-monospace, Consolas, monospace; font-size: 14px; background: #fff; border: 1px dashed #cbd5e1; padding: 2px 8px; border-radius: 6px; user-select: all; word-break: break-all; }

/* 学科标签 */
.chips-bar { position: sticky; top: 60px; z-index: 15; background: rgba(245, 247, 251, .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.chips { display: flex; gap: 8px; padding: 12px 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; height: 36px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 14px; font-weight: 600; white-space: nowrap; color: #334155; }
.chip svg { color: var(--c); }
.chip-n { font-size: 12px; color: var(--muted); font-weight: 500; }
.chip.active { background: var(--c); border-color: var(--c); color: #fff; }
.chip.active svg, .chip.active .chip-n { color: rgba(255, 255, 255, .9); }
.chip:not(.active):hover { border-color: var(--c); }

/* 学科分组 */
.subject-sec { padding: 36px 0 8px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sec-head h2 { display: flex; align-items: center; gap: 10px; font-size: 22px; }
.sec-icon { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 10px; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); }
.sec-n { font-size: 13px; font-weight: 500; color: var(--muted); }
.sec-more { display: inline-flex; align-items: center; color: var(--muted); font-size: 14px; }
.sec-more:hover { color: var(--c); }

/* 课件卡片 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(15, 23, 42, .12); }
.cover { position: relative; aspect-ratio: 16 / 9; background: #e2e8f0; overflow: hidden; }
.cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-ph { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 12px; text-align: center;
  color: #fff; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #0f172a)); }
.cover-ph svg { opacity: .9; }
.cover-ph span { font-weight: 700; font-size: 17px; line-height: 1.4; text-shadow: 0 1px 2px rgba(0, 0, 0, .2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge { position: absolute; top: 10px; left: 10px; background: #f59e0b; color: #fff; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-size: 16px; }
.card-desc { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; }
.trial-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); background: #f1f5f9; padding: 2px 8px; border-radius: 6px; }
.card-go { display: inline-flex; align-items: center; font-size: 14px; font-weight: 600; color: var(--c); }

/* 整套横幅 */
.bundle { margin: 20px 0 8px; display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--radius);
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 12%, #fff), #fff); border: 1px solid color-mix(in srgb, var(--c) 25%, #fff); }
.bundle-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--c); color: #fff; flex: none; }
.bundle-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.bundle-text strong { font-size: 16px; }
.bundle-text span { font-size: 13px; color: var(--muted); }

/* 定制 */
.custom { margin-top: 40px; padding: 44px 0; background: #fff; border-top: 1px solid var(--line); }
.custom-head { display: flex; align-items: center; gap: 20px; padding: 24px; border-radius: 18px; background: linear-gradient(135deg, #fef3c7, #fff7ed); border: 1px solid #fde68a; }
.custom-head > div:nth-child(2) { flex: 1; }
.custom-head h2 { font-size: 22px; }
.custom-head p { margin-top: 6px; color: #78350f; }
.custom-icon { width: 56px; height: 56px; border-radius: 14px; background: #f59e0b; color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.cases-title { display: flex; align-items: center; gap: 8px; margin: 28px 0 14px; font-size: 18px; }
.cases-title svg { color: #f59e0b; }

/* 学科页头 */
.sub-hero { padding: 28px 0; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 12%, #fff), #fff); border-bottom: 1px solid var(--line); }
.sub-hero h1 { display: flex; align-items: center; gap: 12px; font-size: 28px; margin-top: 10px; }
.sub-hero p { margin-top: 6px; color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; }
.back-link:hover { color: var(--text); }

.footer { padding: 28px 0 40px; text-align: center; font-size: 13px; color: #475569; }
.footer p + p { margin-top: 4px; }

/* 悬浮咨询 */
.float-btn { position: fixed; right: 18px; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--wx); color: #fff; font: 600 12px var(--font); cursor: pointer; box-shadow: 0 6px 20px rgba(7, 193, 96, .4); }

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); }
.modal-card { position: relative; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto; background: #fff; border-radius: 18px; padding: 24px 20px 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); animation: pop .18s ease-out; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.modal-card h2 { font-size: 20px; }
.modal-sub { color: var(--muted); font-size: 13px; margin: 4px 0 16px; }
.modal-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f1f5f9; color: #475569; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-foot { margin-top: 14px; }
.consult { margin-top: 14px; padding: 12px; border-radius: 12px; background: #f0fdf4; border: 1px solid #bbf7d0; text-align: left; }
.consult-label { font-size: 12px; color: #15803d; }
.consult-text { margin: 4px 0 8px; font-weight: 600; word-break: break-all; }
.overlay .consult .consult-text { margin-bottom: 0; }

/* 标题区里的定制亮点条 */
.hero-custom { display: flex; align-items: center; gap: 12px; margin-top: 14px; max-width: 660px; padding: 10px 12px; border-radius: 12px;
  background: linear-gradient(90deg, #fef3c7, #fff7ed); border: 1px solid #fcd34d; }
.hcu-icon { width: 38px; height: 38px; flex: none; border-radius: 10px; background: #f59e0b; color: #fff; display: flex; align-items: center; justify-content: center; }
.hcu-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.5; }
.hcu-text strong { font-size: 15px; color: #92400e; }
.hcu-text span { font-size: 13px; color: #78350f; }
.btn-custom { flex: none; background: #f59e0b; border-color: #f59e0b; color: #fff; }
.btn-custom:hover { background: #d97706; border-color: #d97706; }
.cases-sub { margin-left: 4px; font-size: 13px; font-weight: 400; color: var(--muted); }
.custom > .wrap > .cases-title:first-child { margin-top: 0; }

/* 二维码放大 */
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; }
.qr-box .qr { cursor: zoom-in; }
.qr-zoom { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px; border: 0; border-radius: 999px; background: #f1f5f9; color: #475569; font: 12px var(--font); cursor: pointer; white-space: nowrap; }
.qr-zoom:hover { background: #e2e8f0; color: var(--text); }
.lightbox { position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center; padding: 16px; }
.lb-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .7); }
.lb-card { position: relative; width: 100%; max-width: 360px; background: #fff; border-radius: 18px; padding: 22px 20px 18px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); animation: pop .18s ease-out; }
.lb-card h2 { font-size: 18px; margin-bottom: 12px; }
.lb-card img { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto; border-radius: 10px; border: 1px solid var(--line); -webkit-touch-callout: default; }
.lb-tip { margin-top: 12px; font-size: 13px; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 80px; transform: translate(-50%, 20px); z-index: 200; background: rgba(15, 23, 42, .9); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 播放页 */
body.player { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: #0f172a; }
.pbar { flex: none; display: flex; align-items: center; gap: 8px; height: 54px; padding: 0 12px; background: #fff; border-bottom: 1px solid var(--line); padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
.ptitle { flex: 1; min-width: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbtn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--text); font: 600 14px var(--font); cursor: pointer; white-space: nowrap; }
.pbtn:hover { background: #f1f5f9; }
.pbtn-wx { background: var(--wx); border-color: var(--wx); color: #fff; }
.pbtn-wx:hover { background: var(--wx-dark); }
.pbtn-xhs { color: var(--xhs); border-color: #ffd0d7; }
.timer { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border-radius: 8px; background: #eff6ff; color: var(--primary); font-size: 13px; white-space: nowrap; }
.timer b { font-variant-numeric: tabular-nums; font-size: 15px; }
.timer.warn { background: #fef2f2; color: #dc2626; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .65; } }
.stage { position: relative; flex: 1; min-height: 0; background: #fff; }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.stage-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); background: var(--bg); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #cbd5e1; border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fs-exit { display: none; position: absolute; top: 10px; right: 10px; z-index: 5; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(15, 23, 42, .55); color: #fff; cursor: pointer; align-items: center; justify-content: center; }
.stage:fullscreen .fs-exit, .stage:-webkit-full-screen .fs-exit, body.fs-fallback .fs-exit { display: flex; }
body.fs-fallback .pbar { display: none; }
.stage:fullscreen { background: #fff; }

.overlay { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; background: rgba(15, 23, 42, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ov-card { width: 100%; max-width: 480px; margin: auto; background: #fff; border-radius: 20px; padding: 26px 22px 22px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); animation: pop .2s ease-out; }
.ov-icon { width: 60px; height: 60px; margin: 0 auto 10px; border-radius: 50%; background: #fef3c7; color: #d97706; display: flex; align-items: center; justify-content: center; }
.ov-card h2 { font-size: 22px; }
.ov-text { margin: 8px 0 14px; color: #475569; }
.ov-contacts { text-align: left; }
.ov-actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.ov-actions .btn { flex: 1 1 140px; }

.nf { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.nf h1 { font-size: 26px; }
.nf p { color: var(--muted); margin: 8px 0 20px; }

/* 手机 */
@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; gap: 16px; padding-top: 18px; padding-bottom: 18px; }
  .hero-contacts { flex-wrap: wrap; }
  .hc-card { flex: 1 1 280px; width: auto; }
  .hero h1 { font-size: 28px; }
  .tagline { font-size: 17px; }
  .intro { font-size: 15px; }
  .custom-head { flex-direction: column; align-items: flex-start; }
  .custom-head .btn { width: 100%; }
}
@media (max-width: 640px) {
  .hero-custom { flex-wrap: wrap; }
  .hero-custom .btn-custom { width: 100%; }
  .cases-sub { display: block; margin: 2px 0 0; }
  .wrap { padding: 0 14px; }
  .topnav-in { height: 54px; }
  .chips-bar { top: 54px; }
  .brand { font-size: 16px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-body { padding: 10px 12px 12px; }
  .card-title { font-size: 14px; }
  .card-desc { display: none; }
  .card-go { display: none; }
  .cover-ph span { font-size: 14px; }
  .cover-ph svg { width: 32px; height: 32px; }
  .sec-head h2 { font-size: 19px; }
  .bundle { flex-wrap: wrap; padding: 14px; }
  .bundle .btn { width: 100%; }
  .contact .qr { width: 104px; height: 104px; }
  .hide-sm { display: none; }
  .pbar { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .pbtn { padding: 0 9px; }
  .ptitle { font-size: 14px; }
}
@media (max-width: 420px) {
  .hide-xs { display: none; }
  .topnav .btn-wx span { display: inline; }
}
@media (hover: none) { .card:hover { transform: none; } }
