// Academic Homepage v2 — content + app shell

const CONTENT = {
  // About — CV
  education: [
    { whenZh: "博士", whenEn: "PhD", zh: "东南大学，桥梁与隧道工程", en: "Southeast University, Dept of Bridge & Tunnel Engineering", descZh: "", descEn: "" },
    { whenZh: "访问学者", whenEn: "Visiting Scholar", zh: "美国科罗拉多州立大学，土木与环境工程系", en: "Colorado State University, Dept of Civil & Environmental Engineering", descZh: "", descEn: "" },
    { whenZh: "硕士", whenEn: "MEng", zh: "武汉理工大学，工程力学", en: "Wuhan University of Technology, Dept of Engineering Mechanics", descZh: "", descEn: "" },
    { whenZh: "学士", whenEn: "BEng", zh: "武汉理工大学，工程力学", en: "Wuhan University of Technology, Dept of Engineering Mechanics", descZh: "", descEn: "" },
  ],
  experience: [
    { whenZh: "2025 至今", whenEn: "2025–present", zh: "南京工业大学，桥梁与隧道工程系，副教授（校聘）", en: "Nanjing Tech University, Dept of Bridge & Tunnel Engineering, Lecturer", descZh: "", descEn: "" },
    { whenZh: "2021–2025", whenEn: "2021–2025", zh: "同济大学，建筑工程系，博士后", en: "Tongji University, Dept of Building Engineering, Postdoctoral Researcher", descZh: "", descEn: "" },
  ],
  awards: [
    { zh: "IABSE 杰出青年工程师贡献奖", en: "IABSE Outstanding Young Engineer Contribution Award", year: "2024" },
  ],
  service: [
    { zh: "ASCE Fire Protection Committee", en: "ASCE Fire Protection Committee", role: "Member", periodZh: "2024至今", periodEn: "2024–present" },
    { zh: "IABSE Task Group 1.2: Structures Design of Bridges against Fire Hazards", en: "IABSE Task Group 1.2: Structures Design of Bridges against Fire Hazards", role: "Member", periodZh: "2024至今", periodEn: "2024–present" },
    { zh: "中国建筑学会结构抗火专业委员会", en: "Structural Fire Resistance Committee, Architectural Society of China", role: "Member", periodZh: "2023至今", periodEn: "2023–present" },
  ],

  // Research — themes (NJTech 主页只列两项主要研究领域)
  researchAreas: [
    {
      zh: "桥梁结构火灾安全",
      en: "Bridge fire safety",
      descZh: "", descEn: "",
      tags: [],
    },
    {
      zh: "建筑结构火灾安全",
      en: "Building fire safety",
      descZh: "", descEn: "",
      tags: [],
    },
  ],

  // Research — 代表性论文（两栏瀑布流，后期填入图与文字）
  representativePapers: [
    {
      cover: "assets/paper1-fig9.png",
      titleZh: "车辆火灾下桥梁拉索表面非均匀辐射的理论计算方法",
      titleEn: "Theoretical Method for Computing Heterogeneous Radiation on Bridge Cable Surface Emitted from Vehicle Fires",
      venueZh: "Fire Technology · 2025",
      venueEn: "Fire Technology · 2025",
      link: "https://doi.org/10.1007/s10694-025-01772-4",
      bodyZh: "① 提出了一种通用理论方法，通过几何离散化与封闭形式的辐射角系数算法，计算局部火灾作用下凸形复杂几何表面上的非均匀辐射热流。\n② 量化了车辆火灾作用下缆索承重桥梁缆索系统表面的非均匀辐射热流分布，揭示其沿轴向与环向的显著非均匀特征，为缆索抗火评估提供了精细化的热边界条件。",
      bodyEn: "① Proposes a general theoretical method for computing heterogeneous radiative heat flux on convex geometrically complex surfaces exposed to localized fires through geometric discretization and a closed-form radiation view-factor algorithm.\n② Quantifies the heterogeneous radiant heat-flux distributions on the cable systems of cable-supported bridges subjected to vehicle fires, revealing significant axial and circumferential non-uniformity and providing refined thermal boundary conditions for cable fire-resistance assessment.",
    },
    { cover: "assets/paper2-fig1.png",
      titleZh: "多等级车辆火灾下吊索系统的温度计算方法",
      titleEn: "Temperature Calculation Method for Hanger Systems Exposed to Multigrade Vehicle Fires",
      venueZh: "Journal of Bridge Engineering · 2024",
      venueEn: "Journal of Bridge Engineering · 2024",
      link: "https://doi.org/10.1061/JBENF2.BEENG-6760",
      bodyZh: "① 提出了面向悬索桥吊索系统的多等级车辆火灾框架，从火源、峰值热释放速率、燃烧持续时间与火焰几何等方面定量定义了代表性火灾场景。\n② 结合经验辐射模型、棱柱固体火焰公式与经验证的 CFD 模拟，建立了不同等级车辆火灾下吊索表面的热边界模型。\n③ 提出并验证了一套实用的吊索截面瞬态温度计算方法，形成了评估吊索系统在车辆火灾下热响应的完整流程。",
      bodyEn: "① Proposes a multigrade vehicle-fire framework for suspension-bridge hanger systems by quantitatively defining representative fire scenarios in terms of fire source, peak heat release rate, combustion duration, and flame geometry.\n② Establishes thermal-boundary models for hanger surfaces under different grades of vehicle fires by combining empirical radiation models, prismatic solid-flame formulations, and validated CFD simulations.\n③ Develops and validates a practical transient temperature calculation method for hanger sections, forming an integrated procedure for assessing the thermal response of hanger systems subjected to vehicle fires.",
    },
    {
      cover: "assets/paper3-fig1.png",
      titleZh: "桥梁火灾：研究现状、最新进展与当前研究空白",
      titleEn: "Fire Hazards in Bridges: State of the Art, Recent Progress, and Current Research Gaps",
      venueZh: "Journal of Bridge Engineering · 2023（综述）",
      venueEn: "Journal of Bridge Engineering · 2023 (State-of-the-Art Review)",
      link: "https://doi.org/10.1061/JBENF2.BEENG-5790",
      bodyEn: "① Identifies critical bridge fire scenarios for different bridge types, including beam, arch, cable-stayed, suspension, and frame-system bridges.\n② Reviews bridge fire accidents and extracts representative fire locations and damage mechanisms.\n③ Classifies experimental approaches into furnace tests and realistic fire tests.\n④ Classifies numerical fire modeling methods into temperature-curve methods, intermediate methods, and CFD-based methods.\n⑤ Summarizes fire performance of different bridge systems, including steel, concrete, steel–concrete composite, arch, and cable-supported bridges.\n⑥ Compares existing failure criteria and points out that many are borrowed from building fire tests.\n⑦ Organizes bridge fire-resilience strategies into risk-based mitigation, post-fire decision-making, and fire prevention/protection measures.\n⑧ Identifies key research gaps, including realistic fire testing, validated CFD–FE coupling, wind effects, cable fire behavior, and bridge-specific performance-based fire design.",
      bodyZh: "① 针对梁式、拱式、斜拉、悬索及框架体系等不同桥型，识别出关键的桥梁火灾场景。\n② 系统梳理桥梁火灾事故，提炼出代表性的起火位置与破坏机理。\n③ 将试验方法归纳为炉内试验与真实火灾试验两类。\n④ 将数值火灾模拟方法划分为温度曲线法、中间方法与基于 CFD 的方法。\n⑤ 总结了钢、混凝土、钢-混组合、拱式及缆索承重等不同桥梁体系的火灾性能。\n⑥ 比较了现有破坏判据，指出许多判据沿用自建筑火灾试验。\n⑦ 将桥梁火灾韧性策略归纳为基于风险的减灾、灾后决策与防火/防护措施三类。\n⑧ 指出关键研究空白，包括真实火灾试验、经验证的 CFD-FE 耦合、风效应、缆索火灾行为以及桥梁专用的性能化抗火设计。",
    },
    {
      cover: "assets/paper4-fig4.png",
      titleZh: "高温下高强钢丝的热物理性质",
      titleEn: "Thermophysical Properties of High-Strength Steel Wires at High Temperatures",
      venueZh: "Fire Safety Journal · 2024",
      venueEn: "Fire Safety Journal · 2024",
      link: "https://doi.org/10.1016/j.firesaf.2024.104165",
      bodyEn: "① Experimentally measures the mass density, specific heat capacity, and thermal conductivity of high-strength steel wires with strengths of 1670–2160 MPa at 20–800 °C.\n② Demonstrates significant differences from conventional structural steels, especially lower specific heat capacity at 400–700 °C and generally lower thermal conductivity.\n③ Proposes empirical correlations for different wire grades and for HSSWs overall, providing input data for fire-response analysis of structural cables.",
      bodyZh: "① 通过试验测定了强度为 1670–2160 MPa 的高强钢丝在 20–800 °C 范围内的质量密度、比热容与导热系数。\n② 揭示其与传统结构钢的显著差异，尤其是在 400–700 °C 区间更低的比热容以及总体偏低的导热系数。\n③ 针对不同钢丝等级及高强钢丝整体提出了经验关系式，为结构缆索的火灾响应分析提供了输入数据。",
    },
  ],
  publications: [
    {
      year: 2025, type: "article", cat: "bridges", invited: false,
      authors: { zh: "Zhi Liu, Guo-Qiang Li*, Jian Guan.", en: "Zhi Liu, Guo-Qiang Li*, Jian Guan." },
      title:   { zh: "Theoretical Method for Computing Heterogeneous Radiation on Bridge Cable Surface Emitted from Vehicle Fires.", en: "Theoretical Method for Computing Heterogeneous Radiation on Bridge Cable Surface Emitted from Vehicle Fires." },
      journal: { zh: "Fire Technology", en: "Fire Technology" },
      note:    { zh: "2025, 61", en: "2025, 61" },
      url:     "https://doi.org/10.1007/s10694-025-01772-4",
    },
    {
      year: 2025, type: "article", cat: "bridges", invited: false, language: "zh",
      authors: { zh: "刘志, 李国强*, 郑华凯.", en: "Zhi Liu, Guo-Qiang Li*, Huakai Zheng." },
      title:   { zh: "高温下高强钢丝的热力学性质研究.", en: "Thermodynamic Properties of High-Strength Steel Wires at Elevated Temperatures." },
      journal: { zh: "建筑材料学报", en: "Journal of Building Materials" },
      note:    { zh: "2025, 28(5), 477–482", en: "2025, 28(5), 477–482" },
    },
    {
      year: 2024, type: "article", cat: "bridges", invited: false,
      authors: { zh: "Zhi Liu, Guo-Qiang Li*, Yue Hu.", en: "Zhi Liu, Guo-Qiang Li*, Yue Hu." },
      title:   { zh: "Temperature Calculation Method for Hanger Systems Exposed to Multi-Grade Vehicle Fires.", en: "Temperature Calculation Method for Hanger Systems Exposed to Multi-Grade Vehicle Fires." },
      journal: { zh: "Journal of Bridge Engineering, ASCE", en: "Journal of Bridge Engineering, ASCE" },
      note:    { zh: "2024, 29(10), 04024077", en: "2024, 29(10), 04024077" },
      url:     "https://doi.org/10.1061/JBENF2.BEENG-6729",
    },
    {
      year: 2024, type: "article", cat: "bridges", invited: false, language: "zh",
      authors: { zh: "刘志, 李国强*.", en: "Zhi Liu, Guo-Qiang Li*." },
      title:   { zh: "分级车辆火灾下吊索系统的抗火性能计算方法.", en: "Fire-Resistance Calculation Method for Hanger Systems under Multi-Grade Vehicle Fires." },
      journal: { zh: "中国公路学报", en: "China Journal of Highway and Transport" },
      note:    { zh: "2024, 37(9), 1–16", en: "2024, 37(9), 1–16" },
    },
    {
      year: 2024, type: "article", cat: "bridges", invited: false,
      authors: { zh: "Zhi Liu, Guo-Qiang Li*.", en: "Zhi Liu, Guo-Qiang Li*." },
      title:   { zh: "Thermophysical Properties of High-Strength Steel Wires at High Temperatures.", en: "Thermophysical Properties of High-Strength Steel Wires at High Temperatures." },
      journal: { zh: "Fire Safety Journal", en: "Fire Safety Journal" },
      note:    { zh: "2024, 146, 104165", en: "2024, 146, 104165" },
      url:     "https://doi.org/10.1016/j.firesaf.2024.104165",
    },
    {
      year: 2023, type: "article", cat: "bridges", invited: false,
      authors: { zh: "Zhi Liu, Guo-Qiang Li*, Ignacio Paya-Zaforteza, C. S. Cai, Qiao Huang.", en: "Zhi Liu, Guo-Qiang Li*, Ignacio Paya-Zaforteza, C. S. Cai, Qiao Huang." },
      title:   { zh: "Fire Hazards in Bridges: State of the Art, Recent Progress, and Current Research Gaps.", en: "Fire Hazards in Bridges: State of the Art, Recent Progress, and Current Research Gaps." },
      journal: { zh: "Journal of Bridge Engineering, ASCE", en: "Journal of Bridge Engineering, ASCE" },
      note:    { zh: "2023, 28(7), 03123003", en: "2023, 28(7), 03123003" },
      url:     "https://doi.org/10.1061/JBENF2.BEENG-5790",
    },
    {
      year: 2023, type: "article", cat: "bridges", invited: false,
      authors: { zh: "Zhi Liu, Guo-Qiang Li*, Yuan Ren.", en: "Zhi Liu, Guo-Qiang Li*, Yuan Ren." },
      title:   { zh: "Performance of Steel Cable-Stayed Bridges in Ship Fires, Part II: Influencing Factors and Mechanisms.", en: "Performance of Steel Cable-Stayed Bridges in Ship Fires, Part II: Influencing Factors and Mechanisms." },
      journal: { zh: "Journal of Constructional Steel Research", en: "Journal of Constructional Steel Research" },
      note:    { zh: "2023, 108057", en: "2023, 108057" },
      url:     "https://doi.org/10.1016/j.jcsr.2023.108057",
    },
    {
      year: 2023, type: "article", cat: "bridges", invited: false,
      authors: { zh: "Zhi Liu, Guo-Qiang Li*.", en: "Zhi Liu, Guo-Qiang Li*." },
      title:   { zh: "Performance of Steel Cable-Stayed Bridges in Ship Fires, Part I: Numerical Method and Baseline Fire Scenario Study.", en: "Performance of Steel Cable-Stayed Bridges in Ship Fires, Part I: Numerical Method and Baseline Fire Scenario Study." },
      journal: { zh: "Journal of Constructional Steel Research", en: "Journal of Constructional Steel Research" },
      note:    { zh: "2023, 108090", en: "2023, 108090" },
      url:     "https://doi.org/10.1016/j.jcsr.2023.108090",
    },
    {
      year: 2023, type: "article", cat: "bridges", invited: true,
      authors: { zh: "Zhi Liu, Narasimhan Harikrishna, Kotsovinos Panagiotis, Guo-Qiang Li*, Eva Kragh, Woodburn Peter.", en: "Zhi Liu, Narasimhan Harikrishna, Kotsovinos Panagiotis, Guo-Qiang Li*, Eva Kragh, Woodburn Peter." },
      title:   { zh: "Enhancing Fire Resilience of Cable-Supported Bridges: Current Knowledge and Research Gaps.", en: "Enhancing Fire Resilience of Cable-Supported Bridges: Current Knowledge and Research Gaps." },
      journal: { zh: "Structural Engineering International", en: "Structural Engineering International" },
      note:    { zh: "2023, 33(4), 548–557", en: "2023, 33(4), 548–557" },
      url:     "https://doi.org/10.1080/10168664.2022.2164756",
    },
    {
      year: 2023, type: "article", cat: "bridges", invited: true,
      authors: { zh: "Zhi Liu, Guobiao Lou*, Jing Hou, Guo-Qiang Li.", en: "Zhi Liu, Guobiao Lou*, Jing Hou, Guo-Qiang Li." },
      title:   { zh: "Designing a Two-Level Steel Cable-Stayed Bridge against Fires.", en: "Designing a Two-Level Steel Cable-Stayed Bridge against Fires." },
      journal: { zh: "Structural Engineering International", en: "Structural Engineering International" },
      note:    { zh: "2023, 33(4), 569–575", en: "2023, 33(4), 569–575" },
      url:     "https://doi.org/10.1080/10168664.2023.2171331",
    },
    {
      year: 2021, type: "article", cat: "bridges", invited: false,
      authors: { zh: "Zhi Liu, Julio Cesar G. Silva, Qiao Huang*, Yuji Hasemi, Yili Huang, Zhaoyuan Guo.", en: "Zhi Liu, Julio Cesar G. Silva, Qiao Huang*, Yuji Hasemi, Yili Huang, Zhaoyuan Guo." },
      title:   { zh: "Coupled CFD-FEM Simulation Methodology for Fire-Exposed Bridges.", en: "Coupled CFD-FEM Simulation Methodology for Fire-Exposed Bridges." },
      journal: { zh: "Journal of Bridge Engineering, ASCE", en: "Journal of Bridge Engineering, ASCE" },
      note:    { zh: "2021, 26(10), 04021074", en: "2021, 26(10), 04021074" },
      url:     "https://doi.org/10.1061/(ASCE)BE.1943-5592.0001770",
    },
    {
      year: 2021, type: "article", cat: "bridges", invited: false,
      authors: { zh: "Zhi Liu, Qiao Huang*, Yushi Shan, Jian Chen, Hongbin Cao, Zhenpeng Yu.", en: "Zhi Liu, Qiao Huang*, Yushi Shan, Jian Chen, Hongbin Cao, Zhenpeng Yu." },
      title:   { zh: "Quantifying High Temperature–Induced Breakage Instant of Prestressing High-Strength Steel Wire.", en: "Quantifying High Temperature–Induced Breakage Instant of Prestressing High-Strength Steel Wire." },
      journal: { zh: "Journal of Materials in Civil Engineering, ASCE", en: "Journal of Materials in Civil Engineering, ASCE" },
      note:    { zh: "2021, 32(7), 04020189", en: "2021, 32(7), 04020189" },
      url:     "https://doi.org/10.1061/(ASCE)MT.1943-5533.0003262",
    },
  ],

  // Open Data
  datasets: [
    {
      kind: "data",
      zh: "整理自已发表文献的 110 组结构钢单轴拉伸试验数据",
      en: "110 sets of uniaxial tensile test data for structural steels compiled from published literature",
      descZh: "整理自已发表文献的 110 组结构钢单轴拉伸试验结果，含名义/真实应力—应变曲线、屈服强度、抗拉强度、断后伸长率等指标，并标注原始文献来源。",
      descEn: "110 sets of uniaxial tensile test results on structural steels compiled from published studies, including engineering and true stress–strain curves, yield and ultimate strengths, elongation at fracture, with citation to the original source.",
      size: "110 sets",
      format: "CSV",
      license: "CC BY 4.0",
      url: "#",
    },
  ],

  // Teaching
  courses: [
    {
      levelZh: "本科生", levelEn: "Undergraduate",
      zh: "弹性力学", en: "Theory of Elasticity",
      code: "", descZh: "", descEn: "",
      credits: "", term: "",
    },
  ],

  contact: {
    email: "zliu@njtech.edu.cn",
    phone: "025-58139488",
    address: {
      zh: "江苏省南京市江北新区浦珠南路30号，211800",
      en: "30 Puzhu South Road, Nanjing 211800, China",
    },
  },
};

const LANG_STORAGE_KEY = "liu-zhi-lang-v2";

function App() {
  const [tab, setTab] = React.useState("about");
  const [lang, setLang] = React.useState(() => {
    try { return localStorage.getItem(LANG_STORAGE_KEY) || "en"; } catch { return "en"; }
  });
  const [toast, setToast] = React.useState("");
  window.__currentLang = lang;

  React.useEffect(() => {
    document.body.dataset.lang = lang;
    document.documentElement.lang = lang;
    try { localStorage.setItem(LANG_STORAGE_KEY, lang); } catch {}
  }, [lang]);

  React.useEffect(() => {
    window.scrollTo({ top: 0, behavior: "smooth" });
  }, [tab]);

  const onEmail = async () => {
    const email = CONTENT.contact.email;
    try {
      await navigator.clipboard.writeText(email);
      setToast(lang === "en" ? `Copied ${email}` : `已复制 ${email}`);
    } catch {
      window.location.href = `mailto:${email}`;
    }
    clearTimeout(window.__toastT);
    window.__toastT = setTimeout(() => setToast(""), 1800);
  };

  const TabContent = () => {
    switch (tab) {
      case "about":    return <AboutTab    data={CONTENT} lang={lang} />;
      case "research": return <ResearchTab data={CONTENT} lang={lang} />;
      case "papers":   return <PapersTab   data={CONTENT} lang={lang} />;
      case "data":     return <DataTab     data={CONTENT} lang={lang} />;
      case "teaching": return <TeachingTab data={CONTENT} lang={lang} />;
      default:         return <AboutTab    data={CONTENT} lang={lang} />;
    }
  };

  return (
    <React.Fragment>
      <Hero lang={lang} />
      <MenuBar active={tab} onTab={setTab} lang={lang} onLang={setLang} onEmail={onEmail} />
      <main className="page">
        <TabContent key={tab + lang} />
      </main>
      <SiteFooter />
      <Toast message={toast} />
    </React.Fragment>
  );
}

ReactDOM.createRoot(document.getElementById("root")).render(<App />);
