@font-face {
  font-family: "Linux Libertine";
  src: url("../fonts/linux-libertine/LinLibertine_R.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Linux Libertine";
  src: url("../fonts/linux-libertine/LinLibertine_RI.woff") format("woff");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Linux Libertine";
  src: url("../fonts/linux-libertine/LinLibertine_RB.woff") format("woff");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Linux Libertine";
  src: url("../fonts/linux-libertine/LinLibertine_RBI.woff") format("woff");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Linux Biolinum";
  src: url("../fonts/linux-biolinum/LinBiolinum_R.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Linux Biolinum";
  src: url("../fonts/linux-biolinum/LinBiolinum_RI.woff") format("woff");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Linux Biolinum";
  src: url("../fonts/linux-biolinum/LinBiolinum_RB.woff") format("woff");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Source Han Serif SC VF";
  src: url("../fonts/SourceHanSerifSC-VF.otf.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font-zh: "Source Han Serif SC VF", "SimSun", "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --font-body: "Linux Libertine", var(--font-zh);
  --font-heading: "Linux Biolinum", "SF Pro Display", "Helvetica Neue", var(--font-zh);
  --page: #f7f4ef;
  --paper: rgba(255, 252, 247, 0.7);
  --paper-solid: #fffaf3;
  --glass: rgba(255, 255, 255, 0.18);
  --glass-hover: rgba(255, 255, 255, 0.32);
  --glass-strong: rgba(255, 255, 255, 0.48);
  --glass-border: rgba(255, 255, 255, 0.42);
  --glass-border-hover: rgba(255, 255, 255, 0.72);
  --ink: #24231f;
  --muted: #68635b;
  --line: rgba(107, 96, 80, 0.2);
  --line-strong: rgba(93, 82, 65, 0.32);
  --accent: #7a5f46;
  --accent-cool: #506f68;
  --shadow: 0 24px 60px rgba(64, 53, 39, 0.14);
  --blur: 26px;
  --radius-xl: 32px;
  --radius-lg: 26px;
  --radius-md: 22px;
  --transition: all 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --page-background:
    linear-gradient(125deg, rgba(235, 228, 217, 0.5), rgba(218, 207, 193, 0.26) 34%, rgba(80, 111, 104, 0.12) 66%, rgba(122, 95, 70, 0.13)),
    linear-gradient(180deg, #ded3c3 0%, #cfc2ae 100%);
  --grid-line-vertical: rgba(255, 255, 255, 0.26);
  --grid-line-horizontal: rgba(255, 255, 255, 0.22);
  --layout-bg: rgba(255, 255, 255, 0.2);
  --layout-highlight:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.07) 48%, rgba(255, 255, 255, 0.01) 100%),
    rgba(255, 252, 246, 0.22);
  --layout-shadow:
    0 24px 60px rgba(64, 53, 39, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(255, 255, 255, 0.22);
  --layout-glow: inset 0 0 48px rgba(255, 255, 255, 0.34);
  --card-glass: rgba(114, 96, 72, 0.1);
  --card-glass-hover: rgba(114, 96, 72, 0.16);
  --card-highlight: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 52%);
  --shine: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  --hover-line: rgba(122, 95, 70, 0.55);
  --portrait-border: rgba(255, 255, 255, 0.74);
  --portrait-shadow:
    0 14px 28px rgba(61, 48, 34, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --control-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 5px 14px rgba(70, 56, 39, 0.07);
  --card-shadow:
    0 8px 18px rgba(59, 46, 31, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.64),
    inset 0 -1px 0 rgba(255, 255, 255, 0.14);
  --card-shadow-hover:
    0 14px 34px rgba(59, 46, 31, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2);
  --media-bg: rgba(255, 250, 242, 0.28);
  --media-shadow:
    0 8px 18px rgba(59, 46, 31, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.44);
  --badge-fg: #fffaf2;
  --badge-bg: rgba(63, 55, 45, 0.62);
  --badge-border: rgba(255, 255, 255, 0.24);
  --badge-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  --separator: rgba(104, 99, 91, 0.55);
  --toggle-bg: rgba(255, 252, 246, 0.42);
  --toggle-border: rgba(93, 82, 65, 0.24);
  --toggle-shadow:
    0 8px 22px rgba(72, 58, 40, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --toggle-thumb-bg: rgba(255, 250, 242, 0.72);
  --toggle-thumb-border: rgba(93, 82, 65, 0.18);
  --toggle-thumb-shadow:
    0 3px 10px rgba(72, 58, 40, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page: #26231f;
  --paper: rgba(38, 35, 31, 0.66);
  --paper-solid: #2d2924;
  --glass: rgba(250, 249, 245, 0.075);
  --glass-hover: rgba(250, 249, 245, 0.14);
  --glass-strong: rgba(250, 249, 245, 0.22);
  --glass-border: rgba(250, 249, 245, 0.18);
  --glass-border-hover: rgba(250, 249, 245, 0.34);
  --ink: #faf9f5;
  --muted: #c9c4b8;
  --line: rgba(250, 249, 245, 0.11);
  --line-strong: rgba(250, 249, 245, 0.2);
  --accent: #d97757;
  --accent-cool: #8fb7ad;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
  --page-background:
    linear-gradient(125deg, rgba(217, 119, 87, 0.16), rgba(47, 43, 37, 0.32) 34%, rgba(143, 183, 173, 0.13) 68%, rgba(250, 249, 245, 0.05)),
    linear-gradient(180deg, #302c27 0%, #25221f 48%, #342d26 100%);
  --grid-line-vertical: rgba(250, 249, 245, 0.08);
  --grid-line-horizontal: rgba(250, 249, 245, 0.06);
  --layout-bg: rgba(43, 39, 34, 0.52);
  --layout-highlight:
    linear-gradient(180deg, rgba(250, 249, 245, 0.11) 0%, rgba(250, 249, 245, 0.035) 50%, rgba(217, 119, 87, 0.045) 100%),
    rgba(43, 39, 34, 0.28);
  --layout-shadow:
    0 28px 70px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(250, 249, 245, 0.22),
    inset 0 -1px 0 rgba(250, 249, 245, 0.08);
  --layout-glow: inset 0 0 54px rgba(250, 249, 245, 0.08);
  --card-glass: rgba(250, 249, 245, 0.14);
  --card-glass-hover: rgba(250, 249, 245, 0.23);
  --card-highlight: linear-gradient(180deg, rgba(250, 249, 245, 0.095) 0%, transparent 56%);
  --shine: linear-gradient(90deg, transparent, rgba(250, 249, 245, 0.2), transparent);
  --hover-line: rgba(217, 119, 87, 0.65);
  --portrait-border: rgba(250, 249, 245, 0.28);
  --portrait-shadow:
    0 18px 40px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(250, 249, 245, 0.18);
  --control-shadow:
    inset 0 1px 0 rgba(250, 249, 245, 0.2),
    0 8px 20px rgba(0, 0, 0, 0.16);
  --card-shadow:
    0 10px 26px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(250, 249, 245, 0.18),
    inset 0 -1px 0 rgba(250, 249, 245, 0.06);
  --card-shadow-hover:
    0 16px 38px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(250, 249, 245, 0.24),
    inset 0 -1px 0 rgba(250, 249, 245, 0.08);
  --media-bg: rgba(250, 249, 245, 0.06);
  --media-shadow:
    0 10px 24px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(250, 249, 245, 0.12);
  --badge-fg: #faf9f5;
  --badge-bg: rgba(217, 119, 87, 0.28);
  --badge-border: rgba(250, 249, 245, 0.18);
  --badge-shadow: inset 0 1px 0 rgba(250, 249, 245, 0.16);
  --separator: rgba(201, 196, 184, 0.55);
  --toggle-bg: var(--glass);
  --toggle-border: var(--glass-border);
  --toggle-shadow: var(--control-shadow);
  --toggle-thumb-bg: var(--glass-hover);
  --toggle-thumb-border: var(--glass-border-hover);
  --toggle-thumb-shadow: var(--control-shadow);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-background);
}

body {
  min-height: 100%;
  margin: 0;
  padding: 30px 0;
  color: var(--ink);
  background: transparent;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.45;
  text-align: left;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line-vertical) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-horizontal) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

#layout-content {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 42px 50px 40px;
  overflow: hidden;
  background: var(--layout-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--layout-shadow);
  backdrop-filter: blur(var(--blur)) saturate(1.55);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.55);
}

#layout-content::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: calc(var(--radius-xl) - 2px);
  background: var(--layout-highlight);
  box-shadow: var(--layout-glow);
}

a,
a > tt {
  color: var(--accent-cool);
  text-decoration: none;
}

a:hover {
  color: var(--accent);
  border-bottom: 1px dotted var(--hover-line);
}

#layout-content,
.link-row a,
.experience-item,
.paper-box,
.paper-image-wrapper,
.badge {
  position: relative;
}

.link-row a,
.experience-item,
.paper-box {
  overflow: hidden;
  transition: var(--transition);
}

.link-row a::before,
.experience-item::before,
.paper-box::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--card-highlight);
  border-radius: inherit;
}

.link-row a::after,
.experience-item::after,
.paper-box::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: var(--shine);
  transition: left 0.62s ease;
}

.link-row a:hover::after,
.experience-item:hover::after,
.paper-box:hover::after {
  left: 120%;
}

img {
  border: none;
  max-width: 100%;
}

p {
  margin-top: 0;
  margin-bottom: 0.72em;
  padding: 0;
}

strong,
b {
  font-weight: 700;
}

.profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 30px;
  align-items: start;
  margin-bottom: 26px;
}

#toptitle {
  margin-bottom: 1.25em;
  padding-bottom: 0.2em;
}

#toptitle h1 {
  margin: 0;
  padding: 0;
  border-bottom: none;
  color: var(--ink);
  font-size: 1.78rem;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.12;
}

#toptitle h1 span {
  color: var(--muted);
  font-weight: 400;
}

.zh-name-group {
  display: inline-flex;
  align-items: baseline;
  margin-left: 0.2em;
}

.zh-name,
:lang(zh-CN) {
  font-family: var(--font-zh) !important;
  font-synthesis-weight: auto;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.name-paren {
  color: var(--muted);
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 400;
}

.zh-name {
  font-size: 1.4rem;
  margin: 0 0.12em;
  -webkit-text-stroke: 0.25px currentColor;
}

.portrait {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border: 1px solid var(--portrait-border);
  border-radius: 50%;
  box-shadow: var(--portrait-shadow);
}

.theme-toggle {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 74px;
  height: 34px;
  padding: 3px;
  color: var(--ink);
  background: var(--toggle-bg);
  border: 1px solid var(--toggle-border);
  border-radius: 999px;
  box-shadow: var(--toggle-shadow);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  line-height: 1;
  transform: translateX(-50%);
  transition: var(--transition);
}

.theme-toggle-thumb {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--toggle-thumb-bg);
  border: 1px solid var(--toggle-thumb-border);
  box-shadow: var(--toggle-thumb-shadow);
  transform: translateY(-50%);
  transition: var(--transition);
}

html[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(40px) translateY(-50%);
}

.theme-toggle-option {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--muted);
  transition: var(--transition);
}

.theme-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-moon {
  transform: translate(2.0px, -0.6px);
}

.theme-toggle-option:first-of-type {
  color: var(--ink);
}

html[data-theme="dark"] .theme-toggle-option:first-of-type {
  color: var(--muted);
}

html[data-theme="dark"] .theme-toggle-option:last-of-type {
  color: var(--ink);
}

.theme-toggle:hover {
  color: var(--accent);
  background: var(--glass-hover);
  border-color: var(--glass-border-hover);
  transform: translateX(-50%) translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 0.95em;
}

.link-row a {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  color: var(--ink);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  box-shadow: var(--control-shadow);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  font-size: 0.88rem;
  font-family: var(--font-heading);
}

.link-row a:hover {
  color: var(--accent-cool);
  background: var(--glass-hover);
  border: 1px solid var(--glass-border-hover);
  transform: translateY(-1px) scale(1.02);
  text-decoration: none;
}

section {
  margin-top: 18px;
}

h1,
h2,
h3 {
  color: var(--ink);
  margin-top: 0.7em;
  margin-bottom: 0.55em;
  padding-top: 0.48em;
  padding-bottom: 0.24em;
  line-height: 1.1;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--font-heading);
}

h2 {
  font-size: 1.18rem;
  font-weight: 700;
}

h3 {
  border-bottom: none;
  font-size: 1.02rem;
}

.about-text {
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 0.48em;
}

.experience-list {
  display: grid;
  gap: 12px;
}

.experience-item {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 14px 16px;
  background: var(--card-glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(22px) saturate(1.55);
  -webkit-backdrop-filter: blur(22px) saturate(1.55);
}

.experience-item:hover {
  background: var(--card-glass-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

.experience-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 86px;
}

.experience-logo img {
  width: auto;
  max-height: 82px;
  object-fit: contain;
  filter: saturate(0.95);
}

.experience-text p {
  margin-bottom: 0.34em;
  color: var(--muted);
}

.experience-text p:first-child {
  color: var(--ink);
}

.paper-box {
  display: flex;
  flex-direction: row;
  gap: 22px;
  align-items: center;
  margin: 0.9em 0;
  padding: 14px;
  background: var(--card-glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(22px) saturate(1.55);
  -webkit-backdrop-filter: blur(22px) saturate(1.55);
}

.paper-box:hover {
  background: var(--card-glass-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

.paper-box-image {
  flex: 0 0 38%;
  max-width: 38%;
}

.paper-image-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
  background: var(--media-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--media-shadow);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
}

.paper-image-wrapper img,
.paper-video {
  display: block;
  width: 100%;
  height: auto;
}

.paper-video {
  background: var(--media-bg);
}

.paper-box-text {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.paper-title {
  margin-bottom: 0.42em;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
}

.paper-authors {
  margin-bottom: 0.48em;
  line-height: 1.5;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.paper-links span {
  color: var(--separator);
}

.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  padding: 3px 8px;
  color: var(--badge-fg);
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  border-radius: 999px;
  box-shadow: var(--badge-shadow);
  backdrop-filter: blur(12px) saturate(1.35);
  -webkit-backdrop-filter: blur(12px) saturate(1.35);
  font-size: 0.72rem;
  font-family: var(--font-heading);
  font-weight: 700;
}

ul,
ol {
  margin-top: 0.2em;
  margin-bottom: 0.8em;
  padding-left: 1.3em;
}

ul {
  list-style-type: square;
}

li {
  margin-top: 0.65em;
  color: var(--muted);
}

li p {
  margin-bottom: 0.25em;
}

@media (max-width: 760px) {
  body {
    padding: 14px 0;
  }

  #layout-content {
    width: calc(100% - 20px);
    padding: 26px 22px 30px;
  }

  .profile {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 28px;
  }

  .theme-toggle {
    top: 12px;
  }

  .portrait {
    width: 112px;
    height: 112px;
  }

  .experience-item,
  .paper-box {
    grid-template-columns: 1fr;
    display: grid;
  }

  .experience-logo {
    justify-content: flex-start;
    min-height: 58px;
  }

  .experience-logo img {
    max-height: 58px;
  }

  .paper-box-image {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
