/* 尹梓源个人网站 · 参考学术个人主页简洁布局 */

:root {
  --color-bg: #fafafa;
  --color-text: #1a1a1a;
  --color-muted: #555;
  --color-link: #2563eb;
  --color-link-hover: #1d4ed8;
  --color-border: #e5e5e5;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --space: 1.25rem;
  --max-width: 720px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  position: relative;
  min-height: 100vh;
}

/* 动态背景：渐变 + 浮动光斑 */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf4 25%, #f0f2f8 50%, #e4e8f0 75%, #f5f7fa 100%);
  background-size: 400% 400%;
  animation: bg-gradient-shift 18s ease infinite;
}

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

.bg-shapes {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  animation: bg-float 25s ease-in-out infinite;
}

.bg-shape-1 {
  width: 320px;
  height: 320px;
  background: linear-gradient(135deg, #a5b8e0, #c5d4f0);
  top: -10%;
  left: -5%;
  animation-delay: 0s;
}

.bg-shape-2 {
  width: 280px;
  height: 280px;
  background: linear-gradient(135deg, #c5d0e8, #e0e6f2);
  bottom: 10%;
  right: -8%;
  animation-delay: -8s;
}

.bg-shape-3 {
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, #b8c8e8, #d8e0f0);
  top: 50%;
  left: 60%;
  animation-delay: -15s;
}

@keyframes bg-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(20px, -30px) scale(1.05); }
  50% { transform: translate(-15px, 20px) scale(0.95); }
  75% { transform: translate(10px, 15px) scale(1.02); }
}

/* 内容层：保证在背景之上、可点击 */
.site-wrap {
  position: relative;
  z-index: 0;
}

/* ========== 竖版（手机，默认）：单列从上到下 ========== */
.page-layout {
  display: block;
}

.sidebar .nav-sidebar {
  display: none;
}

.sidebar .lang-switcher-sidebar {
  display: none;
}

/* 头部导航 — 手机横条 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 250, 250, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  padding: var(--space) 1rem;
}

.site-header .nav {
  max-width: none;
  margin: 0;
  padding: 0;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  font-weight: 400;
}

.lang-sep {
  color: rgba(0, 0, 0, 0.2);
  user-select: none;
}

.lang-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
  font-weight: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  opacity: 0.7;
}

.lang-btn:hover {
  opacity: 1;
}

.lang-btn.active {
  opacity: 1;
  font-weight: 400;
}

.lang-switcher-sidebar {
  margin-bottom: 1rem;
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space) 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  justify-content: center;
}

.nav a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--color-link);
}

/* 主内容 */
.content-column {
  max-width: var(--max-width);
  margin: 0 auto;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* ========== 横版（电脑 或 手机横屏）：左侧栏 + 右侧正文 ========== */
@media (min-width: 900px), ((orientation: landscape) and (min-width: 500px)) {
  .site-header {
    display: none;
  }

  .page-layout {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    max-width: none;
  }

  .sidebar {
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 2rem 1.5rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .sidebar .hero {
    padding: 0 0 1.5rem;
  }

  .sidebar .follow {
    flex-direction: column;
    gap: 0.5rem;
  }

  .sidebar .follow-sep {
    display: none;
  }

  .sidebar .lang-switcher-sidebar {
    display: inline-flex;
  }

  .sidebar .nav-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
  }

  .sidebar .nav-sidebar a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.35rem 0;
  }

  .sidebar .nav-sidebar a:hover {
    color: var(--color-link);
  }

  .content-column {
    flex: 1;
    margin: 0;
    max-width: none;
    min-width: 0;
    overflow-y: auto;
  }

  main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
  }

  .site-footer {
    max-width: var(--max-width);
    margin: 0 auto;
  }
}

/* 首屏：头像 + 姓名 + 一行身份 + Follow */
.hero {
  text-align: center;
  padding: 3rem 0 3.5rem;
}

.hero-avatar {
  display: block;
  width: 160px;
  height: 160px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
}

.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--color-muted);
  margin: 0 0 0.5rem;
}

.tagline {
  font-size: 0.95rem;
  color: var(--color-muted);
  margin: 0 0 1rem;
}

.follow {
  font-size: 0.9rem;
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 0.5rem;
}

.follow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-link);
  text-decoration: none;
}

.follow-link:hover {
  text-decoration: underline;
}

.follow-link i,
.follow-link .icon-scholar {
  font-size: 1.1em;
  opacity: 0.9;
}

.follow-link .icon-scholar {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.15em;
}

.follow-sep {
  color: var(--color-border);
  user-select: none;
}

/* 区块 */
.section {
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);
}

.section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--color-text);
}

.section .content {
  color: var(--color-text);
}

.section .content p {
  margin: 0 0 1rem;
}

.section .content p:last-child {
  margin-bottom: 0;
}

.section .content a {
  color: var(--color-link);
  text-decoration: none;
}

.section .content a:hover {
  text-decoration: underline;
}

/* News 列表 */
.news-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--color-text);
}

.news-list li {
  margin-bottom: 0.75rem;
}

.news-list li:last-child {
  margin-bottom: 0;
}

.news-list a {
  color: var(--color-link);
  text-decoration: none;
}

.news-list a:hover {
  text-decoration: underline;
}

/* Research 列表 */
.research-list {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
  color: var(--color-text);
}

.research-list li {
  margin-bottom: 0.75rem;
}

.research-list li:last-child {
  margin-bottom: 0;
}

/* Publications 列表 */
.pub-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  color: var(--color-text);
}

.pub-list li {
  margin-bottom: 1.25rem;
  padding-left: 0;
}

.pub-list li:last-child {
  margin-bottom: 0;
}

.pub-list a {
  color: var(--color-link);
  text-decoration: none;
}

.pub-list a:hover {
  text-decoration: underline;
}

/* 页脚 */
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space) 1rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.site-footer p {
  margin: 0;
}

.site-footer .footer-name-cn {
  font-size: 0.8em;
  margin-top: 0.25rem;
  color: var(--color-muted);
}

@media (max-width: 480px) {
  .nav {
    justify-content: flex-start;
  }

  .hero {
    padding: 2rem 0 2.5rem;
  }
}
