:root{
  --sidebar-w: 300px;
  --topbar-h: 64px;
  --page-gap: 24px;
  --content-w: 980px;

  --bg0: #0b1220;
  --bg1: #0f1b33;
  --bg2: #f6f7fb;

  --glass: rgba(255,255,255,.62);
  --glass-strong: rgba(255,255,255,.78);
  --glass-border: rgba(255,255,255,.38);
  --glass-border-2: rgba(17,24,39,.10);
  --blur: 18px;

  --shadow-1: 0 1px 0 rgba(17,24,39,.04);
  --shadow-2: 0 10px 30px rgba(17,24,39,.10);
  --shadow-3: 0 18px 60px rgba(17,24,39,.12);

  --text: #0b1220;
  --muted: rgba(11,18,32,.62);
  --line: rgba(11,18,32,.10);
  --accent: #1d4ed8;

  --radius: 16px;
}

*,
*::before,
*::after{
  box-sizing: border-box;
}

html{
  scroll-behavior: smooth;
}

/* 背景：渐变 + 柔光叠层 + 细噪点 */
body{
  margin:0;
  color:var(--text);
  font-family:
    system-ui, -apple-system, "SF Pro Display", "SF Pro Text",
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans CJK SC", sans-serif;

  background:
    radial-gradient(1200px 800px at 12% 10%, rgba(255,255,255,.96), rgba(255,255,255,0) 58%),
    radial-gradient(900px 620px at 88% 8%, rgba(96,165,250,.18), rgba(96,165,250,0) 62%),
    radial-gradient(760px 540px at 78% 78%, rgba(125,211,252,.10), rgba(168,85,247,0) 65%),
    radial-gradient(680px 500px at 28% 88%, rgba(59,130,246,.10), rgba(59,130,246,0) 68%),
    linear-gradient(180deg, #f9fafc 0%, #eef2ff 42%, #f8fafc 100%);
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
}

body::before{
  content:"";
  position:fixed;
  inset:-12%;
  pointer-events:none;
  z-index:0;
  opacity:.95;
  background:
    radial-gradient(520px 520px at var(--mx, 18%) var(--my, 22%), rgba(255,255,255,.40), rgba(255,255,255,0) 62%),
    radial-gradient(680px 680px at calc(var(--mx, 18%) + 18%) calc(var(--my, 22%) + 8%), rgba(96,165,250,.12), rgba(96,165,250,0) 64%),
    radial-gradient(640px 640px at calc(var(--mx, 18%) + 52%) calc(var(--my, 22%) + 28%), rgba(168,85,247,.10), rgba(168,85,247,0) 66%);
  filter: blur(26px) saturate(1.08);
  transform: translate3d(0,0,0);
  animation: auroraFloat 18s ease-in-out infinite alternate;
}

body::after{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:0;
  opacity:.06;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode:multiply;
}

@keyframes auroraFloat{
  0%{
    transform: translate3d(-1.5%, -1%, 0) scale(1);
  }
  50%{
    transform: translate3d(1.2%, 1.5%, 0) scale(1.03);
  }
  100%{
    transform: translate3d(-1%, 2%, 0) scale(1.06);
  }
}
.sidebar,
.main{
  position: relative;
  z-index: 1;
}


/* Sidebar */
.sidebar{
  position:fixed;
  left:0;
  top:0;
  bottom:0;
  width:var(--sidebar-w);

  background: linear-gradient(180deg, rgba(255,255,255,.90), rgba(255,255,255,.82));
  border-right: 1px solid rgba(255,255,255,.55);
  box-shadow:
    0 1px 0 rgba(255,255,255,.70) inset,
    var(--shadow-2);

  backdrop-filter: saturate(1.35) blur(var(--blur));
  -webkit-backdrop-filter: saturate(1.35) blur(var(--blur));
}


.sidebar-inner{
  height:100%;
  padding:28px 22px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

.photo-wrap{
  width:170px;
  height:210px;
  border:1px solid var(--line);
  border-radius:50% / 58%;
  overflow:hidden;
  box-shadow: var(--shadow-2);
  background: #fff;
}

.photo-wrap img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.name{
  font-size:22px;
  line-height:1.2;
  margin:2px 0 0;
  letter-spacing:.2px;
  text-align: center;
}

.subtitle{
  margin:0;
  color:var(--muted);
  font-size:14px;
  text-align: center;
}


.meta{
  list-style:none;
  padding:0;
  margin:10px 0 0;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.meta li{
  font-size:14px;
  color:var(--muted);
}

.meta a{
  color:var(--accent);
  text-decoration:none;
}

.meta a:hover{
  text-decoration:underline;
}

.sidebar-footer{
  margin-top:auto;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.pill{
  display:inline-flex;
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  font-size:12px;
  color:var(--muted);
  background:#fff;
}

.pill,
.badge{
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.45);
  box-shadow: 0 6px 18px rgba(17,24,39,.06);
}

/* Main */
.main{
  margin-left: calc(var(--sidebar-w) + 32px);
  margin-right: 24px;
  min-height: 100vh;
  padding-top: 18px;
}

/* 关键修正：导航栏和内容区共用同一宽度与同一居中规则 */
.topbar{
  position: sticky;
  top: 18px;
  z-index: 30;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;

  min-height: var(--topbar-h);
  width: min(var(--content-w), 100%);
  margin: 0 auto 18px;
  padding: 10px 16px;

  background: linear-gradient(180deg, rgba(255,255,255,.80), rgba(255,255,255,.62));
  border: 1px solid rgba(255,255,255,.62);
  box-shadow:
    0 1px 0 rgba(255,255,255,.75) inset,
    0 12px 34px rgba(17,24,39,.10);
  border-radius: 999px;

  backdrop-filter: saturate(1.35) blur(var(--blur));
  -webkit-backdrop-filter: saturate(1.35) blur(var(--blur));
}


@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))){
  .sidebar,
  .topbar{
    background: rgba(255,255,255,.92);
  }
}

.topbar-left{
  display: none;
}

.brand{
  font-weight:700;
  letter-spacing:.3px;
}

.topnav{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
  flex: 1 1 auto;
  overflow-x:auto;
  scrollbar-width:none;
  min-width:0;
}

.topnav::-webkit-scrollbar{
  display:none;
}

.navlink{
  position: relative;
  color: var(--muted);
  text-decoration:none;
  font-size:13.5px;
  padding:8px 12px;
  border-radius:999px;
  white-space:nowrap;
  border: 1px solid transparent;
  transition: color .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.navlink:hover{
  color: var(--text);
  background: rgba(255,255,255,.62);
  border-color: rgba(255,255,255,.62);
  box-shadow: 0 6px 18px rgba(17,24,39,.06);
  transform: translateY(-1px);
}

/* 高级优化 1：当前 section 高亮 */
.navlink.active{
  color: var(--text);
  background: rgba(255,255,255,.96);
  border-color: rgba(17,24,39,.08);
  box-shadow: 0 8px 22px rgba(17,24,39,.08);
  font-weight: 600;
}

.navlink.active::after{
  content:"";
  position:absolute;
  left:12px;
  right:12px;
  bottom:4px;
  height:2px;
  border-radius:999px;
  background: linear-gradient(90deg, rgba(29,78,216,.18), rgba(29,78,216,.72), rgba(29,78,216,.18));
}

.topbar-right{
  display:flex;
  gap:10px;
  align-items:center;
  flex: 0 0 auto;
}

.btn{
  appearance:none;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.60);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13.5px;
  text-decoration:none;
  cursor:pointer;
  box-shadow: 0 10px 26px rgba(17,24,39,.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(17,24,39,.12);
}

.btn.ghost{
  background: rgba(255,255,255,.28);
}

/* Content */
.content{
  margin: 0 auto;
  width: min(var(--content-w), 100%);
  padding: 4px 0 40px;
}

.section{
  scroll-margin-top: calc(var(--topbar-h) + 28px);
  margin: 0 0 22px;
  padding: 20px 20px;

  background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.56));
  border: 1px solid rgba(255,255,255,.46);
  border-bottom-color: rgba(17,24,39,.10);
  border-right-color: rgba(17,24,39,.08);

  border-radius: calc(var(--radius) + 2px);
  box-shadow:
    0 1px 0 rgba(255,255,255,.70) inset,
    var(--shadow-1),
    var(--shadow-2);

  backdrop-filter: blur(calc(var(--blur) - 6px)) saturate(1.25);
  -webkit-backdrop-filter: blur(calc(var(--blur) - 6px)) saturate(1.25);

  transition: transform .24s ease, box-shadow .24s ease, opacity .5s ease, filter .5s ease;
}


.section:hover{
  box-shadow: var(--shadow-1), var(--shadow-3);
  transform: translateY(-1px);
}

.section h2{
  margin:0 0 12px;
  font-size:18px;
  letter-spacing:.2px;
}

/* 高级优化 2：section 渐入动画 */
.section.reveal{
  opacity: 0;
  transform: translateY(18px);
  filter: blur(6px);
}

.section.reveal.in-view{
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.kv{
  display:flex;
  flex-wrap:wrap;
  gap:10px 16px;
  margin:10px 0 0;
  color:var(--muted);
  font-size:14px;
}

.item{
  padding:12px 0;
  border-top:1px dashed var(--line);
}

.item:first-of-type{
  border-top:none;
  padding-top:0;
}

.item-title{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:baseline;
}

.item-title strong{
  font-size:15px;
}

.item-title .right{
  margin-left:0;
  width: 100%;
  color:var(--muted);
  font-size:13px;
}

.badge{
  display:inline-flex;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid var(--line);
  font-size:12px;
  color:var(--muted);
  background:#fff;
}

.bullets{
  margin:8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size:14px;
  line-height:1.7;
}

/* 高级优化 3：科研经历卡片强化 */
#research .item{
  position: relative;
  padding: 18px 0 18px;
  border-top: 1px dashed rgba(11,18,32,.10);
}

#research .item:first-of-type{
  padding-top: 4px;
}

#research .item::before{
  content:"";
  position:absolute;
  left:-8px;
  top:22px;
  bottom:22px;
  width:3px;
  border-radius:999px;
  background: linear-gradient(180deg, rgba(29,78,216,.00), rgba(29,78,216,.45), rgba(29,78,216,.00));
  opacity:.55;
}

#research .item-title{
  gap:12px;
  margin-bottom: 4px;
}

#research .item-title strong{
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: .1px;
}

#research .item-title .right{
  color: rgba(11,18,32,.56);
  font-size: 13.5px;
  margin-top: 2px;
}

#research .kv{
  margin-top: 10px;
  gap: 8px 10px;
}

#research .badge{
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(17,24,39,.08);
  box-shadow: 0 4px 12px rgba(17,24,39,.04);
}

#research .bullets{
  margin-top: 12px;
  line-height: 1.85;
}

#research .bullets li{
  margin-bottom: 8px;
}

#research .bullets li::marker{
  color: rgba(29,78,216,.75);
}

/* details/accordion for contests */
details{
  border-top:1px dashed var(--line);
  padding:10px 0;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
  border-radius: 12px;
}

details:first-of-type{
  border-top:none;
  padding-top:0;
}

details[open]{
  background: rgba(255,255,255,.32);
}

summary{
  cursor:pointer;
  list-style:none;
  display:flex;
  gap:10px;
  align-items:baseline;
  padding: 4px 2px;
}

summary::-webkit-details-marker{
  display:none;
}

.summary-title{
  font-weight:700;
}

.summary-right{
  margin-left:auto;
  color:var(--muted);
  font-size:13px;
  white-space:nowrap;
}


.contest-details{
  overflow: hidden;
}

.contest-details summary{
  position: relative;
}

.contest-details .details-body{
  height: 0;
  overflow: hidden;
  transition: height .32s ease, opacity .24s ease, transform .32s ease;
  opacity: 0;
  transform: translateY(-6px);
}

.contest-details.is-open .details-body{
  opacity: 1;
  transform: translateY(0);
}

.contest-details .bullets{
  margin-top: 10px;
  padding-bottom: 4px;
}

.contest-details summary::after{
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .25s ease, opacity .2s ease;
  margin-left: 8px;
  flex: 0 0 auto;
  opacity: .8;
}

.contest-details.is-open summary::after{
  transform: rotate(225deg);
}

.footer{
  padding: 0 0 26px;
  color: var(--muted);
  font-size: 12px;
  width: min(var(--content-w), 100%);
  margin: 0 auto;
}

/* Sidebar meta rows with icons */
.meta{
  list-style:none;
  padding:0;
  margin:10px 0 0;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.meta-row{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding:10px 10px;

  background: rgba(255,255,255,.52);
  border: 1px solid rgba(255,255,255,.42);
  border-bottom-color: rgba(17,24,39,.10);

  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(17,24,39,.08);

  backdrop-filter: blur(calc(var(--blur) - 8px));
  -webkit-backdrop-filter: blur(calc(var(--blur) - 8px));
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.meta-row:hover{
  transform: translateY(-1px);
  border-color: rgba(59,130,246,.28);
  box-shadow: 0 14px 28px rgba(17,24,39,.10);
}

.meta-ico-wrap{
  width:28px;
  height:28px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--line);
  background:#fff;
  color: var(--accent);
  flex: 0 0 auto;
}

.meta-ico{
  display:block;
}

.meta-text{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}

.meta-k{
  font-size:12px;
  color: var(--muted);
  letter-spacing:.2px;
}

.meta-v{
  font-size:14px;
  color: var(--text);
  line-height:1.35;
  word-break: break-word;
}

.meta-v a{
  color: var(--accent);
  text-decoration:none;
}

.meta-v a:hover{
  text-decoration:underline;
}

/* Give sidebar a soft gradient */
.sidebar{
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.86));
}

/* Make the photo border a bit more premium */
.photo-wrap{
  border:1px solid rgba(229,231,235,.9);
}

.section-title{
  display:flex;
  align-items:baseline;
  gap:10px;
}

.section-hint{
  font-size:12px;
  color: var(--muted);
  font-weight: 400;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

/* Responsive */
@media (max-width: 1180px){
  .main{
    margin-right: 18px;
  }

  .topbar,
  .content,
  .footer{
    width: min(var(--content-w), 100%);
  }
}

@media (max-width: 980px){
  .sidebar{
    position:static;
    width:auto;
    border-right:none;
    border-bottom:1px solid var(--line);
  }

  .main{
    margin-left:0;
    margin-right:0;
    padding: 12px 16px 0;
  }

  .topbar{
    position: sticky;
    top: 12px;
    width: 100%;
    border-radius: 22px;
    justify-content: flex-start;
  }

  .topnav{
    justify-content: flex-start;
  }

  .content,
  .footer{
    width: 100%;
  }

  .photo-wrap{
    width:150px;
    height:190px;
  }

  #research .item::before{
    display:none;
  }
}


.photo-wrap{
  margin: 0 auto;
}
