// Генератор physics_9_hub.html на основе physics_10_hub.html // Палитра: blue (вместо amber у Phys 10), 5 глав, заголовки/описания Физики 9. 'use strict'; const fs = require('fs'); const path = require('path'); const SRC = path.join(__dirname, '..', '..', 'frontend', 'textbooks', 'physics_10_hub.html'); const DST = path.join(__dirname, '..', '..', 'frontend', 'textbooks', 'physics_9_hub.html'); let h = fs.readFileSync(SRC, 'utf8'); // === 1. Primary palette: amber (#ca8a04 / #fde047) → blue (#2563eb / #60a5fa) === h = h.replace( /:root\{[\s\S]*?--sh-h:0 12px 36px rgba\(202,138,4,\.18\);[\s\S]*?\}/, `:root{ --bg:#eff6ff; --card:#fff; --text:#0f172a; --muted:#475569; --border:#bfdbfe; --pri:#2563eb; --pri-d:#1d4ed8; --pri-soft:#dbeafe; --ch1:#2563eb; --ch1-d:#1d4ed8; --ch2:#059669; --ch2-d:#047857; --ch3:#7c3aed; --ch3-d:#6d28d9; --ch4:#db2777; --ch4-d:#be185d; --ch5:#0891b2; --ch5-d:#0e7490; --sh:0 4px 16px rgba(37,99,235,.10); --sh-h:0 12px 36px rgba(37,99,235,.18); }`); h = h.replace( /html\.dark\{[\s\S]*?--pri-soft:rgba\(202,138,4,\.16\);[\s\S]*?\}/, `html.dark{ --bg:#0a1428; --card:#102137; --text:#dbeafe; --muted:#93c5fd; --border:#1e3a5f; --pri-soft:rgba(37,99,235,.16); }`); // === 2. Header gradient: amber → blue === h = h.replace( /\.hdr\{position:relative;background:linear-gradient\(110deg,#713f12 0%,#ca8a04 55%,#fde047 100%\)[^}]*\}/, `.hdr{position:relative;background:linear-gradient(110deg,#1e3a8a 0%,#2563eb 55%,#60a5fa 100%);color:#fff;padding:32px 24px 28px;overflow:hidden;border-bottom:2px solid rgba(219,234,254,.18)}`); h = h.replace(/rgba\(254,243,199,\.12\)/g, 'rgba(219,234,254,.12)'); h = h.replace(/rgba\(254,243,199,\.18\)/g, 'rgba(219,234,254,.18)'); // === 3. po-icon gradient + po-bar/po-fill === h = h.replace( /\.po-icon\{[^}]*background:linear-gradient\(135deg,#ca8a04,#fde047\)[^}]*\}/, `.po-icon{width:46px;height:46px;border-radius:12px;background:linear-gradient(135deg,#2563eb,#60a5fa);color:#fff;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-family:'Outfit',sans-serif;font-size:1.4rem;font-weight:900;font-style:italic}`); h = h.replace(/\.po-bar\{height:8px;background:rgba\(202,138,4,\.14\)/, '.po-bar{height:8px;background:rgba(37,99,235,.14)'); h = h.replace(/\.po-fill\{height:100%;background:linear-gradient\(90deg,var\(--pri\),#fde047\)/, '.po-fill{height:100%;background:linear-gradient(90deg,var(--pri),#60a5fa)'); h = h.replace(/\.po-xp\{[^}]*background:linear-gradient\(135deg,#f59e0b,var\(--pri\)\)[^}]*\}/, ".po-xp{display:inline-flex;align-items:center;gap:6px;padding:6px 14px;background:linear-gradient(135deg,#3b82f6,var(--pri));color:#fff;border-radius:99px;font-size:.8rem;font-weight:800;font-family:'Unbounded',sans-serif;letter-spacing:.02em;box-shadow:0 4px 12px rgba(37,99,235,.24)}"); // === 4. Final-head gradient === h = h.replace( /\.final-head\{padding:18px 22px;background:linear-gradient\(135deg,#713f12 0%,#ca8a04 55%,#f59e0b 100%\)/, '.final-head{padding:18px 22px;background:linear-gradient(135deg,#1e3a8a 0%,#2563eb 55%,#3b82f6 100%)'); // === 5. Title + H1 + subtitle === h = h.replace(/