/* =========================================================
   高颢嘉 · 个人网站
   设计延续 NotionNext proxio 主题：全屏首图、留白、细边框、黑白主色
   ========================================================= */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --surface: #ffffff;
  --ink: #0e1014;
  --text: #2a2f37;
  --muted: #637381;
  --faint: #98a2b3;
  --line: #e7e9ed;
  --chip-bg: #f2f4f6;
  --accent: #1a8bb3;
  --accent-soft: rgba(26, 139, 179, 0.1);
  --veil: rgba(243, 244, 246, 0.7);
  --header-bg: rgba(255, 255, 255, 0.74);
  --shadow-md: 0 12px 32px -14px rgba(16, 24, 40, 0.2);
  --shadow-lg: 0 28px 64px -24px rgba(16, 24, 40, 0.28);

  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Noto Sans SC', 'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Songti SC', serif;
  --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --container: 1140px;
  --header-h: 72px;

  color-scheme: light;
}

/* 深色：显式选择优先，未加载 JS 时跟随系统 */
:root[data-theme='dark'] {
  --bg: #000000;
  --bg-soft: #0a0a0b;
  --surface: #0f0f10;
  --ink: #f4f5f7;
  --text: #d5d8dd;
  --muted: #9aa1ad;
  --faint: #6b7280;
  --line: #242629;
  --chip-bg: #161719;
  --accent: #5ec4e4;
  --accent-soft: rgba(94, 196, 228, 0.12);
  --veil: rgba(18, 18, 20, 0.7);
  --header-bg: rgba(8, 8, 9, 0.72);
  --shadow-md: 0 12px 32px -14px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 28px 64px -24px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #000000;
    --bg-soft: #0a0a0b;
    --surface: #0f0f10;
    --ink: #f4f5f7;
    --text: #d5d8dd;
    --muted: #9aa1ad;
    --faint: #6b7280;
    --line: #242629;
    --chip-bg: #161719;
    --accent: #5ec4e4;
    --accent-soft: rgba(94, 196, 228, 0.12);
    --veil: rgba(18, 18, 20, 0.7);
    --header-bg: rgba(8, 8, 9, 0.72);
    --shadow-md: 0 12px 32px -14px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 28px 64px -24px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}

/* ---------- 基础 ---------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s, color 0.3s;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

::selection {
  background: var(--accent);
  color: #fff;
}

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

.container {
  width: 100%;
  max-width: calc(var(--container) + 40px);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 100;
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-160%);
  transition: transform 0.2s;
}

.skip-link:focus {
  transform: none;
}

/* Lenis 平滑滚动 */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis-stopped {
  overflow: hidden;
}

html.show-welcome {
  overflow: hidden;
}

/* 成对切换的图标 */
.when-light,
.when-closed {
  display: inline-flex;
}

.when-dark,
.when-open,
.when-done {
  display: none !important;
}

[data-theme='dark'] .when-light,
.menu-open .when-closed,
.is-done .when-idle {
  display: none !important;
}

[data-theme='dark'] .when-dark,
.menu-open .when-open,
.is-done .when-done {
  display: inline-flex !important;
}

html:not(.js) [data-theme-toggle] {
  display: none;
}

/* ---------- 通用组件 ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.8;
  letter-spacing: 0.02em;
}

.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.section {
  padding: clamp(80px, 11vw, 128px) 0;
}

.section--tight {
  padding-top: 16px;
}

.section-soft {
  background: var(--bg-soft);
}

.section-head {
  max-width: 600px;
  margin: 0 auto clamp(40px, 6vw, 60px);
  text-align: center;
}

.section-head--left {
  margin-left: 0;
  text-align: left;
}

.section-title {
  margin: 18px 0 0;
  color: var(--ink);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: 16px;
  font-size: 15.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, background-color 0.25s, color 0.25s, border-color 0.25s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-solid {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  height: 46px;
  padding: 0 22px;
  border-color: var(--ink);
  border-radius: 999px;
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--ink);
  color: var(--bg);
}

.btn .icon,
.link-arrow .icon {
  transition: transform 0.3s var(--ease);
}

.btn-outline:hover .icon,
.link-arrow:hover .icon {
  transform: translateX(4px);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 500;
}

.link-arrow:hover {
  color: var(--accent);
}

.chip {
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s, transform 0.3s var(--ease);
}

.social a:hover {
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(-2px);
}

/* ---------- 顶部导航 ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  color: #fff;
  transition: color 0.35s, background-color 0.35s, box-shadow 0.35s, transform 0.5s var(--ease);
}

.site-header.is-solid,
.site-header.is-scrolled,
.site-header.menu-open {
  background: var(--header-bg);
  color: var(--ink);
  box-shadow: inset 0 -1px 0 var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
}

.site-header.is-hidden {
  transform: translateY(-100%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.brand img {
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.nav {
  margin-left: auto;
}

.nav ul,
.mobile-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav ul {
  display: flex;
  gap: 2px;
}

.nav a {
  display: block;
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 15px;
  opacity: 0.88;
  transition: opacity 0.2s, background-color 0.2s;
}

.nav a:hover,
.icon-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.16);
}

.is-solid .nav a:hover,
.is-scrolled .nav a:hover,
.is-solid .icon-btn:hover,
.is-scrolled .icon-btn:hover,
.menu-open .icon-btn:hover {
  background: var(--chip-bg);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.2s;
}

.lang-switch {
  width: auto;
  min-width: 40px;
  padding: 0 10px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.menu-toggle,
.mobile-nav {
  display: none;
}

@media (max-width: 760px) {
  .nav {
    display: none;
  }

  .menu-toggle {
    display: grid;
  }

  .mobile-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 12px;
    right: 12px;
    display: block;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top right;
    transition: opacity 0.25s, transform 0.3s var(--ease), visibility 0.3s;
  }

  .menu-open .mobile-nav {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .mobile-nav a {
    display: block;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 16px;
  }

  .mobile-nav a:hover {
    background: var(--chip-bg);
  }

  html:not(.js) .nav {
    display: block;
  }

  html:not(.js) .menu-toggle {
    display: none;
  }
}

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  isolation: isolate;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  background: #121212;
}

.hero-media {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 62%;
  animation: hero-zoom 2.6s var(--ease) both;
}

.show-welcome .hero-media img {
  animation-play-state: paused;
}

@keyframes hero-zoom {
  from {
    transform: scale(1.1);
  }
  to {
    transform: scale(1);
  }
}

.hero-shade-top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  height: 180px;
  background: linear-gradient(rgba(0, 0, 0, 0.34), transparent);
}

.hero-shade {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  height: 70%;
  background: linear-gradient(to bottom, transparent, var(--bg));
  background: linear-gradient(
    to bottom,
    transparent 0%,
    color-mix(in srgb, var(--bg) 40%, transparent) 38%,
    color-mix(in srgb, var(--bg) 88%, transparent) 72%,
    var(--bg) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  padding-bottom: clamp(28px, 6vh, 64px);
  color: var(--ink);
  text-align: center;
}

.hero-title {
  margin: 0 0 14px;
  font-size: clamp(36px, 6.4vw, 68px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.06em;
}

.hero-subtitle {
  margin: 0 0 34px;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: clamp(17px, 2.1vw, 22px);
  font-style: italic;
  letter-spacing: 0.01em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: clamp(28px, 5vh, 48px);
}

.scroll-hint {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.14em;
  transition: color 0.2s;
}

.scroll-hint:hover {
  color: var(--ink);
}

.scroll-hint .icon {
  animation: nudge 1.8s ease-in-out infinite;
}

@keyframes nudge {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  50% {
    transform: translateY(5px);
    opacity: 1;
  }
}

/* 副标题是中文时（英文版首页），不用斜体衬线 */
.hero-subtitle:lang(zh) {
  font-family: var(--font);
  font-style: normal;
  letter-spacing: 0.2em;
}

@media (max-width: 760px) {
  .hero-media img {
    object-position: 80% 50%;
  }

  .hero-actions {
    width: 100%;
    max-width: 360px;
    flex-direction: column;
  }
}

/* ---------- 论文卡片 ---------- */

.paper-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px 32px;
}

.paper-cover {
  position: relative;
  isolation: isolate;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  transform: translateZ(0);
}

.paper-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
}

/* 封面多为论文的 pipeline 图（白底宽图）：完整显示，不裁切。
   静止时被遮罩压淡、作为简介的底纹；悬停时遮罩和简介淡出，露出清晰的整张图 */
img.paper-art {
  padding: 5% 6%;
  background: #fff;
  object-fit: contain;
}

.paper-veil {
  position: absolute;
  inset: 0;
  background: var(--veil);
  transition: background-color 0.5s var(--ease);
}

.paper-summary {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px clamp(24px, 5%, 48px);
  text-align: center;
}

.paper-summary p {
  display: -webkit-box;
  max-width: 420px;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  color: var(--text);
  text-shadow: 0 0 10px var(--bg), 0 0 18px var(--bg);
  font-size: clamp(15.5px, 1.6vw, 18.5px);
  font-weight: 600;
  line-height: 1.7;
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}

.paper-cta {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(14, 16, 20, 0.82);
  color: #fff;
  font-size: 13.5px;
  opacity: 0;
  transform: translateY(8px);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.paper-card:hover .paper-veil,
.paper-card:focus-within .paper-veil {
  background: transparent;
}

.paper-card:hover .paper-art,
.paper-card:focus-within .paper-art {
  transform: scale(1.03);
}

.paper-card:hover .paper-summary p,
.paper-card:focus-within .paper-summary p {
  opacity: 0;
  transform: translateY(-8px);
}

.paper-card:hover .paper-cta,
.paper-card:focus-within .paper-cta {
  opacity: 1;
  transform: none;
}

/* 触屏设备没有悬停：直接显示清晰的图，下方已有标题，不再叠简介 */
@media (hover: none) {
  .paper-veil,
  .paper-summary p {
    display: none;
  }

  .paper-cta {
    opacity: 1;
    transform: none;
  }
}

.paper-body {
  padding: 20px 4px 0;
}

.paper-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 10px;
  color: var(--faint);
  font-size: 13px;
}

.paper-meta time {
  font-variant-numeric: tabular-nums;
}

.paper-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(18px, 1.8vw, 21px);
  font-weight: 600;
  line-height: 1.5;
}

.paper-title a,
.pub-title a {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.45s var(--ease), color 0.2s;
}

.paper-title a:hover,
.pub-title a:hover {
  background-size: 100% 1px;
}

.section-more {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

@media (max-width: 760px) {
  .paper-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .paper-summary {
    gap: 14px;
    padding: 20px 24px;
  }

  .paper-summary p {
    font-size: 15px;
    -webkit-line-clamp: 4;
  }
}

/* ---------- 关于我 ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(40px, 6vw, 72px);
}

.about-photo {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 4 / 5;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--bg-soft);
  box-shadow: var(--shadow-lg);
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  transition: transform 1.4s var(--ease);
}

.about-photo:hover img {
  transform: scale(1.03);
}

.photo-chip {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 32px);
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(14, 16, 20, 0.42);
  color: #fff;
  font-size: 13px;
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
}

.about-title {
  margin: 18px 0 16px;
  color: var(--ink);
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 600;
  line-height: 1.3;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.85;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 36px 0 0;
  border-top: 1px solid var(--line);
}

.stat {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.stat:nth-child(odd) {
  padding-right: 24px;
  border-right: 1px solid var(--line);
}

.stat:nth-child(even) {
  padding-left: 24px;
}

.stat dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 14px;
}

.stat dd {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 0;
  color: var(--ink);
}

.stat-value {
  font-size: clamp(34px, 4vw, 46px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

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

.about-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
}

@media (max-width: 860px) {
  .about-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .about-photo {
    max-width: 260px;
    margin: 0 auto;
  }
}

/* ---------- 关键词滚动 ---------- */

.marquee-section {
  padding: 0 0 clamp(64px, 9vw, 112px);
}

.marquee {
  overflow: hidden;
  padding: 18px 0;
  border: 1px solid var(--line);
  border-radius: 20px;
}

.marquee-mask {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 40s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-group {
  display: flex;
  flex-shrink: 0;
  align-items: center;
}

.marquee-item {
  padding: 0 30px;
  color: var(--text);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.marquee-sep {
  color: var(--accent);
  font-size: 13px;
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- 经历 ---------- */

.career-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.career-item {
  position: relative;
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) minmax(0, 1.3fr);
  align-items: baseline;
  gap: 8px 36px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.career-item::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 0;
  height: 1px;
  background: var(--ink);
  transition: width 0.7s var(--ease);
}

.career-item:hover::before {
  width: 100%;
}

.career-when {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 13.5px;
  letter-spacing: 0.02em;
  transition: color 0.3s;
}

.career-item:hover .career-when {
  color: var(--accent);
}

.career-title {
  margin: 0;
  color: var(--ink);
  font-size: 18.5px;
  font-weight: 600;
  line-height: 1.5;
}

.career-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.85;
}

@media (max-width: 860px) {
  .career-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 24px 0;
  }
}

/* ---------- 页脚 ---------- */

.site-footer {
  padding: clamp(88px, 11vw, 136px) 0 28px;
}

.footer-cta {
  max-width: 760px;
}

.footer-slogan {
  margin: 22px 0 14px;
  color: var(--ink);
  font-size: clamp(34px, 5.6vw, 60px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.04em;
}

.footer-text {
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 16.5px;
}

.footer-email {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid currentColor;
  color: var(--ink);
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 600;
  word-break: break-all;
  transition: color 0.25s;
}

.footer-email .icon {
  flex-shrink: 0;
  transition: transform 0.35s var(--ease);
}

.footer-email:hover {
  color: var(--accent);
}

.footer-email:hover .icon {
  transform: translate(3px, -3px);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: clamp(72px, 10vw, 120px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand img {
  border-radius: 50%;
}

.footer-social a {
  width: 36px;
  height: 36px;
  border-color: transparent;
}

.footer-beian {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.footer-beian a:hover {
  color: var(--ink);
}

/* ---------- 浮动元素 ---------- */

.to-top {
  position: fixed;
  right: 24px;
  bottom: 28px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), background-color 0.2s, color 0.2s;
}

.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.to-top:hover {
  background: var(--ink);
  color: var(--bg);
}

@media (max-width: 760px) {
  .to-top {
    right: 16px;
    bottom: 16px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }
}

.cursor-dot {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10000;
  width: 12px;
  height: 12px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  opacity: 0;
  transition: width 0.25s var(--ease), height 0.25s var(--ease), background-color 0.25s, border-color 0.25s,
    opacity 0.3s;
}

.cursor-dot.is-active {
  opacity: 1;
}

.cursor-dot.is-hover {
  width: 56px;
  height: 56px;
  border-color: rgba(167, 167, 167, 0.3);
  background: hsla(0, 0%, 100%, 0.04);
  mix-blend-mode: normal;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* 首次进入欢迎遮罩 */
.welcome {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(120deg, #1a1a1a, #4d4d4d, #e6e6e6);
  background-size: 300% 300%;
  cursor: pointer;
  animation: gradient-shift 6s ease infinite;
  transition: opacity 0.65s ease;
}

.show-welcome .welcome {
  display: flex;
}

.welcome.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.welcome:focus-visible {
  outline: none;
}

.welcome-text {
  margin: 0;
  color: #fff;
  font-size: clamp(22px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.9), 0 0 30px rgba(255, 255, 255, 0.6);
  user-select: none;
  animation: text-pulse 3s ease-in-out infinite, welcome-in 1.5s ease-out both;
}

.ripple {
  position: fixed;
  z-index: 10001;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(rgba(255, 255, 255, 0.6) 0%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  animation: ripple 1s ease-out forwards;
}

@keyframes gradient-shift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes text-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
    text-shadow: 0 0 25px #fff, 0 0 40px rgba(255, 255, 255, 0.8);
  }
}

@keyframes welcome-in {
  from {
    opacity: 0;
    translate: 0 40px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes ripple {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(40);
  }
}

/* ---------- 论文列表页 ---------- */

.page-hero {
  padding: calc(var(--header-h) + clamp(56px, 9vw, 104px)) 0 clamp(36px, 5vw, 56px);
  background: radial-gradient(120% 90% at 85% 0%, var(--accent-soft), transparent 60%);
}

.page-title {
  margin: 18px 0 12px;
  color: var(--ink);
  font-size: clamp(34px, 5.4vw, 54px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.page-lead {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 22px 0 0;
  color: var(--faint);
  font-size: 14.5px;
}

.pub-group {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 32px;
}

.pub-group + .pub-group {
  margin-top: 40px;
}

.pub-year {
  position: sticky;
  top: calc(var(--header-h) + 28px);
  align-self: start;
  margin: 0;
  padding-top: 26px;
  color: var(--ink);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.pub-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pub {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 28px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.pub-art {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

/* 列表页缩略图完整显示整张配图 */
.pub-art img.paper-art {
  padding: 8px;
  object-fit: contain;
}

.pub-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.5;
}

.pub:target .pub-title {
  color: var(--accent);
}

.pub-authors {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.7;
}

.pub-authors strong {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.pub-venue {
  margin: 0 0 12px;
  color: var(--faint);
  font-family: var(--font-serif);
  font-size: 15px;
  font-style: italic;
}

.pub-summary {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.8;
}

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

.btn-sm,
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.btn-sm {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13.5px;
}

.btn-sm:hover,
.copy-btn:hover {
  border-color: var(--ink);
}

.btn-sm .icon {
  transition: transform 0.3s var(--ease);
}

.btn-sm[aria-expanded='true'] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.btn-sm[aria-expanded='true'] .icon {
  transform: rotate(180deg);
}

.pub-panel {
  margin-top: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.85;
}

.js .pub-panel:not(.is-open) {
  display: none;
}

.pub-panel.is-open {
  animation: panel-in 0.35s var(--ease);
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.pub-panel p {
  margin: 0;
}

.pub-panel--code {
  position: relative;
  padding: 0;
}

.pub-panel pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12.5px;
}

.when-idle,
.when-done {
  align-items: center;
  gap: 4px;
}

.when-idle {
  display: inline-flex;
}

html:not(.js) .copy-btn {
  display: none;
}

@media (max-width: 860px) {
  .pub-group {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .pub-year {
    position: static;
    padding: 0 0 12px;
    font-size: 26px;
  }

  .pub {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .pub-art {
    display: none;
  }
}

/* ---------- 404 ---------- */

.not-found {
  display: flex;
  align-items: center;
  min-height: 92vh;
  padding: calc(var(--header-h) + 48px) 0 48px;
  text-align: center;
}

.not-found .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.not-found-code {
  margin: 0;
  color: var(--ink);
  font-size: clamp(120px, 24vw, 240px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .not-found-code {
    background: url('../img/hero-1440.webp') 50% 55% / cover;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.not-found-title {
  margin: 20px 0 10px;
  color: var(--ink);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
}

.not-found-text {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
}

.not-found-title--alt {
  margin-top: 28px;
  font-size: clamp(18px, 2.2vw, 21px);
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 36px;
}

/* ---------- 英文版排版 ---------- */

:lang(en) .hero-title,
:lang(en) .footer-slogan {
  letter-spacing: -0.015em;
}

:lang(en) .hero-title {
  max-width: 15em;
  font-size: clamp(34px, 5.6vw, 64px);
}

:lang(en) .footer-slogan {
  font-size: clamp(30px, 4.8vw, 52px);
}

:lang(en) .section-title,
:lang(en) .page-title,
:lang(en) .about-title {
  letter-spacing: -0.01em;
}

:lang(en) .eyebrow,
:lang(en) .brand {
  letter-spacing: 0.01em;
}

:lang(en) .stat dt {
  font-size: 13.5px;
}

:lang(en) .scroll-hint {
  letter-spacing: 0.06em;
}

/* 标题换行更均衡，段落避免孤字 */
.hero-title,
.section-title,
.about-title,
.page-title,
.footer-slogan,
.not-found-title {
  text-wrap: balance;
}

.lead,
.career-text,
.pub-summary,
.footer-text,
.paper-summary p {
  text-wrap: pretty;
}

/* ---------- 进入动画 ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease) var(--d, 0ms), transform 0.9s var(--ease) var(--d, 0ms);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

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

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .marquee-track {
    animation: none;
  }

  .marquee {
    overflow-x: auto;
  }
}
