/* =========================================================
   Zikun Dai — personal homepage
   Minimal academic style (white · sans-serif · blue accent).
   System fonts only (fast in CN). No external dependencies.
   ========================================================= */

:root {
  --bg:        #ffffff;
  --text:      #1f2328;
  --soft:      #3d434a;
  --muted:     #6b7177;
  --accent:    #1257c2;
  --accent-deep:#0e459b;
  --border:    #e8e8e8;
  --thumb-bg:  #ffffff;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif;

  --maxw: 760px;
  --pad: clamp(20px, 5vw, 32px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-weight: 700; line-height: 1.25; margin: 0; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 650; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

.skip-link { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--accent); color: #fff; padding: 10px 16px; }
.skip-link:focus { left: 0; }
.muted { color: var(--muted); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  max-width: var(--maxw); margin: 0 auto;
  padding: 12px var(--pad);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--border);
}
/* keep the sticky bar full-bleed while content stays centered */
.nav { width: 100%; }
.nav-brand { flex: 0 0 auto; color: var(--text); }
.nav-brand:hover { text-decoration: none; color: var(--accent); }
.nav-logo { width: 128px; height: auto; }
.nav-links { display: flex; gap: 20px; margin-left: auto; }
.nav-links a { color: var(--soft); font-size: 0.94rem; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }

/* ---------- layout ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad) 8px; }

.section { padding: 34px 0; border-top: 1px solid var(--border); }
.section-title { font-size: 1.32rem; margin-bottom: 18px; letter-spacing: 0.01em; }

/* ---------- intro ---------- */
.intro {
  display: flex; align-items: center; gap: clamp(22px, 5vw, 40px);
  padding: clamp(30px, 6vw, 52px) 0 38px;
}
.intro-text { min-width: 0; flex: 1; }
.intro h1 { font-size: clamp(1.9rem, 5.2vw, 2.5rem); letter-spacing: -0.01em; margin-bottom: 16px; }
.name-cn { font-weight: 500; color: var(--muted); font-size: 0.62em; margin-left: 6px; }
.intro-role { font-size: 1.08rem; font-weight: 600; margin: 10px 0 2px; }
.intro-interests { color: var(--accent-deep); font-weight: 600; margin: 0 0 14px; }
.intro-bio { color: var(--soft); margin: 0 0 16px; max-width: 56ch; text-wrap: balance; }
.intro-links { margin: 0; font-size: 0.96rem; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.intro-links a { display: inline-flex; align-items: center; gap: 6px; }
.intro-links .ico { flex: 0 0 auto; }

.portrait {
  flex: 0 0 auto;
  width: clamp(200px, 30vw, 240px);
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(31,35,40,.05), 0 10px 26px rgba(31,35,40,.07);
}

/* ---------- generic row (education / award entry) ---------- */
.row { display: flex; gap: 16px; padding: 14px 0; }
.row:first-of-type { padding-top: 4px; }
.row-logo { flex: 0 0 auto; width: 44px; height: 44px; object-fit: contain; margin-top: 2px; }
.row-body { flex: 1; min-width: 0; }
.row-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.row-title { font-size: 1.04rem; }
.row-title .degree { display: inline-block; min-width: 4.75em; }
.row-date { margin-left: auto; color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-org { margin: 3px 0 0; color: var(--soft); }
.row-sub { margin: 4px 0 0; color: var(--muted); font-size: 0.94rem; }

/* ---------- experience entries ---------- */
.proj { display: flex; gap: 20px; padding: 16px 0; align-items: flex-start; }
.proj-thumb {
  flex: 0 0 auto; width: 132px; height: 92px;
  display: grid; place-items: center;
  background: var(--thumb-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px;
}
.proj-thumb img { max-width: 100%; max-height: 54px; width: auto; height: auto; object-fit: contain; }
.proj-thumb.project-cover { height: auto; aspect-ratio: 800 / 446; padding: 0; overflow: hidden; }
.proj-thumb.project-cover img { width: 100%; height: 100%; max-height: none; object-fit: cover; }
.proj-body { flex: 1; min-width: 0; }
.proj-title { font-size: 1.08rem; margin-bottom: 3px; }
.proj-title a { color: inherit; }
.proj-meta { margin: 0 0 6px; color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.proj-desc { margin: 0; color: var(--soft); font-size: 0.97rem; }
.project-links { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 11px; }
.project-links a { display: inline-flex; align-items: center; text-decoration: none; }
.project-link {
  gap: 4px; min-height: 20px; padding: 1px 0;
  border-bottom: 1px solid #cbd5e1;
  color: var(--soft); font-size: 0.82rem; font-weight: 650; line-height: 1.2;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.project-link:hover { color: var(--accent); border-color: var(--accent); }
.project-link-icon { flex: 0 0 auto; }
.external-mark { color: var(--muted); font-size: 0.76rem; }
.arxiv-mark { color: #b31b1b; font-weight: 750; letter-spacing: -0.03em; }
.github-star { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-variant-numeric: tabular-nums; }
.github-link:hover .github-star { color: var(--accent); }

/* ---------- award list ---------- */
.award-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 9px; }
.award-list li { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding-left: 20px; }
.award-name { font-weight: 600; }
.award-list li::before { content: "▸"; position: absolute; top: 0; left: 0; color: var(--accent); }
.award-org { color: var(--muted); font-size: 0.92rem; margin-left: auto; }

/* ---------- footer ---------- */
.site-footer { max-width: var(--maxw); margin: 0 auto; padding: 28px var(--pad) 48px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.88rem; }
.site-footer p { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 600px) {
  .intro { flex-direction: column-reverse; align-items: flex-start; gap: 18px; }
  .portrait { width: min(100%, 320px); }
  .nav-links { gap: 14px; }
  .proj { gap: 14px; }
  .proj-thumb { width: 92px; height: 72px; padding: 10px; }
  .row-date { margin-left: 0; flex-basis: 100%; }
  .award-org { margin-left: 0; flex-basis: 100%; }
}

@media (max-width: 480px) {
  .nav { flex-wrap: wrap; gap: 8px 0; }
  .nav-brand { margin: 0 auto; }
  .nav-logo { width: 112px; }
  .nav-links { width: 100%; margin-left: 0; justify-content: space-between; gap: 10px; }
}

@media (max-width: 380px) {
  .proj { flex-direction: column; }
  .proj-thumb { width: 100%; height: 110px; }
}
