/* ============================================================
   课题组主页 · al-folio 风格
   纯静态 / 无外网依赖 / 支持深色模式
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f9;
  --bg-elev: #ffffff;
  --fg: #1c1c1d;
  --fg-soft: #3c3c43;
  --muted: #6e6e79;
  --muted-2: #92929d;
  --line: #e6e6ea;
  --line-soft: #f0f0f3;
  --acc: #2f5fd0;
  --acc-soft: #eef2fd;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 28px -18px rgba(16, 24, 40, .28);
  --radius: 12px;
  --max: 1000px;
  --nav-h: 64px;
}

html[data-theme="dark"] {
  --bg: #1b1b1f;
  --bg-soft: #212127;
  --bg-elev: #232329;
  --fg: #e9e9ef;
  --fg-soft: #d3d3dc;
  --muted: #9a9aa7;
  --muted-2: #7c7c8a;
  --line: #2f2f38;
  --line-soft: #27272e;
  --acc: #7fa4ff;
  --acc-soft: #232c44;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -18px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .2s ease, color .2s ease;
}

a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

img { max-width: 100%; display: block; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------- 导航 ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.nav-in {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  font-weight: 650;
  font-size: 15.5px;
  letter-spacing: -.01em;
  color: var(--fg);
  white-space: nowrap;
  min-width: 0;
  flex: 0 1 auto;
}
.brand .full { white-space: nowrap; }
.brand:hover { text-decoration: none; color: var(--acc); }
.brand .dot { color: var(--muted-2); font-weight: 400; margin: 0 3px; }
.brand .en {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--muted-2);
  text-transform: uppercase;
  line-height: 1.2;
  margin-top: 1px;
}

.links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.links a {
  color: var(--muted);
  font-size: 14px;
  padding: 7px 11px;
  border-radius: 8px;
  transition: .16s;
  white-space: nowrap;
}
.links a:hover { color: var(--fg); background: var(--bg-soft); text-decoration: none; }
.links a[aria-current="page"] { color: var(--fg); font-weight: 600; background: var(--bg-soft); }

.theme {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  margin-left: 10px;
  transition: .16s;
}
.theme:hover { color: var(--fg); border-color: var(--muted-2); }

/* ---------------- 通用排版 ---------------- */
main { padding: 56px 0 40px; }

.eyebrow {
  font-size: 12.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0 0 14px;
  font-weight: 600;
}

h1, h2, h3, h4 { line-height: 1.3; letter-spacing: -.018em; }
h1 { font-size: 2.45rem; font-weight: 680; margin: 0 0 18px; }
h2 { font-size: 1.3rem; font-weight: 650; margin: 0 0 6px; }
h3 { font-size: 1.03rem; font-weight: 640; margin: 0 0 8px; }

p { margin: 0 0 16px; }
.lede { font-size: 1.06rem; color: var(--fg-soft); max-width: 62ch; }
.muted { color: var(--muted); }

section.block { margin: 0 0 64px; }

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 12px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.sec-head h2 { margin: 0; }
.sec-head .sub { color: var(--muted-2); font-size: 13px; }
.sec-head .more { margin-left: auto; font-size: 13.5px; color: var(--muted); }
.sec-head .more:hover { color: var(--acc); }

/* ---------------- Hero ---------------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  align-items: center;
  margin-bottom: 56px;
}
.hero-text h1 { margin-bottom: 20px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 18px;
  border-radius: 9px;
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: 14px;
  font-weight: 520;
  background: var(--bg-elev);
  transition: .18s;
}
.btn:hover { text-decoration: none; border-color: var(--muted-2); transform: translateY(-1px); }
.btn.primary {
  background: var(--acc);
  border-color: var(--acc);
  color: #fff;
  box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--acc) 70%, transparent);
}
.btn.primary:hover { filter: brightness(1.06); }

.hero-figure {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 18px;
  margin: 0;
  min-width: 0;
  overflow: hidden;
}
.hero-figure svg { width: 100%; height: auto; display: block; }
.hero-figure figcaption {
  margin-top: 10px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted-2);
  text-align: center;
  letter-spacing: .02em;
  white-space: normal;
  word-break: break-word;
}

/* ---------------- 统计条 ---------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 64px;
}
.stat { background: var(--bg-elev); padding: 22px 18px; text-align: center; }
.stat .n {
  font-size: 1.65rem;
  font-weight: 680;
  letter-spacing: -.03em;
  display: block;
  line-height: 1.2;
}
.stat .n small { font-size: .95rem; font-weight: 600; color: var(--muted); }
.stat .l { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: block; }

/* ---------------- 卡片网格 ---------------- */
.grid { display: grid; gap: 18px; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: .2s;
  position: relative;
}
.card:hover { border-color: color-mix(in srgb, var(--acc) 45%, var(--line)); box-shadow: var(--shadow); transform: translateY(-2px); }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 14.5px; margin: 0; }

.icon-box {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--acc-soft);
  color: var(--acc);
  margin-bottom: 16px;
}
.icon-box svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.7; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  letter-spacing: .01em;
}

/* ---------------- 列表 ---------------- */
.rows { border-top: 1px solid var(--line-soft); }
.row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  padding: 15px 4px;
  border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
}
.row .k { color: var(--muted-2); font-size: 13px; letter-spacing: .02em; }
.row .v { font-size: 14.5px; }

ul.clean { list-style: none; padding: 0; margin: 0; }
ul.clean li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  font-size: 14.5px;
  color: var(--fg-soft);
}
ul.clean li::before {
  content: "";
  position: absolute;
  left: 4px; top: .72em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--acc);
  opacity: .55;
}

/* ---------------- 论文条目（al-folio 版式） ---------------- */
.pub {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 24px;
  padding: 20px 6px 20px 14px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  transition: .18s;
}
.pub::before {
  content: "";
  position: absolute;
  left: 0; top: 22px; bottom: 22px;
  width: 2px;
  background: var(--acc);
  opacity: 0;
  border-radius: 2px;
  transition: .18s;
}
.pub:hover::before { opacity: .8; }
.pub:hover { background: var(--bg-soft); }
.pub .yr {
  font-size: 13px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  padding-top: 2px;
}
.pub .ttl { font-weight: 620; font-size: 15.5px; line-height: 1.5; margin-bottom: 5px; }
.pub .auth { font-size: 14px; color: var(--fg-soft); margin-bottom: 3px; }
.pub .auth b { font-weight: 650; border-bottom: 1.5px solid color-mix(in srgb, var(--acc) 55%, transparent); }
.pub .venue { font-size: 13.5px; color: var(--muted); font-style: italic; }
.pub .plinks { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.plink {
  font-size: 11.5px;
  padding: 2.5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  letter-spacing: .04em;
  background: var(--bg-elev);
}
.plink:hover { color: var(--acc); border-color: var(--acc); text-decoration: none; }

/* ---------------- 成员 ---------------- */
.member {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: center;
  transition: .2s;
}
.member:hover { border-color: color-mix(in srgb, var(--acc) 40%, var(--line)); box-shadow: var(--shadow); transform: translateY(-2px); }
.avatar {
  width: 74px; height: 74px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 650;
  color: var(--acc);
  background: var(--acc-soft);
  border: 1px solid color-mix(in srgb, var(--acc) 22%, var(--line));
  letter-spacing: .04em;
}
.member .name { font-weight: 620; font-size: 15px; margin-bottom: 2px; }
.member .role { font-size: 12.5px; color: var(--muted-2); }
.member .topic { font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.6; }

.pi {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 32px;
  align-items: start;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.pi .avatar { width: 132px; height: 132px; font-size: 38px; margin: 0; }
/* PI 真实照片：填满圆形，取像偏上（人脸居中） */
.pi-photo {
  display: block;
  object-fit: cover;
  object-position: 50% 22%;
  background: var(--acc-soft);
  border: 1px solid var(--line);
}
.pi h2 { font-size: 1.35rem; margin-bottom: 4px; }
.pi .pirole { color: var(--acc); font-size: 13.5px; font-weight: 600; margin-bottom: 14px; }
.pi p { font-size: 14.5px; color: var(--fg-soft); }
.pi .pi-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

/* ---------------- 表格 ---------------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.tbl th, table.tbl td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
table.tbl th {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted-2);
  letter-spacing: .06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
table.tbl tbody tr:hover { background: var(--bg-soft); }

/* ---------------- 页头 ---------------- */
.page-head { margin-bottom: 44px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: 2rem; margin-bottom: 10px; }
.page-head p { color: var(--muted); max-width: 68ch; margin: 0; }

/* ---------------- CTA ---------------- */
.cta {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  background: linear-gradient(180deg, var(--bg-soft), var(--bg-elev));
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.cta h2 { margin-bottom: 6px; }
.cta p { color: var(--muted); margin: 0; font-size: 14.5px; }
.cta .btn { margin-left: auto; flex: none; }

/* ---------------- 页脚 ---------------- */
footer {
  border-top: 1px solid var(--line-soft);
  padding: 34px 0 48px;
  margin-top: 40px;
  font-size: 13px;
  color: var(--muted-2);
}
.foot-in { display: flex; gap: 20px; flex-wrap: wrap; align-items: baseline; }
.foot-in .sp { margin-left: auto; }
footer a { color: var(--muted); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 32px; }
  .hero-figure { max-width: 420px; }
  .grid.c3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  :root { --nav-h: 58px; }
  h1 { font-size: 1.9rem; }
  main { padding-top: 34px; }

  /* 导航改两行：第一行 品牌 + 主题，第二行 横向可滑动的链接 */
  .nav { height: auto; }
  .nav-in { flex-wrap: wrap; padding: 9px 18px 0; gap: 0; }
  .brand { flex: 1 1 auto; font-size: 15px; }
  .brand .en { display: none; }
  .brand .full { display: none; }
  .brand::before { content: attr(data-short); }
  .theme { order: 2; margin-left: 12px; width: 30px; height: 30px; font-size: 13px; }
  .links {
    order: 3;
    width: 100%;
    margin-left: 0;
    padding: 5px 0 7px;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .links::-webkit-scrollbar { display: none; }
  .links a { padding: 6px 9px; font-size: 13.5px; }

  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid.c3, .grid.c2 { grid-template-columns: 1fr; }
  .pub { grid-template-columns: 1fr; gap: 6px; }
  .pub .yr { padding-top: 0; }
  .row { grid-template-columns: 1fr; gap: 2px; }
  .pi { grid-template-columns: 1fr; gap: 20px; padding: 22px; }
  .pi .avatar { width: 96px; height: 96px; font-size: 30px; }
  .cta { padding: 24px; }
  .cta .btn { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
