/* Parent learning, not a children's game skin. Scoped to the practice component. */
.course-noscript { margin:16px; padding:14px 18px; border:1px solid #d7e0e8; border-radius:10px; background:#fff; color:#334155; font-family:-apple-system,BlinkMacSystemFont,"PingFang TC","Microsoft JhengHei",system-ui,sans-serif; }
.course-sidebar-shade { position:absolute; inset:0; background:#203a3866; z-index:19; border:0; }
body.parent-mode .stage { min-width:0; }
body.parent-mode header { gap:12px; }
body.parent-mode .module-bar { width:100%; border:0; text-align:left; min-height:48px; }
body.parent-mode .lesson-open { display:block; border:0; background:none; text-align:left; cursor:pointer; padding:8px 0; font:inherit; min-height:48px; }
body.parent-mode .check-circle { width:44px; height:44px; border-radius:14px; }
body.parent-mode .check-circle svg { width:17px; height:17px; }
body.parent-mode .lesson-btn { padding:5px 12px 5px 15px; gap:9px; }
body.parent-mode .btn, body.parent-mode .select-pill, body.parent-mode .label-toggle { min-height:44px; }
body.parent-mode .btn:disabled { opacity:.4; cursor:default; }
body.parent-mode .lesson-headline { gap:13px; flex-wrap:wrap; }
body.parent-mode .action-group-right { flex-wrap:wrap; }
body.parent-mode .search-input { min-height:44px; }
.parent-practice { --p-ink:#24374c; --p-muted:#52667a; --p-brand:#24599d; --p-border:#dce4ec; --p-soft:#f1f5f9; color:var(--p-ink); font-family:-apple-system,BlinkMacSystemFont,"PingFang TC","Microsoft JhengHei",system-ui,sans-serif; font-size:16px; line-height:1.75; border:1px solid var(--p-border); border-radius:20px; background:#fff; container-type:inline-size; overflow-wrap:anywhere; }
.parent-practice *, .parent-practice *::before, .parent-practice *::after { box-sizing:border-box; }
.parent-practice [hidden] { display:none !important; }
.parent-practice button, .parent-practice select, .parent-practice textarea, .parent-practice input { font:inherit; }
.parent-practice button, .parent-practice select, .parent-practice summary, .parent-practice a { touch-action:manipulation; }
.parent-practice button { cursor:pointer; color:inherit; -webkit-tap-highlight-color:transparent; }
.parent-practice button:disabled { cursor:default; opacity:.5; }
.parent-practice button:focus-visible, .parent-practice input:focus-visible, .parent-practice textarea:focus-visible, .parent-practice select:focus-visible, .parent-practice summary:focus-visible, .parent-practice a:focus-visible { outline:3px solid #2866b5; outline-offset:3px; }
.parent-practice h2, .parent-practice h3, .parent-practice p { margin:0; }
.parent-practice h3 { font-size:21px; line-height:1.6; margin:9px 0 17px; font-weight:720; }
.parent-practice p + p { margin-top:10px; }
.parent-practice a { color:var(--p-brand); }
.p-toggle { display:flex; align-items:center; text-align:left; gap:20px; width:100%; border:0; background:linear-gradient(110deg,#f1f6fc,#f8fbfd); border-radius:20px; padding:24px; }
.p-toggle[aria-expanded="true"] { border-radius:20px 20px 0 0; border-bottom:1px solid var(--p-border); }
.p-cover-symbol { width:64px; height:70px; flex-shrink:0; display:grid; place-items:center; border-radius:14px; background:#e1ebf8; color:#275b9c; font-weight:750; font-size:25px; border:1px solid #cbdcf1; box-shadow:3px 4px 0 #d9e4f2; }
.p-cover-copy { display:flex; flex-direction:column; flex:1; min-width:0; gap:4px; }
.p-kicker { display:block; font-size:12px; font-weight:700; letter-spacing:.065em; color:#466c91; }
.p-cover-title { font-size:22px; font-weight:750; line-height:1.5; }
.p-cover-goal { color:var(--p-muted); font-size:14px; }
.p-cover-status { margin-top:6px; color:#276252; font-size:12px; font-weight:650; }
.p-open-label { flex-shrink:0; color:var(--p-brand); font-size:14px; font-weight:700; white-space:nowrap; }
.p-panel { padding:22px 28px 28px; }
.p-toolbar { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:4px 12px; border-bottom:1px solid var(--p-border); margin-bottom:6px; }
.p-toolbar > span { font-size:12px; color:var(--p-muted); }
.p-toolbar > div { display:flex; flex-wrap:wrap; gap:4px; }
.p-text-button { border:0; background:transparent; min-height:48px; padding:8px 12px; color:var(--p-brand) !important; font-size:13px !important; text-decoration:underline; text-underline-offset:4px; }
.p-sound-settings { font-size:13px; color:var(--p-muted); }
.parent-practice summary { cursor:pointer; min-height:48px; padding:12px 4px; font-weight:600; }
.p-settings-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px 24px; background:#f7f9fc; border-radius:12px; padding:16px; margin-bottom:18px; }
.p-settings-grid label { min-height:48px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.p-settings-grid input[type="range"] { display:block; width:100%; height:48px; accent-color:var(--p-brand); }
.p-settings-grid select { width:100%; }
.p-settings-grid p { grid-column:1 / -1; }
.p-heading { font-size:16px; color:#4d6278; font-weight:600; margin:14px 0 !important; }
.p-heading:focus, #pExplain:focus, #pApplicationResult:focus { outline:none; }
.p-progress { list-style:none; display:flex; margin:18px 0 28px; padding:0; border:1px solid var(--p-border); border-radius:12px; overflow:hidden; background:#f7f9fb; }
.p-progress li { display:flex; justify-content:center; align-items:center; gap:7px; flex:1; min-height:52px; padding:7px; color:var(--p-muted); font-size:13px; border-bottom:3px solid transparent; }
.p-progress li + li { border-left:1px solid var(--p-border); }
.p-progress li[aria-current] { background:#edf4fd; color:#24599d; border-bottom-color:#24599d; font-weight:750; }
.p-progress li.done { background:#edf7f4; color:#266650; }
.p-progress li > span { width:24px; height:24px; display:grid; place-items:center; border:1px solid currentColor; border-radius:50%; font-size:12px; flex-shrink:0; }
.p-work { max-width:800px; margin:auto; }
.p-case { padding:21px 24px; background:#f2f5f8; border-left:3px solid #7b9fbe; border-radius:0 14px 14px 0; margin:0 0 23px; }
.p-case .p-kicker { margin-bottom:9px; }
.p-case p { font-size:18px; line-height:1.85; }
.p-options { display:flex; flex-direction:column; gap:10px; }
.p-option { display:flex; align-items:center; text-align:left; gap:15px; width:100%; border:1px solid #d5dfe9; border-radius:14px; background:#fff; padding:15px 18px; min-height:68px; transition:background .15s,border-color .15s; }
.p-option:hover { background:#f6f9fd; border-color:#91acca; }
.p-option.selected { border:2px solid #467cb7; padding:14px 17px; background:#eef5fe; }
.p-letter { width:30px; height:30px; border-radius:8px; border:1px solid #ccd9e7; display:grid; place-items:center; flex-shrink:0; font-size:13px; font-weight:750; color:var(--p-brand); }
.p-explanation { margin-top:23px; padding:20px 23px; border:1px solid #d0e4dc; border-radius:14px; background:#f0f8f4; color:#2c594d; }
.p-explanation > strong { display:block; margin-bottom:9px; font-size:16px; }
.p-explanation p, .p-explanation li { font-size:15px; }
.p-explanation ul { padding-left:22px; margin:10px 0 0; }
.p-explanation li + li { margin-top:7px; }
.p-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-top:23px; }
.p-end { justify-content:flex-end; }
.p-primary, .p-secondary, a.p-secondary { min-height:48px; display:inline-flex; align-items:center; justify-content:center; padding:11px 19px; border:1px solid #24599d; border-radius:10px; font-size:14px !important; line-height:1.65; font-weight:650; text-decoration:none; text-align:center; }
.p-primary { color:#fff !important; background:#24599d; }
.p-primary:hover:not(:disabled) { background:#19467f; }
.p-secondary, a.p-secondary { color:#2f506f !important; border-color:#c9d6e3; background:#fff; }
.p-secondary:hover { background:#f1f5fa; }
.p-muted { color:var(--p-muted); font-size:13px; line-height:1.8; margin-top:13px !important; }
.p-field { display:block; margin:18px 0; color:#314c64; font-size:15px; font-weight:650; }
.parent-practice textarea { display:block; width:100%; min-height:90px; resize:vertical; margin-top:9px; border:1px solid #b9ccdd; border-radius:10px; padding:12px 14px; color:var(--p-ink); background:#fff; line-height:1.8; font-weight:400; font-size:16px; }
.parent-practice select { min-width:0; min-height:48px; padding:10px 28px 10px 10px; border:1px solid #b9ccdd; border-radius:8px; background:#fff; color:var(--p-ink); font-size:16px; }
.p-example, .p-plan-example { margin:20px 0; padding:15px 20px; border:1px solid #e3dbc4; border-radius:13px; background:#faf7ef; }
.p-example p { margin-top:8px; }
.p-plan-example { padding-top:3px; }
.p-plan-example .p-secondary { margin-top:12px; }
.p-checks { margin:18px 0; padding:0; border:0; min-width:0; }
.p-checks legend { font-size:13px; color:var(--p-muted); margin-bottom:10px; }
.p-checks label { display:flex; align-items:flex-start; gap:13px; padding:14px; min-height:52px; border:1px solid var(--p-border); border-radius:10px; margin:9px 0; cursor:pointer; }
.p-checks label:has(input:checked) { border-color:#7aa5c9; background:#f0f6fc; }
.parent-practice input[type="checkbox"] { width:21px; height:21px; min-width:21px; margin:4px 0 0; accent-color:var(--p-brand); cursor:pointer; }
.p-order { padding:0; margin:20px 0; list-style:none; }
.p-order li { display:flex; align-items:center; gap:13px; border:1px solid var(--p-border); background:#f8fafc; border-radius:12px; padding:12px; margin-bottom:10px; }
.p-order-number { color:#5c7790; min-width:20px; font-weight:700; }
.p-order-text { flex:1; min-width:0; }
.p-order-controls { display:flex; gap:5px; flex-shrink:0; }
.p-icon-button { min-width:48px; min-height:48px; border:1px solid #c5d4e3; border-radius:9px; background:white; font-size:22px !important; }
.p-pairs { margin:20px 0; }
.p-pair { display:grid; grid-template-columns:1fr minmax(160px,.85fr); align-items:center; gap:18px; padding:15px 0; border-bottom:1px solid var(--p-border); }
.p-pair select { width:100%; }
.p-privacy { font-size:12px; line-height:1.9; color:#5b6f80; border-top:1px solid var(--p-border); padding-top:16px; margin-top:21px !important; }
.p-saved h3 { font-size:26px; color:#265c4d; margin:12px 0 8px; }
.p-plan-card { margin:25px 0; padding:0; border:1px solid #d6e5de; border-radius:14px; background:#f4f9f6; }
.p-plan-card > div { padding:18px 22px; }
.p-plan-card > div + div { border-top:1px solid #d6e5de; }
.p-plan-card dt { color:#446657; font-size:12px; font-weight:750; margin-bottom:6px; }
.p-plan-card dd { margin:0; white-space:pre-wrap; }
.p-preserve { white-space:pre-wrap; }
.p-forget { margin-top:20px; }
.p-forget p { font-size:13px; }
.p-forget button { margin-right:8px; margin-top:6px; }
.p-source { margin-top:30px; border-top:1px solid var(--p-border); color:var(--p-muted); font-size:12px; }
.p-source blockquote { margin:12px 0; padding:10px 16px; border-left:3px solid #b7cadd; background:#f6f8fa; }
.p-source p { margin-bottom:10px; }
.p-source a, .p-source button { margin-top:10px; }
.p-notice { margin:0 !important; padding:16px 22px; background:#fff7e6; color:#705022; font-size:14px; border-top:1px solid #eddbb6; border-radius:0 0 20px 20px; }
@container (max-width:650px) {
  .p-toggle { gap:16px; padding:20px; flex-wrap:wrap; }
  .p-cover-symbol { width:49px; height:57px; font-size:21px; }
  .p-cover-title { font-size:20px; }
  .p-open-label { width:100%; text-align:right; }
  .p-panel { padding:17px 20px 24px; }
  .p-settings-grid { grid-template-columns:1fr; }
  .p-pair { grid-template-columns:1fr; gap:9px; }
  .p-order-controls { flex-direction:column; }
}
@container (max-width:400px) {
  .p-toggle { padding:17px 15px; gap:13px; }
  .p-cover-symbol { display:none; }
  .p-cover-title { font-size:19px; }
  .p-panel { padding:13px 14px 20px; }
  .p-progress li { font-size:12px; gap:5px; flex-direction:column; min-height:65px; }
  .p-case { padding:16px; }
  .p-case p { font-size:16px; }
  .p-option { padding:14px 11px; gap:10px; font-size:15px; }
  .p-option.selected { padding:13px 10px; }
  .p-explanation { padding:16px; }
  .p-actions > button { width:100%; }
  .p-plan-card > div { padding:15px; }
  .p-order li { gap:8px; padding:10px; font-size:14px; }
  .p-order-number { min-width:14px; }
}
@media (prefers-reduced-motion:reduce) {
  .parent-practice *, .practice-preview * { transition:none !important; animation:none !important; scroll-behavior:auto !important; }
}
/* Standalone preview only: does not replace or restyle the original course. */
.practice-preview { margin:0; background:#f4f6f9; color:#24374c; font-family:-apple-system,BlinkMacSystemFont,"PingFang TC","Microsoft JhengHei",system-ui,sans-serif; line-height:1.7; }
.practice-preview * { box-sizing:border-box; }
.practice-preview a:focus-visible, .practice-preview button:focus-visible, .practice-preview select:focus-visible { outline:3px solid #2866b5; outline-offset:3px; }
.preview-header { display:flex; justify-content:space-between; align-items:center; gap:15px; min-height:76px; padding:12px 32px; background:#fff; border-bottom:1px solid #dce4ed; }
.preview-header a { display:inline-flex; align-items:center; min-height:48px; text-decoration:none; color:#305b87; font-size:13px; }
.preview-header a.preview-brand { gap:10px; font-size:19px; font-weight:700; color:#283d53; }
.preview-brand span { padding:6px 10px; background:#edf3fc; border-radius:8px; font-size:14px; letter-spacing:.08em; color:#24599d; }
.preview-notice { padding:11px 32px; font-size:12px; color:#75572b; background:#fff8ea; border-bottom:1px solid #eadfc8; }
.preview-layout { display:grid; grid-template-columns:285px minmax(0,1fr); max-width:1530px; margin:auto; }
.preview-sidebar { border-right:1px solid #dde5ee; padding:24px 14px; background:#fff; }
.preview-sidebar h2 { font-size:13px; margin:0 8px 16px; color:#566d84; }
.preview-sidebar button { display:flex; align-items:flex-start; gap:9px; width:100%; min-height:52px; border:0; border-radius:9px; background:transparent; text-align:left; color:#40566c; font:inherit; font-size:13px; line-height:1.6; padding:12px 10px; cursor:pointer; }
.preview-sidebar button > span:first-child { font-size:11px; color:#5b7290; padding-top:2px; font-variant-numeric:tabular-nums; }
.preview-sidebar button[aria-current] { background:#edf4ff; color:#24599d; font-weight:700; }
.preview-sidebar button:hover { background:#f2f6fb; }
.preview-main { min-width:0; max-width:1060px; width:100%; padding:28px 40px 55px; margin:auto; }
.preview-picker { display:flex; align-items:center; gap:12px; margin-bottom:26px; }
.preview-picker label { font-size:12px; color:#536c84; white-space:nowrap; }
.preview-picker select { min-width:0; flex:1; width:100%; min-height:48px; border:1px solid #cbd8e5; background:#fff; border-radius:9px; padding:10px; font:inherit; font-size:15px; color:#354e68; }
.preview-picker > span { font-size:12px; color:#536c84; white-space:nowrap; }
.preview-intro { margin-bottom:29px; }
.preview-intro h1 { margin:10px 0 10px; font-size:28px; line-height:1.5; letter-spacing:-.01em; }
.preview-intro p { margin:0; font-size:15px; color:#50667c; }
.preview-tags { display:flex; gap:8px; margin-top:18px; flex-wrap:wrap; }
.preview-tags span { font-size:11px; color:#536c84; background:#e8eef5; padding:4px 9px; border-radius:6px; }
.preview-footer { font-size:12px; line-height:1.9; margin-top:25px; color:#5d7185; }
.p-skip { position:absolute; left:16px; top:-100px; padding:12px; background:white; color:#24599d; z-index:10; }
.p-skip:focus { top:10px; }
@media (max-width:1000px) {
  .preview-layout { grid-template-columns:1fr; }
  .preview-sidebar { display:none; }
  .preview-main { max-width:900px; padding:25px 28px 50px; }
}
@media (max-width:900px) {
  body.parent-mode aside.sidebar { top:0; width:min(360px, calc(100vw - 40px)); max-width:100%; }
  body.parent-mode .header-center { margin:0; max-width:210px; }
  body.parent-mode .header-title { max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  body.parent-mode .progress-bar-wrap { display:none; }
}
@media (max-width:600px) {
  body.parent-mode header { padding:10px 12px; flex-wrap:wrap; height:auto; min-height:116px; gap:8px; }
  body.parent-mode .header-left { gap:8px; flex:1; }
  body.parent-mode .header-title { font-size:12px; max-width:180px; }
  body.parent-mode .header-center { max-width:none; width:100%; order:3; flex:auto; }
  body.parent-mode .progress-box { font-size:11px; }
  body.parent-mode .icon-btn { min-width:44px; min-height:44px; }
  body.parent-mode .stage-action-bar { padding:12px 10px; }
  body.parent-mode .action-group-left { flex-wrap:wrap; gap:8px; }
  body.parent-mode .action-group-left .btn { padding:8px 10px; font-size:12px; min-width:0; }
  body.parent-mode .btn-mark-done { flex:1; }
  body.parent-mode .lesson-title-text { font-size:16px; line-height:1.6; }
  body.parent-mode .breadcrumbs { font-size:11px; }
  body.parent-mode .label-toggle { font-size:12px; }
}
@media (max-width:500px) {
  .preview-header { padding:10px 15px; min-height:68px; }
  .preview-header a.preview-brand { font-size:16px; gap:7px; }
  .preview-header a { font-size:12px; }
  .preview-notice { padding:11px 16px; font-size:11px; }
  .preview-main { padding:20px 12px 35px; }
  .preview-intro { padding:0 3px; margin-bottom:22px; }
  .preview-intro h1 { font-size:22px; }
  .preview-picker { flex-wrap:wrap; gap:7px; margin-bottom:22px; }
  .preview-picker select { flex:1 1 100%; order:3; font-size:16px; }
  .preview-picker > span { margin-left:auto; }
}

/* Stage Tabs Switcher (睇片 vs 玩game) */
.stage-tabs-wrapper {
  margin: 2px 0 14px;
}
.stage-tabs-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  padding: 5px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
}
.stage-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 18px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  font-family: inherit;
}
.stage-tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.7);
  color: #1e293b;
}
.stage-tab-btn.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12), 0 1px 2px rgba(0, 0, 0, 0.06);
  font-weight: 700;
}
.stage-tab-icon {
  flex-shrink: 0;
}
.stage-tab-tag {
  font-size: 11.5px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f8fafc;
  color: #64748b;
  transition: all 0.2s;
}
.stage-tab-btn.active .stage-tab-tag {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 600;
}
.stage-tab-tag-accent {
  background: #fef3c7;
  color: #b45309;
}
.stage-tab-btn.active .stage-tab-tag-accent {
  background: #fef3c7;
  color: #b45309;
}

/* Stage View Panels */
.stage-view-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}
.stage-view-panel[hidden] {
  display: none !important;
}

/* Scenario Image Card (強化學習場景) */
.p-scenario-image-card {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(36, 89, 157, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  border: 1px solid #dce4ec;
  background: #f8fafc;
  margin-bottom: 20px;
  aspect-ratio: 16 / 9;
}
.p-scenario-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.p-scenario-image-card:hover .p-scenario-image {
  transform: scale(1.015);
}
.p-scenario-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.p-scenario-badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
}

@media (max-width: 640px) {
  .stage-tabs-nav {
    display: flex;
    width: 100%;
  }
  .stage-tab-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    font-size: 13.5px;
  }
  .stage-tab-tag {
    display: none;
  }
}

