/* ==========================================================================
   Teng Wan — personal academic page
   Light, quiet, and mostly white: soft aurora light behind frosted-glass cards.
   No JavaScript, no dark mode, no dependencies.
   ========================================================================== */

:root {
  --bg: #f4f6fb;
  --ink: #14161a;
  --ink-2: #2f3540;
  --muted: #6b7280;
  --faint: #7d8492;
  --line: rgba(17, 24, 39, .08);
  --accent: #4f46e5;

  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-edge: rgba(255, 255, 255, .85);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 1px 2px rgba(16, 24, 40, .04), 0 14px 34px -18px rgba(16, 24, 40, .22);

  --radius: 20px;
  --maxw: 820px;

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

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.66;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .18s ease, opacity .18s ease;
}
a:hover { text-decoration: underline; text-underline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

strong { font-weight: 600; }

/* ---------- 背景光晕 ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .55;
  will-change: transform;
}

.orb--1 {
  width: 46vw; height: 46vw; max-width: 620px; max-height: 620px;
  top: -14vw; left: -8vw;
  background: radial-gradient(circle at 30% 30%, #a9c4ff, #c8b9ff 55%, transparent 72%);
  animation: drift-a 26s ease-in-out infinite alternate;
}

.orb--2 {
  width: 40vw; height: 40vw; max-width: 540px; max-height: 540px;
  top: 6vw; right: -12vw;
  background: radial-gradient(circle at 60% 40%, #ffd0e0, #ffc9b8 55%, transparent 72%);
  opacity: .42;
  animation: drift-b 32s ease-in-out infinite alternate;
}

.orb--3 {
  width: 44vw; height: 44vw; max-width: 580px; max-height: 580px;
  bottom: -18vw; left: 22vw;
  background: radial-gradient(circle at 40% 60%, #b7f0e4, #cfe6ff 60%, transparent 74%);
  opacity: .38;
  animation: drift-c 38s ease-in-out infinite alternate;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4vw, 3vh, 0) scale(1.08); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.05); }
  to   { transform: translate3d(-5vw, 4vh, 0) scale(1); }
}
@keyframes drift-c {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(3vw, -4vh, 0) scale(1.1); }
}

/* ---------- 版面 ---------- */
.page {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px 22px 56px;
}

/* ---------- 玻璃卡片 ---------- */
.card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), var(--shadow-md);
  padding: 26px 28px;
  animation: rise .65s cubic-bezier(.2, .7, .3, 1) both;
}

@keyframes rise {
  from { transform: translateY(10px); }
  to   { transform: none; }
}

/* ---------- 名片 ---------- */
.hero {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 28px;
}

.avatar {
  flex: 0 0 104px;
  width: 104px;
  margin-top: 2px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 15%;
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(17, 24, 39, .06), 0 10px 22px -14px rgba(16, 24, 40, .45);
}

.hero__text { min-width: 0; }

h1 {
  font-size: 29px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .005em;
  margin: 0 0 6px;
}

.h1-en {
  font-size: 16px;
  font-weight: 400;
  color: var(--faint);
  margin-left: 6px;
  white-space: nowrap;
}

.affil {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13.5px;
  letter-spacing: .01em;
}

.bio {
  margin: 0 0 14px;
  color: var(--ink-2);
  text-wrap: pretty;
  font-size: 14.5px;
  line-height: 1.65;
}

.links { display: flex; flex-wrap: wrap; gap: 8px; }

.links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid rgba(17, 24, 39, .07);
  color: var(--ink-2);
  font-size: 13px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, color .18s ease,
              border-color .18s ease, background-color .18s ease;
}
.links a:hover {
  color: var(--accent);
  border-color: rgba(79, 70, 229, .28);
  transform: translateY(-1px);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 18px -12px rgba(79, 70, 229, .55);
}
.links a::after {
  content: "↗";
  font-size: 11px;
  color: var(--faint);
  transition: color .18s ease;
}
.links a[href^="mailto"]::after { content: none; }
.links a:hover::after { color: var(--accent); }

/* ---------- 关键词 ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.chips li {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(17, 24, 39, .06);
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: .01em;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* ---------- 章节 ---------- */
section.card { margin-top: 16px; animation-delay: .12s; }
h2 {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 14px;
}

p { margin: 0; }
.card p + p { margin-top: 11px; }

/* ---------- 论文 ---------- */
.pubs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pubs > li {
  padding: 15px 0;
  border-top: 1px solid var(--line);
}
.pubs > li:first-child { border-top: 0; padding-top: 0; }
.pubs > li:last-child { padding-bottom: 0; }

.pub-title {
  display: block;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  letter-spacing: .005em;
  transition: color .18s ease;
}
.pub-title:hover {
  color: var(--accent);
  text-decoration: none;
}

.pub-authors {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-2);
}

.pub-venue {
  margin: 1px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- 折叠摘要 ---------- */
details { margin-top: 5px; }

summary {
  width: fit-content;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  color: var(--faint);
  transition: color .18s ease;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "＋ ";
  font-size: 10px;
}
details[open] summary::before { content: "－ "; }
summary:hover { color: var(--accent); }

details p {
  margin: 8px 0 2px;
  padding: 2px 0 2px 12px;
  border-left: 2px solid rgba(79, 70, 229, .22);
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  animation: fade .3s ease both;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 教育 / 经历 ---------- */
.row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.row:first-of-type { border-top: 0; padding-top: 0; }
.row:last-child { padding-bottom: 0; }

.when {
  color: var(--faint);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-top: 1px;
}

.what {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.55;
}

.sub {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- 页脚 ---------- */
footer {
  margin-top: 24px;
  text-align: center;
  animation: rise .7s cubic-bezier(.2, .7, .3, 1) .24s both;
}
footer p {
  color: var(--faint);
  font-size: 12px;
  letter-spacing: .02em;
}

/* ---------- 窄屏 ---------- */
@media (max-width: 700px) {
  .page { padding: 36px 16px 40px; }
  .card { padding: 20px; border-radius: 18px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .avatar { flex-basis: auto; width: 76px; }
  h1 { font-size: 25px; }
  .row { grid-template-columns: 1fr; gap: 2px; }
  .when { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orb, .card, .chips, footer { animation: none !important; }
  details p { animation: none !important; }
}

/* ---------- 打印 ---------- */
@media print {
  :root {
    --bg: #fff; --muted: #444; --ink: #000; --faint: #666;
    --line: #ddd; --accent: #000;
  }
  .aurora { display: none; }
  body { background: #fff; }
  .page { max-width: none; padding: 0; }
  .card {
    background: #fff;
    border: 0;
    box-shadow: none;
    padding: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    animation: none;
  }
  section.card, footer { margin-top: 18px; }
  details > summary { display: none; }
  details p {
    border: 0; padding-left: 0; color: #333;
    display: block;
  }
}
