import 'package:flutter/material.dart';
import '../l10n/l10n.dart';
class TutorialScreen extends StatelessWidget {
  const TutorialScreen({super.key});

  @override
  Widget build(BuildContext context) {
    final l = LangScope.of(context).l10n;
    return Scaffold(
      appBar: AppBar(title: Text(l('tutorial'))),
      body: ListView(
        padding: const EdgeInsets.all(20),
        children: const [
          _H('Four principles'),
          _P('1. BaZi records the density distribution of the Five-Element field at birth.'),
          _P('2. Stems are time-sequence; branches are space-sequence.'),
          _P('3. Matter, energy, and mind are structure — keys resonate in spacetime.'),
          _P('4. Structure decides how external energy is absorbed, buffered, blocked, or damaged.'),
          _H('Keys'),
          _P('合 / 冲 / 刑 / 害 / 破 / 生 / 克 / 同字 / 同行 — channels between GanZhi.'),
          _H('Resonance & entanglement'),
          _P('Resonance stacks energy (×1–×6). Entanglement syncs state (peer / clash / combine).'),
          _H('Meridian origin'),
          _P('Beijing 120°E. True solar offset 4 min/°. Day boundary 23:00. Southern hemisphere flips month branch only.'),
          _H('Liu Qin layers'),
          _P('Layer 1 natal bloodline · Layer 2 luck manifestation · Layer 3 yearly ten-gods (outside family).'),
          _H('531 boundary'),
          _P('Fate 50% + Luck 30% + Geography 10% + Will 5% + Heaven 5% → max accuracy 80%.'),
          SizedBox(height: 24),
          Text('© 2026 Jason Li. All rights reserved.', style: TextStyle(fontSize: 12)),
        ],
      ),
    );
  }
}

class _H extends StatelessWidget {
  final String t;
  const _H(this.t);
  @override
  Widget build(BuildContext context) => Padding(
        padding: const EdgeInsets.only(top: 16, bottom: 8),
        child: Text(t, style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w700)),
      );
}

class _P extends StatelessWidget {
  final String t;
  const _P(this.t);
  @override
  Widget build(BuildContext context) => Padding(
        padding: const EdgeInsets.only(bottom: 8),
        child: Text(t, style: const TextStyle(height: 1.45)),
      );
}
