:root {
  --bg: #ffffff;
  --fg: #1a2333;
  --muted: #5b6675;
  --accent: #1f6feb;
  --accent-dark: #175ab8;
  --line: #e6e9ef;
  --card: #f6f8fb;
  --radius: 12px;
  --maxw: 960px;
  --nav-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

/* ===== Navigation ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
  color: var(--fg) !important;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.15s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); text-decoration: none; }

/* ===== Layout ===== */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 20px 64px;
}

/* ===== Home hero ===== */
.hero { padding: 56px 0 16px; }
.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.5px;
}
.hero .title-line {
  margin-top: 14px;
  font-size: 1.12rem;
  color: var(--accent);
  font-weight: 500;
}
.hero p.lead {
  margin-top: 18px;
  max-width: 640px;
  color: var(--muted);
  font-size: 1.02rem;
}
.kw {
  margin-top: 20px;
  margin-bottom: -2px;
}
.kw .role-badge { margin: 0 8px 8px 0; }
.hero .meta {
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.92rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

/* Badges / tags */
.role-badge {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--fg);
  margin: 0 8px 8px 0;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Sections ===== */
.section { margin-top: 40px; }
.section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section h2 .bar {
  width: 4px;
  height: 20px;
  background: var(--accent);
  border-radius: 2px;
}
.section .sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 18px;
}

/* ===== Card list (research / papers) ===== */
.items { display: grid; grid-template-columns: 1fr; gap: 14px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(20, 40, 80, 0.06);
}
.card h3 { font-size: 1.06rem; font-weight: 650; }
.card h3 a { color: var(--fg); }
.card h3 a:hover { color: var(--accent); }
.card .tags { margin: 8px 0 4px; }
.card .tags span {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 0.78rem;
  margin-right: 6px;
}
.card p { color: var(--muted); font-size: 0.93rem; margin-top: 6px; }
.card .venue {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
}

/* Two-column grid (research) */
.grid2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* ===== Publication list ===== */
.pubs { list-style: none; }
/* Plain-text publication title */
.pubs .t .paper-title { color: var(--fg); font-weight: 600; font-size: 0.99rem; }
.pubs .t .venue { display:block; margin-top:3px; }

.pubs li {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.pubs li:last-child { border-bottom: none; }
.pubs .year {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
}
.pubs .t a { color: var(--fg); font-weight: 600; font-size: 0.99rem; }
.pubs .t a:hover { color: var(--accent); }
.pubs .t .authors { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.pubs .pdf {
  font-size: 0.8rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

/* ===== Blog ===== */
.blog-list { display: grid; gap: 12px; }
@media (min-width: 720px) { .blog-list { grid-template-columns: 1fr 1fr; } }
.post {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.post:hover { border-color: var(--accent); }
.post .d { color: var(--muted); font-size: 0.8rem; }
.post h3 { font-size: 1rem; font-weight: 650; }
.post h3 a { color: var(--fg); }
.post h3 a:hover { color: var(--accent); text-decoration: none; }
.post p { color: var(--muted); font-size: 0.88rem; }

/* ===== Education ===== */
.edu {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}
.edu-item {
  position: relative;
  padding: 0 0 26px 34px;
}
.edu-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.edu-dot {
  position: absolute;
  left: 0;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
}
.edu-item:last-child .edu-dot { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(31,111,235,0.12); }
.edu-body { max-width: 640px; }
.edu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.edu-period {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.2px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 10px;
}
.edu-degree {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 5px;
  padding: 1px 8px;
  letter-spacing: 0.3px;
}
.edu-title {
  font-size: 1.08rem;
  font-weight: 700;
  margin-top: 9px;
  color: var(--fg);
}
.edu-school {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 3px;
}
.edu-place {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 2px;
}
@media (max-width: 560px) {
  .edu-item { padding-left: 28px; }
}

/* ===== About / footer ===== */
.about-bio p { color: var(--fg); margin-bottom: 14px; }
ul.plain { list-style: none; }
ul.plain li { padding: 10px 0; border-bottom: 1px dashed var(--line); }
ul.plain li b { color: var(--accent); font-weight: 600; }

footer {
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 32px 20px 40px;
}
footer .ft-links { margin-bottom: 10px; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
footer .copy { opacity: 0.85; }

/* Page head */
.page-head { padding: 16px 0 8px; }
.page-head h1 { font-size: 2rem; font-weight: 800; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 700px; }

/* Placeholder note */
.placeholder-note {
  border: 1px dashed var(--line);
  background: #fbfcfe;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 14px;
}

/* ===== CV page ===== */
.cv-block { margin-bottom: 18px; }
.cv-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.cv-title { font-weight: 700; font-size: 1.02rem; line-height: 1.45; }
.cv-extra { color: var(--muted); font-weight: 500; font-size: 0.92rem; }
.cv-date { color: var(--accent); font-weight: 600; font-size: 0.82rem; white-space: nowrap; }
.cv-line { color: var(--muted); font-style: italic; font-size: 0.9rem; margin-top: 3px; }
.cv-subhead { font-weight: 700; font-size: 0.95rem; margin-bottom: 6px; color: var(--fg); }
.cv-list { list-style: none; margin: 8px 0 0; padding: 0; }
.cv-list li { padding: 5px 0 5px 16px; position: relative; color: var(--fg); font-size: 0.93rem; }
.cv-list li::before { content: ""; position: absolute; left: 0; top: 13px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0.7; }
.cv-block.note { color: var(--muted); font-size: 0.9rem; border-left: 3px solid var(--line); padding-left: 12px; }
@media (max-width: 520px) { .cv-date { white-space: normal; } }

/* ===== Article page ===== */
.article { max-width: 720px; }
.article p { color: var(--fg); margin: 0 0 16px; font-size: 1rem; }
.article h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 32px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
}
.article b { color: var(--fg); }
.article i { color: inherit; }

/* ===== Article tables ===== */
.article table { border-collapse: collapse; width: 100%; margin: 16px 0 20px; font-size: 0.9rem; }
.article th, .article td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.article th { background: #f5f6f8; font-weight: 600; }
.article caption { caption-side: top; text-align: left; font-size: 0.82rem; color: var(--muted); padding-bottom: 6px; }
.article ul, .article ol { margin: 0 0 16px; padding-left: 22px; }
.article li { margin-bottom: 4px; }
.article code { background:#f2f3f5; padding:1px 5px; border-radius:4px; font-size:0.9em; }

/* ===== ICP filing (MIIT) ===== */
.icp { margin-bottom: 6px; font-size: 0.82rem; }
.icp a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.icp a:hover { color: var(--fg); text-decoration: underline; }
.icp .icp-icon { width: 14px; height: 14px; flex: none; vertical-align: middle; }
