:root {
  color-scheme: light;
  --bg: #faf9f7;
  --surface: #fff;
  --text: #36332f;
  --muted: #76706b;
  --line: #e6e2dd;
  --accent: #95616d;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #222120; --surface: #292725; --text: #e6e2dd; --muted: #afa8a0; --line: #3b3733; --accent: #d6a5af;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #222120; --surface: #292725; --text: #e6e2dd; --muted: #afa8a0; --line: #3b3733; --accent: #d6a5af;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 15px; line-height: 1.9; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 5px; }
a:hover { text-decoration: underline; }
a span[aria-hidden] { display: inline-block; margin-left: 5px; font-size: .85em; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
::selection { background: var(--accent); color: var(--bg); }
.wrap { max-width: 984px; padding: 0 32px; margin: 0 auto; }
.click-fireworks { position: fixed; inset: 0; z-index: 100; width: 100vw; height: 100vh; height: 100dvh; pointer-events: none; }
.topbar { height: 104px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.wordmark { color: var(--text); font-size: 19px; font-weight: 600; letter-spacing: -.5px; }
.topbar nav { display: flex; align-items: center; gap: 28px; }
.topbar nav a { font-size: 13px; color: var(--muted); }
.nav-item { position: relative; }
.nav-link { padding: 0; font-size: 13px; color: var(--muted); background: none; border: 0; cursor: pointer; }
.nav-link:hover { color: var(--accent); }
.nav-item::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 12px; }
.nav-sub { position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%); display: none; min-width: 132px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .07); z-index: 20; }
.nav-item:hover .nav-sub, .nav-item.open .nav-sub { display: block; }
.nav-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.nav-sub a { display: block; padding: 7px 12px; border-radius: 4px; white-space: nowrap; }
.theme-toggle { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; color: var(--muted); background: none; border: 0; cursor: pointer; border-radius: 4px; }
.theme-toggle:hover { color: var(--accent); }
.profile-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 82px; padding: 74px 0 68px; }
.profile { padding-top: 5px; }
.avatar { display: block; width: 192px; height: 192px; object-fit: cover; border-radius: 50%; }
h1 { font-size: 32px; line-height: 1.3; font-weight: 500; letter-spacing: -.8px; margin: 23px 0 4px; }
.role { font-size: 14px; color: var(--muted); margin: 0; }
.profile-note { font-size: 13px; color: var(--muted); margin: 20px 0 13px; }
.social-links { display: flex; gap: 22px; font-size: 13px; }
.content section + section { margin-top: 38px; }
h2 { font-size: 25px; line-height: 1.4; font-weight: 500; letter-spacing: -.6px; margin: 0 0 18px; }
.content p { margin: 0 0 15px; }
.content p:last-child { margin-bottom: 0; }
.academic-info { display: grid; grid-template-columns: 1fr 1.3fr; gap: 24px; margin-top: 27px; }
.academic-info h3 { margin-bottom: 10px; color: var(--text); }
.academic-info ul { margin: 0; padding-left: 18px; }
.academic-info p, .academic-info li { font-size: 14px; }
.academic-info li, .academic-info p span { color: var(--muted); }
.project-list { list-style: none; padding: 0; margin: 0; }
.project-list li + li { margin-top: 21px; }
h3 { margin: 0 0 3px; font-size: 16px; font-weight: 500; }
.project-list p { color: var(--muted); font-size: 14px; }
#contact p { color: var(--muted); font-size: 14px; margin-bottom: 7px; }
.email { font-size: 14px; }
.footer { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 21px 0 30px; color: var(--muted); font-size: 11px; }
.skip-link { position: absolute; top: -80px; left: 16px; padding: 8px 14px; background: var(--surface); z-index: 10; }
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.error-page .wrap { min-height: 100svh; display: flex; flex-direction: column; }
.error-page .topbar, .error-page .footer { flex-shrink: 0; }
.not-found { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 64px 0 80px; }
.not-found .not-found__avatar { width: 112px; height: 112px; margin-bottom: 28px; }
.not-found h1 { margin: 0; font-size: clamp(28px, 5vw, 36px); font-weight: 500; }
.not-found__text { max-width: 360px; margin: 18px 0 24px; color: var(--muted); font-size: 14px; }
.not-found__link { font-size: 14px; }
@media (max-width: 760px) {
  .profile-layout { gap: 40px; grid-template-columns: 180px minmax(0, 1fr); }
  .avatar { width: 160px; height: 160px; }
  .desktop-break { display: none; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 24px; }
  .topbar { height: auto; min-height: 80px; padding: 18px 0; flex-wrap: wrap; gap: 12px 24px; }
  .topbar nav { gap: 16px; }
  .topbar nav a { font-size: 12px; }
  .nav-link { font-size: 12px; }
  .nav-sub { top: calc(100% + 10px); }
  .profile-layout { display: block; padding: 38px 0 42px; }
  .profile { display: grid; grid-template-columns: 104px 1fr; column-gap: 24px; align-items: start; padding: 0 0 34px; margin-bottom: 34px; border-bottom: 1px solid var(--line); }
  .avatar { width: 104px; height: 104px; grid-row: 1 / 5; }
  h1 { font-size: 27px; margin: -3px 0 0; }
  .role { font-size: 12px; }
  .profile-note { font-size: 12px; margin: 8px 0 4px; }
  .social-links { gap: 16px; font-size: 12px; }
  h2 { font-size: 23px; margin-bottom: 15px; }
  .content section + section { margin-top: 32px; }
  body { font-size: 14px; }
  .project-list p { font-size: 13px; }
  .academic-info { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 360px) {
  .topbar nav { gap: 11px; }
  .wrap { padding: 0 20px; }
  .profile { column-gap: 18px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
