:root {
  --bg: #fff;
  --fg: #0f172a;
  --muted: #475569;
  --link: #2563eb;
  --card: #f8fafc;
  --border: #e2e8f0;
  --accent: #111827;
  --badge: #eef2ff;

  --pdf: #7c3aed;
  --pdf-hover: #6d28d9;
  --doi: #059669;
  --doi-hover: #047857;
  --arxiv: #dc2626;
  --arxiv-hover: #b91c1c;

  --label-bg: rgba(15, 23, 42, .04);
  --pdf-border: #e9d5ff;
  --doi-border: #bbf7d0;
  --arxiv-border: #fecaca;

  --pane: #e6ebf3;
  --shadow-card: 0 1px 3px rgba(15, 23, 42, .12), 0 6px 12px rgba(15, 23, 42, .10);
  --shadow-pane: 0 6px 20px rgba(15, 23, 42, .14);

  --scroll-thumb: rgba(15, 23, 42, .45);
  --scroll-thumb-hover: rgba(15, 23, 42, .65);
  --scroll-track: rgba(15, 23, 42, .08);

  --radius-pane: 12px;
  --news-pane-h: 180px;
  --pubs-pane-h: 360px;
  --globe-max: 120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f1a;
    --fg: #e5e7eb;
    --muted: #9ca3af;
    --link: #93c5fd;
    --card: #0f1626;
    --border: #1f2937;
    --accent: #f9fafb;
    --badge: #111827;

    --pdf: #a78bfa;
    --pdf-hover: #c4b5fd;
    --doi: #34d399;
    --doi-hover: #6ee7b7;
    --arxiv: #f87171;
    --arxiv-hover: #fca5a5;

    --label-bg: rgba(255, 255, 255, .06);
    --pdf-border: rgba(167, 139, 250, .35);
    --doi-border: rgba(52, 211, 153, .35);
    --arxiv-border: rgba(248, 113, 113, .35);

    --pane: #0a0f1d;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, .55), 0 8px 24px rgba(0, 0, 0, .40);
    --shadow-pane: 0 8px 28px rgba(0, 0, 0, .48);

    --scroll-thumb: rgba(255, 255, 255, .35);
    --scroll-thumb-hover: rgba(255, 255, 255, .55);
    --scroll-track: rgba(255, 255, 255, .10);
    --globe-max: 120px;
  }
}

/* 全局背景：底色 + 顶部均匀柔光 */
html,
body {
  margin: 0;
  padding: 0;
  color: var(--fg);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    'Apple Color Emoji', 'Segoe UI Emoji';
  background-color: var(--bg);
}

@media (prefers-color-scheme: light) {
  html, body {
    background-image:
      linear-gradient(to bottom,
        rgba(15, 23, 42, 0.12),
        rgba(15, 23, 42, 0.00) 60%),
      radial-gradient(1200px 600px at 50% 0px,
        rgba(15, 23, 42, 0.12),
        transparent 70%);
    background-repeat: no-repeat;
    background-attachment: fixed;
  }
}

@media (prefers-color-scheme: dark) {
  html, body {
    background-image:
      linear-gradient(to bottom,
        rgba(255, 255, 255, 0.14),
        rgba(255, 255, 255, 0.00) 52%),
      radial-gradient(1200px 520px at 50% 0px,
        rgba(255, 255, 255, 0.16),
        transparent 70%);
    background-repeat: no-repeat;
    background-attachment: fixed;
  }
}

/* 版心：优先占 92vw，上限 1200；下限 320 以适配手机 */
.container{
  width: min(92vw, 1200px);
  max-width: 1200px;       /* 冗余保护，可留可不留 */
  margin: 0 auto;
  padding: clamp(12px, 3.5vw, 28px) clamp(12px, 4vw, 28px) 120px;
}

/* 超宽屏可再放大一点（可选） */
@media (min-width: 1600px){
  .container{ width: min(88vw, 1280px); }
}

/* 保证内嵌媒体在小屏不溢出 */
img, video, iframe { max-width: 100%; height: auto; }

header { display: flex; align-items: center; gap: 22px; margin-bottom: 18px; }

header img {
  width: 84px; height: 84px; border-radius: 16px; object-fit: cover;
  border: 1px solid var(--border); background: #fff;
}

h1 { font-size: 28px; margin: 0 0 6px 0; letter-spacing: .2px; }

.subtitle { color: var(--muted); font-size: 15px; }

/* 联系方式链接：保持当前默认色，其他状态与 News 链接一致 */
/* 顶部联系方式：颜色同原来，间距优化 */
.contact a{
  color: var(--link);
  text-decoration: none;
  margin-right: 24px;            /* 每个链接之间更疏 */
}
.contact a:last-child{ margin-right: 0; }

.contact a:visited{
  color: var(--link);
  text-decoration: none;
}
.contact a:hover,
.contact a:active{
  color: color-mix(in srgb, var(--link) 60%, var(--fg) 15%); /* 轻微提亮 */
  text-decoration: none;
}
.contact a:focus-visible{
  outline: 2px solid color-mix(in srgb, var(--link) 60%, transparent);
  outline-offset: 2px;
  text-decoration: none;
}

/* 图标与文字更近 */
.contact a.icon{
  display: inline-flex;
  align-items: center;
  gap: 3px;                      /* 原 10px -> 3px */
  line-height: 1;
  padding: 2px 0;
}
.contact a.icon svg{
  width: 18px; height: 18px; flex: 0 0 18px; stroke: currentColor;
}

.nav{ display:flex; gap:14px; margin:18px 0 10px 0; flex-wrap:wrap; }
.nav a {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px;
  text-decoration: none; color: var(--fg); font-size: 14px; background: var(--card);
}

section { margin-top: 28px; }
section h2 { font-size: 20px; margin: 0 0 14px 0; }

.controls { display: flex; gap: 10px; align-items: center; margin: 8px 0 12px 0; }
.controls label { font-size: 13px; color: var(--muted); }

select {
  padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--fg);
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: var(--badge); color: var(--accent); border-radius: 999px;
  padding: 4px 10px; font-size: 12px; border: 1px solid var(--border);
}

.pub {
  padding: 14px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--card); margin: 12px 0; box-shadow: var(--shadow-card);
}
.pub .title { font-weight: 600; }
.pub .venue { font-size: 13px; color: var(--muted); }
.pub .authors { font-size: 14px; color: var(--muted); }

.links { margin-top: .9em; display: flex; flex-wrap: wrap; gap: 8px; }
.links a { color: var(--link); text-decoration: none; }

.links a.pdf-link,
.links a.doi-link,
.links a.arxiv-link {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  background: var(--label-bg); border: 1px solid transparent; line-height: 1.3; font-weight: 600;
}
.links a.pdf-link { color: var(--pdf); border-color: var(--pdf-border); }
.links a.doi-link { color: var(--doi); border-color: var(--doi-border); }
.links a.arxiv-link { color: var(--arxiv); border-color: var(--arxiv-border); }

.links a.pdf-link:hover { color: var(--pdf-hover); background: rgba(124, 58, 237, .10); text-decoration: underline; }
.links a.doi-link:hover { color: var(--doi-hover); background: rgba(5, 150, 105, .10); text-decoration: underline; }
.links a.arxiv-link:hover { color: var(--arxiv-hover); background: rgba(220, 38, 38, .10); text-decoration: underline; }
.links a:focus { outline: 2px solid currentColor; outline-offset: 2px; text-decoration: none; }

.scrollbox {
  overflow: auto; overflow-x: hidden; padding: 12px; background: var(--pane);
  border: 1px solid var(--border); border-radius: var(--radius-pane);
  -webkit-overflow-scrolling: touch; box-shadow: var(--shadow-pane);
  clip-path: inset(0 round var(--radius-pane)); -webkit-mask-image: -webkit-radial-gradient(white, black);
  scrollbar-gutter: stable; scrollbar-color: var(--scroll-thumb) var(--scroll-track); scrollbar-width: thin;
}
.scrollbox::-webkit-scrollbar { height: 10px; width: 10px; }
.scrollbox::-webkit-scrollbar-track { background: var(--scroll-track); border-radius: 8px; }
.scrollbox::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box;
}
.scrollbox::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }

#news .scrollbox { max-height: var(--news-pane-h); padding: 12px 14px 12px 22px; background: var(--card); }
#publications .scrollbox { max-height: var(--pubs-pane-h); }

.me { text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }

footer { margin-top: 56px; color: var(--muted); font-size: 13px; }
.hr { height: 1px; background: var(--border); margin: 18px 0; }

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

.kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  background: var(--card); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); font-size: 12px;
}

/* ========================== */
/* News: 日期胶囊 + 文本两列对齐 */
/* ========================== */
#news-list { list-style: none; padding-left: 0; }

#news-list li {
  display: grid;
  grid-template-columns: calc(10ch + 20px) minmax(0, 1fr);
  align-items: center; gap: 12px; margin: 6px 0;
}

#news-list li .pill {
  width: 100%; box-sizing: border-box; text-align: center; padding: 2px 10px;
  border-radius: 9999px; background: var(--badge); border: 1px solid var(--border);
  color: var(--fg); font-weight: 600;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1;
}

#news-list li .msg { color: var(--muted); overflow-wrap: anywhere; }

/* News 文本中的链接：柔和色、轻微 visited 差异、可见性高亮 */
#news .msg a{
  color: color-mix(in srgb, var(--link) 70%, var(--fg) 30%);
  font-weight: 700;
  text-decoration: none;
}
#news .msg a:visited{
  color: color-mix(in srgb, var(--link) 40%, var(--fg) 60%); /* 仅 5% 差异 */
  text-decoration: none;
}
#news .msg a:hover,
#news .msg a:active{
  color: var(--link);
  text-decoration: none;
}
#news .msg a:focus-visible{
  outline: 2px solid color-mix(in srgb, var(--link) 60%, transparent);
  outline-offset: 2px;
  text-decoration: none;
}

/* 窄屏：上下两行 */
@media (max-width: 480px) {
  #news-list li { grid-template-columns: 1fr; align-items: start; }
  #news-list li .pill { justify-self: start; margin-bottom: 4px; }
}

/* ============================== */
/* Dark mode: News 区域对比增强   */
/* ============================== */
@media (prefers-color-scheme: dark) {
  #news .scrollbox { background: #0c1322; border-color: #2a3a55; box-shadow: var(--shadow-pane); }
  #news-list li .pill {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  }
  #news-list li .msg { color: color-mix(in srgb, var(--fg) 92%, transparent); }
}

/* ===== Education: left accent bar + degree chips ===== */
.edu-grid{ list-style:none; padding-left:0; margin:0; }
.edu-grid li{
  position:relative; padding:10px 0 12px 16px; margin:6px 0 10px;
  display:grid; grid-template-columns:1fr auto; gap:10px; align-items:baseline; line-height:1.5;
}
.edu-grid li::before{
  content:""; position:absolute; left:0; top:8px; bottom:8px; width:4px; border-radius:4px;
  background:linear-gradient(180deg, var(--link), transparent 80%); opacity:.55;
}
.degree{
  display:inline-block; margin-left:8px; padding:2px 8px; font-size:12px; font-weight:600; vertical-align:middle;
  color:var(--link); background:var(--label-bg); border:1px solid var(--border); border-radius:9999px; transition:all .2s ease;
}
.degree:hover{ color:var(--pdf-hover); border-color:var(--pdf-border); }

.ed-grid b{ color:var(--accent); }
.ed-grid .school{ color:var(--muted); }
.ed-grid .when{ color:var(--muted); white-space:nowrap; }

@media (max-width:560px){
  .edu-grid li{ grid-template-columns:1fr; }
  .ed-grid .when{ justify-self:start; margin-top:2px; }
}

/* 右列整体：Mon 列 + Year/文本 列 */
.ed-grid .when{
  justify-self: end; text-align: right; white-space: nowrap; color: var(--muted);
  display: inline-grid; grid-auto-flow: column; grid-template-columns: 3.2ch auto;
  column-gap: 6px; align-items: baseline;
}
.when .mon{
  display: inline-block; width: 3.2ch; text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.when .yr{ font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

.logos{ display:flex; gap:16px; align-items:center; margin-top:10px; }
.logos img{
  height:28px; /* 也可 24~32 自行微调 */
  filter: grayscale(100%);
  opacity:.8;
  transition: filter .2s ease, opacity .2s ease, transform .2s ease;
}
.logos a:hover img{ filter:none; opacity:1; transform: translateY(-1px); }
/* 名字 + 校徽在同一行，基线对齐 */
/* 名字 + 校徽在同一行，基线对齐 */
.name-row{ display:flex; align-items:flex-end; gap:12px; flex-wrap:wrap; }
.name-logos{ display:flex; gap:8px; padding-bottom:3px; } /* 0–3px 可微调基线 */

/* 校徽：圆形裁切、适度放大以吃掉白边 */
.seal{
  width:40px; height:40px; display:inline-block;
  clip-path: circle(50%);
  background-position:center;
  background-repeat:no-repeat;
  background-size:108%;          /* 统一减少裁剪；越小露得越多 */
  filter: grayscale(8%); opacity:.95;
  transition: transform .2s ease, filter .2s ease, opacity .2s ease;
}
.seal:hover{ transform: translateY(-1px); filter:none; opacity:1; }

/* 指向资源 + 分别微调裁剪比例 */
.seal.nku{ background-image:url('assets/nku.png'); background-size:100%; }
.seal.fsu{ background-image:url('assets/fsu.png'); background-size:140%; background-position: 50% 50%; }

/* 窄屏略缩小 */
@media (max-width:480px){
  .seal{ width:32px; height:32px; }
}

/* ---- Top-left dropdown menu ---- */
.nav{ display:none !important; }   /* 隐藏原胶囊导航 */

.menu{
  position: fixed; top: 14px; left: 14px; z-index: 1000;
}
.menu-toggle{
  appearance: none; border: 1px solid var(--border); border-radius: 999px;
  background: var(--card); color: var(--fg); padding: 8px 12px; font-size: 14px;
  box-shadow: var(--shadow-card); cursor: pointer;
}
.menu-toggle:focus-visible{ outline: 2px solid color-mix(in srgb, var(--link) 60%, transparent); outline-offset: 2px; }

.menu-list{
  position: absolute; margin: 8px 0 0 0; padding: 6px;
  list-style: none; background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-pane);
  min-width: 180px; display: none;
}
.menu.open .menu-list{ display: block; }

.menu-list li{ margin: 0; }
.menu-list a{
  display: block; padding: 8px 10px; border-radius: 8px; color: var(--fg); text-decoration: none;
}
.menu-list a:hover{ background: var(--label-bg); color: var(--link); }

/* ==== Visitors Globe (JS 控制尺寸) ==== */
#visitors h2{
  font-size: 20px;
  margin: 24px 0 12px;
}

/* 只保留地球，居中摆放 */
.globe-card{
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  display: flex;
  justify-content: center;
}

.globe-wrap{
  width: min(100%, var(--globe-max));
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  display: block;
  position: relative;
}

/* 让托管点内部的画布铺满容器 */
#globe-host canvas{
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* 保险：即使没搬运成功，也强制限制脚本注入容器的尺寸 */
#clstr_globe + div{
  width: min(100%, var(--globe-max));
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}
#clstr_globe + div canvas{
  width: 100% !important;
  height: 100% !important;
  display: block;
}
