/* qingyu-chen.com — one stylesheet, system fonts only.
   Nothing is loaded from third-party servers, so the site behaves the same
   inside mainland China as anywhere else. */

:root {
  --ink: #1d1d1f;
  --muted: #5f6368;
  --rule: #e3e3e3;
  --accent: #002147;          /* Oxford blue, as in the CV */
  --link: #1a4f8b;
  --bg: #ffffff;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L",
           Georgia, "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial,
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
          sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
}

/* Chinese page reads better in a sans face on screen */
body.zh { font-family: var(--sans); font-size: 17px; line-height: 1.8; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header, footer and the photo + intro block use the full 1040px; everything
   else in <main> stops at 880px so long lines (abstracts) stay readable. */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
main.wrap > :not(.intro) { max-width: 880px; }

/* ---- header / nav ---------------------------------------------------- */
header.site {
  border-bottom: 1px solid var(--rule);
  margin-bottom: 36px;
}
header.site .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 22px;
  padding-bottom: 14px;
}
.brand {
  font-family: var(--serif);   /* same on the sans-serif Chinese page */
  font-size: 22px;
  color: var(--accent);
  font-variant: small-caps;
  letter-spacing: 0.04em;
}
.brand:hover { text-decoration: none; }
.brand .cjk { font-variant: normal; letter-spacing: 0.1em; margin-left: 6px; font-size: 19px; }

nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-family: var(--sans); font-size: 15px; }
nav a { color: var(--muted); }
nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }

/* ---- type ------------------------------------------------------------ */
h1, h2, h3 { color: var(--accent); font-weight: normal; line-height: 1.3; }
h1 { font-size: 32px; margin: 0 0 6px; }
h2 {
  font-size: 22px;
  margin: 40px 0 14px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--rule);
}
main > h2:first-child { margin-top: 0; }
h3 { font-size: 18px; margin: 0; color: var(--ink); }
p { margin: 0 0 14px; }

/* No single word / single character left alone on the last line.
   text-wrap: pretty covers current Chrome, Edge and Safari; the HTML also
   ties the last two words (or last two CJK characters) together, which
   covers every other browser. */
p, li, blockquote, .meta, .extra, .title, .row span { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
.nw { white-space: nowrap; }

/* The Chinese name is set in Kai (楷体), as on the old Google Site. These are
   system fonts (macOS, Windows, Taiwan), so nothing is downloaded. */
.kai { font-family: "Kaiti SC", STKaiti, KaiTi, "楷体", BiauKai, "DFKai-SB", Kai, serif; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 15px; }

/* ---- home: photo + intro -------------------------------------------- */
.intro { display: flex; gap: 40px; align-items: flex-start; }
.photo { width: 320px; flex-shrink: 0; }
.photo img { display: block; width: 100%; height: auto; border-radius: 4px; }
.photo a { display: inline-block; margin-top: 8px; font-family: var(--sans); font-size: 14px; }
.photo .contact { margin: 16px 0 0; font-family: var(--sans); font-size: 15px; line-height: 1.7; }
.photo .contact .label { min-width: 48px; }
.photo .contact a { display: inline; margin: 0; font-size: inherit; }
.intro .text { flex: 1; min-width: 0; }
.subtitle { color: var(--muted); margin: 0 0 18px; font-size: 17px; }

.contact { list-style: none; padding: 0; margin: 18px 0 0; font-size: 17px; }
.contact li { margin: 2px 0; }
.contact .label { color: var(--muted); display: inline-block; min-width: 72px; }

ul.plain { padding-left: 20px; margin: 0; }
ul.plain li { margin: 6px 0; }

/* ---- research entries ------------------------------------------------ */
.paper { margin: 0 0 30px; }
.paper .title { font-size: 20px; font-weight: 600; line-height: 1.35; }
.paper .title a { color: var(--ink); }
.paper .title a:hover { color: var(--link); }
.paper .meta { color: var(--muted); font-size: 17px; margin-top: 2px; }
.paper .tag {
  display: inline-block;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  border-radius: 3px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: 2px;
}
.paper .links { font-family: var(--sans); font-size: 14px; margin-top: 4px; }
.paper .links a { margin-right: 14px; }
.paper .status { font-style: italic; color: var(--muted); }

details { margin-top: 6px; }
details summary {
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--link);
  list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+ "; }
details[open] summary::before { content: "\2212 "; }
details .abstract {
  margin: 8px 0 18px;
  padding-left: 14px;
  border-left: 2px solid var(--rule);
  font-size: 17px;
  text-align: justify;
  hyphens: auto;
}
.extra { font-size: 16px; color: var(--muted); margin-top: 6px; }
.extra b { font-weight: 600; color: var(--ink); font-family: var(--sans); font-size: 13px; }

.legend { font-size: 16px; color: var(--muted); }

/* ---- teaching -------------------------------------------------------- */
.row { display: flex; justify-content: space-between; gap: 16px; margin: 4px 0; }
.row .when { color: var(--muted); white-space: nowrap; }
blockquote {
  margin: 0 0 14px;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--rule);
  color: #333;
  font-style: italic;
}

/* ---- footer ---------------------------------------------------------- */
footer.site {
  margin-top: 56px;
  border-top: 1px solid var(--rule);
  padding: 16px 0 32px;
  font-size: 14px;
  color: var(--muted);
  font-family: var(--sans);
}

/* ---- phones ---------------------------------------------------------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  header.site { margin-bottom: 24px; }
  .intro { flex-direction: column; gap: 18px; }
  /* phones: photo, pronunciation link, bio, then CV / email */
  .intro { gap: 0; }
  .photo { display: contents; }
  .photo img { width: 200px; order: 1; }
  .photo > a { order: 2; }
  .intro .text { order: 3; margin-top: 18px; }
  .photo .contact { order: 4; margin-top: 0; font-size: 16px; }
  h1 { font-size: 26px; }
  h2 { font-size: 20px; margin-top: 32px; }
  .row { flex-direction: column; gap: 0; }
  details .abstract { text-align: left; }
}
