/* ========== 字体与全局变量 ========== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  /* 字体系统 */
  /*--font-sans: 'Inter', 'Roboto', 'Segoe UI', sans-serif;*/
  /*--font-serif: 'Playfair Display', serif;*/
  /*--font-mono: 'Fira Code', 'Courier New', monospace;*/
  /*--font-brand: 'Playfair Display', serif;*/

  /*!* 默认字体 *!*/
  /*--font-display: var(--font-sans);*/
  /*--font-body: var(--font-sans);*/
  /*--font-heading: var(--font-serif);*/
  /*--font-markdown-code: "Fira Code", monospace;*/
  /*--font-markdonw-body:"Inter", "Noto Sans SC", system-ui, sans-serif;*/

  /* === 字体系统 === */
  --font-serif: 'Playfair Display', 'Noto Serif SC', Georgia, serif;
  --font-sans: 'Inter', 'Noto Sans SC', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Fira Code', 'JetBrains Mono', 'Courier New', monospace;

  /* === 默认使用衬线为主 === */
  --font-display: var(--font-serif);
  --font-body: var(--font-serif);
  --font-heading: var(--font-serif);
  --font-markdown-body: var(--font-serif);
  --font-markdown-code: var(--font-mono);

  /* === 品牌字体 === */
  --font-brand: 'Playfair Display', var(--font-serif);


  /* 浅色模式 */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: rgba(38, 45, 55, 0.6);
  --text-tertiary: #64748b;
  --border-color: #e2e8f0;
  --card-bg: #ffffff;

  --mask-bg: rgba(255, 255, 255, 0.7);
  --mask-bg2: rgba(255, 255, 255, 0.94);

  /* 主色调 */
  --primary-color: #5377da;
  --primary-hover: #1d4ed8;
  --secondary-color: #8b5cf6;
  --secondary-hover: #7c3aed;
  --accent-1: #3b82f6;
  --accent-2: #9068ff;

  --shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* 浅色模式Modal */
  --nav-primary: linear-gradient(to bottom, rgba(255,255,255,0.9), rgba(255,255,255,0.78));
  --modal-bg: rgba(255, 255, 255, 0.84);
  --border-bottom: 1px solid rgba(200, 200, 200, 0.3);
}

.dark {
  --bg-primary: #000000;
  --bg-secondary: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.16);
  --card-bg: rgba(43, 43, 43, 0.26);

  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --secondary-color: #a78bfa;
  --secondary-hover: #8b5cf6;
  --accent-1: #2c60d3;
  --accent-2: #6f2eff;

  --shadow: 0 10px 25px -5px rgba(0,0,0,0.3);

  --mask-bg: rgba(0, 0, 0, 0.7);
  --mask-bg2: rgba(0, 0, 0, 0.89);

    /* 浅色模式Modal */
  --nav-primary: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), rgba(18, 18, 18, 0.7));
  --border-bottom: 1px solid rgba(71, 85, 105, 0.4);
  --modal-bg: rgba(0, 0, 0, 0.7);
}

/* ========== 通用工具类 ========== */
.hidden {
  display: none !important;
}

/* ========== 全局样式 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  height: 100%;
  width: 100%;
  scroll-behavior: smooth;
  font-family: var(--font-body), serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ========== 导航栏 ========== */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10;

  /* 背景渐变 + 半透明磨砂玻璃 */
  background: var(--nav-primary);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(14px);

  /* 边框 + 阴影 */
  border-bottom: var(--border-bottom);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);

  /* 过渡 */
  transition: background 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}
.dark nav {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 品牌文字 */
.nav-brand {
  font-family: var(--font-brand);
  font-style: italic;
  font-size: 1.25rem;
  font-weight: 800;          /* Extra Bold */
  letter-spacing: 0.03em;    /* 微调字间距 */
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}
.nav-brand:hover {
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); /* 轻微浮起阴影 */
  transform: translateY(-2px);              /* 微微上浮 */
  border-bottom: 2px solid var(--accent-2);
}

/* 导航链接  */
.nav-link {
  color: var(--text-tertiary);
  text-decoration: none;
  text-transform: capitalize;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition) ease, transform 0.3s ease;
  position: relative;
}
.nav-link:hover {
  color: var(--text-primary);
}
.nav-link.active {
  color: var(--accent-1) !important;
}

@media (max-width: 576px) {
  .nav-button{
    display: none  !important;
  }
}

/* 汉堡菜单按钮 */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  border: 1px solid rgba(226, 232, 240, 0.6);
  color: var(--text-primary);
  transition: background 0.3s ease, border 0.3s ease, color 0.3s ease;
  isolation: isolate;
}

.dark .mobile-menu-btn {
  background: transparent;
  border: 1px solid rgba(71, 85, 105, 0.4);
  color: #e2e8f0;
}

.hamburger-line {
  width: 20px;
  height: 1px;
  background-color: var(--text-secondary);
  border-radius: 1px;
  transition: all 0.3s ease;
  position: relative;
}

.hamburger-line:not(:first-child) {
  margin-top: 3px;
}

/* 移动端显示汉堡菜单 (900px 以下) */
@media (max-width: 900px) {
  .nav-button {
    display: none !important;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .mode-toggle {
    margin-right: 0.5rem;
  }
}

/* 移动端导航弹窗 */
.mobile-nav-popup {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  border-radius: 1rem;
  padding: 1rem;
  min-width: 200px;
  margin: 0.5rem;
  z-index: 999;

  background: var(--mask-bg2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(14px);

  border: var(--border-bottom);

  /* 过渡 */
  transition: background 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

.mobile-nav-popup.show {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-nav-link {
  display: block !important;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--text-primary, #333);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: capitalize;
  transition: background-color 0.2s ease;
  border-radius: 4px;
  white-space: nowrap;
}

.mobile-nav-link:hover {
  background: var(--primary-hover, #f5f5f5);
}

.mobile-nav-link.active {
  color: var(--accent-1, #007acc) !important;
}

/* 模式切换  */
.mode-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  border: 1px solid rgba(226, 232, 240, 0.6);
  color: var(--text-primary);
  transition: background 0.3s ease, border 0.3s ease, color 0.3s ease;
  isolation: isolate; /* 防止继承污染 */
}

.dark .mode-toggle {
  background: transparent;
  border: 1px solid rgba(71, 85, 105, 0.4);
  color: #e2e8f0;
}

.mode-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
  stroke: currentColor; /* ← 关键：使用 .mode-toggle 的 color */
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal-scroll-nav .mode-toggle {
  background: var(--bg-primary);
  border: var(--border-bottom);
}

/* ========== Hero 区域 ========== */
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  z-index: -2;
}
.hero-bg.active {
  opacity: 1;
}

/* ========== Hero 内容 ========== */
.hero {
  position: relative;
  z-index: 1;
  text-align: left;
  color: var(--text-primary);
  transition: background 0.3s ease, color 0.3s ease;

  /* 靠左下角布局 */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  height: 100%; /* 让它填满 section 高度 */
}
.hero-inner {
  width: 100%;
}

/* 内容块（固定宽度 + 最小 fallback） */
.hero-content-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0 0 2rem 1.5rem;

  /* 固定理想宽度 */
  width: 500px;
  min-width: 280px;
  max-width: 500px;

  /* 小屏幕下：占满宽度（更合理） */
  @media (max-width: 768px) {
    width: 100%;
    max-width: 100%;
    min-width: auto;
    padding: 1rem 1rem;
  }
}
.hero-content {
  margin-bottom: 1rem;
  padding: 1.5rem;
  background-color: var(--mask-bg);
  backdrop-filter: blur(8px) saturate(110%);
  -webkit-backdrop-filter: blur(8px) saturate(110%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  margin: 0;
}
.dark .hero-content {
  backdrop-filter: blur(10px) saturate(120%); /* 模糊减弱 */
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
/* 名字 */
.hero-name {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0;
}
.hero-name .italic {
  font-style: italic;
}

/* 副标题 Design × Code × AI.”  */
.hero-subtitle {
  font-size: 1.5rem;
  font-family: var(--font-heading);
  font-weight: 500;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}
/* 描述 在设计中进行梯度下降，逼近理想与现实的平衡。 */
.hero-description {
  font-family: var(--font-heading); /* 或你偏好的字体，如 'Geist', 'SF Pro', etc. */
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary) !important;
}

/* 按钮区 */
.hero-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
}

/* 轮播指示器容器 */
.hero-slider-indicators {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 0.1rem;
  gap: 6px;
}
.hero-slider-indicators .indicator {
  flex: 1;
  height: 4px;
  background-color: var(--text-primary);
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 0;
}
.hero-slider-indicators .indicator.active {
  background-color: var(--accent-2);
}

/* 小屏优化 */
@media (max-width: 768px) {
  .hero-slider-indicators {
    padding: 0 0.5rem;
    gap: 6px;
  }
}

/* ========== Section 通用布局 ========== */
.section {
  width: 100%;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
  padding: 1rem 1.5rem 1rem 1.5rem;
}

/*内部容器*/
.section-wrapper {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  transition: all 0.3s ease;

  /* 新增背景图 */
  /*background-image: url('assets/images/background/02.png');*/
  /*background-size: cover;*/
  /*background-position: center;*/
  /*background-repeat: no-repeat;*/
}

.dark .section-wrapper {
  border-color: rgba(255, 255, 255, 0.1);
}

/* ========== 主体布局 ========== */
/*横向排版*/
.section-grid {
  display: flex;
}
.section-grid .expanded {
  display: block !important;
}
.section-grid {
  gap: 4rem;  /* 左侧与右侧的间隔 */
  /*padding: 1rem 1rem 3rem 1rem;*/
  height: auto;
}

@media (max-width: 900px) {
  .section-grid {
    flex-direction: column;
    height: auto;
    min-height: auto;
    max-height: none;
  }

  .section-left,
  .section-content {
    text-align: center;
  }

  /* 关键：不再强制 repeat(2, 1fr)，而是用 auto-fit + 合理 min */
  .section-right {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .card  {
    aspect-ratio: unset;
    max-height: 40vh;
    flex: none;
  }

  .card-content {
    flex: 1;
    min-height: auto;
    max-height: none;
    padding: 1rem;
  }
}

@media (max-width: 600px) {
  .section-right {
    grid-template-columns: 1fr;
  }
}

/* ========== 左侧描述 ========== */
.section-left {
  flex: 0 0 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section-content {
  text-align: left;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
@media (max-width: 640px) {
  .section-title {
    font-size: clamp(2rem, 4vw, 2.25rem);
    text-align: center;
  }
}
.section-subtitle {
  font-family: var(--font-heading);
  /*font-style: italic;*/
  font-size: 1rem;
  /*color: var(--text-secondary);*/
  margin-bottom: 1rem;
}

.section-description {
  padding-top: 0.7rem;
  align-self: flex-end;
  font-family: var(--font-display);
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
  text-align: justify;
  /*text-justify: inter-word;*/
}

.section-view-all {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
}

.section-view-all:hover {
  color: var(--primary-hover);
}

/* ========== 右侧卡片区 ========== */
.section-card {
  max-height: 50vh;
  overflow: auto;
  flex: 1;
  min-width: 0;
}
.section-right {
  flex: 1;
  column-count: 4;
  align-content: start;
  overflow: hidden;
}

@media (max-width: 1600px) {
  .section-right { column-count: 3; }
}

@media (max-width: 1200px) {
  .section-right { column-count: 2; }
}

@media (max-width: 900px) {
  .section-right { column-count: 1; }
}

/*隐藏滚动条*/
.section-card::-webkit-scrollbar {
  /*display: none;*/
  width: 8px;
}
.section-card::-webkit-scrollbar-track {
  background: transparent;
}
.section-card::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  transition: background-color 0.2s ease;
}
.dark .section-card::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
}
.section-card::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.25);
}
.dark .section-card::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* ========== About Me介绍 ========== */
/* 图片容器 */
.section-card-image{
  display: flex;
}
.about-image-wrapper {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 1rem; /* 与 rounded-2xl 一致 */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 图片样式 */
.about-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-signature-wrapper img {
  max-width: 8rem;
  opacity: 0.6;
}

.about-signature-white,
.about-signature-black {
  max-width: 8rem;
  opacity: 0.6;
}
.section-description.about {
  transition: color 0.3s ease-in-out;
  color: var(--text-primary);
}


/* ========== 卡片样式 ========== */
.card {
  display: flex;
  position: relative;
  flex: 0 0 auto;
  flex-direction: column;
  background: transparent;
  border: none;
  border-radius: 1rem;
  cursor: pointer;
  overflow: clip;
  align-self: start;
  transition: box-shadow 0.3s ease;
  width: 100%;
  margin-bottom: 1.5rem;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}
.card-image {
  width: 100%;
  border-radius: 1rem;
  aspect-ratio: 440 / 460;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.4, 1);
}
.card:hover .card-image img {
  transform: scale(1.05);
  transition: 0.4s
}

.card-overlay {
  margin: 0.5rem;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.25rem;
  color: white;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px) saturate(110%);
  -webkit-backdrop-filter: blur(8px) saturate(110%);

  border-radius: 1rem;
  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;

  transition:
    transform 0.4s cubic-bezier(0.2, 0.8, 0.4, 1),
    opacity 0.4s ease,
    visibility 0.4s ease;
  pointer-events: none;
  z-index: 2;
}
.card:hover .card-overlay {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.card-title {
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
  line-height: 1.3;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.card-desc {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========== View All 全屏模式 ========== */
.section.expanded {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  overflow: auto;
  display: block;
}

.section.expanded .section-wrapper {
  border: 1px solid var(--bg-primary);
  box-shadow: none;
  background: transparent;
  padding: 3rem 4%;
  height: auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.section.expanded .section-grid {
  flex-direction: row;
  align-items: stretch;
  gap: 2.5rem;
  height: 100%;
  display: block;
}

.section.expanded .section-left {
  flex: 0 0 360px;
  align-self: flex-start;
  padding-top: 2rem;
}
.section.expanded .section-card{
  max-height: none !important;
  margin-top: 2rem;
}
.section.expanded .section-grid,
.section-right{
  max-height: none !important;
}

@media (max-width: 1000px) {
  .section.expanded .section-grid {
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .section.expanded .section-left {
    flex: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center; /* 关键：让描述在上下居中 */
    align-items: center;     /* 让文字居中 */
    padding-top: 2rem;
    padding-bottom: 2rem;
    text-align: center;
  }

  .section.expanded .section-content {
    text-align: center;
    max-width: 600px;
  }

  .section.expanded .section-right {
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    height: auto;
    max-height: 60vh;
  }
}

@media (max-width: 750px) {
  .section.expanded .section-left {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .section.expanded .section-right {
    grid-template-columns: 1fr;
    max-height: none;
  }
}

/* ========== Experience 卡片特化样式 ========== */
#ExperienceGrid {
  display: flex;
  flex-direction: column;
}

.experience-card {
  border-radius: 0.75rem;
  width: 100%;
  box-shadow: none;

  background-color: var(--mask-bg2);

  /*padding: 1rem;*/
  padding-right: 1rem;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  /*border: var(--border-bottom);*/
}
.experience-card:hover {
  background-color: rgba(243, 243, 243, 0.93);
}
.dark .experience-card:hover {
  background-color: rgba(71, 71, 71, 0.24);
}

.year-title{
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-style: italic;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;

  text-align: left;
  height: 2rem;
  border-bottom: var(--border-bottom);

  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

/* Experience 卡片缩略图样式 */
.experience-thumb {
  width: 0%;
  /*min-width: 120px;*/
  /*max-width: 180px;*/
  aspect-ratio: 4/ 3;
  /*height: 120px;*/
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 0.5rem;
  transition: width 0.5s ease;
}
.experience-card:hover .experience-thumb {
  width: 10%;
  /*width: 180px;*/
}
@media (max-width: 1200px) {
  .experience-thumb {
    display: none;
  }
}
.experience-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;     /* 裁剪填充，保持比例 */
  display: block;
}



/* ========== Modal Overlay ========== */
#modalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, backdrop-filter 0.4s ease;
  padding: 1.5rem;
}
#modalOverlay.show {
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ========== Modal 主体 ========== */
.modal {
  max-width: 160vh;
  width: 100%;
  height: 90vh;
  max-height: 90vh;

  /* === 视觉风格 === */
  background-color: var(--modal-bg) !important;
  border-radius: 1rem;
  border-color: var(--border-color);

  /* === 布局 === */
  position: relative;
  display: flex;
  flex-direction: column;
  /*overflow: auto;*/
  overflow-x: hidden;
  overflow-y: auto;

  /* === 阴影 & 动画 === */
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
  transform: translateY(30px) scale(0.97);
  opacity: 0;
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}
#modalOverlay.show .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ========== 关闭按钮 ========== */
.modal-close {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  cursor: pointer;
  z-index: 1000;
  transition: color 0.2s ease, transform 0.25s ease;
  color: var(--accent-2);
}

.modal-close:hover {
  color: var(--accent-2);
  transform: rotate(90deg);
}

/* ========== 简易模式：左右布局 ========== */
.modal-simple-view {
  display: flex;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
}

/* 响应式：小屏改为上下布局 */
@media (max-width: 900px) {
  .modal-simple-view {
    display: block;
    padding: 1.5rem;
  }

  .modal-simple-view::-webkit-scrollbar {
    display: none;
  }

  .image-gallery-container {
    padding-top: 2rem;
  }

  .modal-content {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .modal-info {
    width: 100%;
    box-sizing: border-box;
  }
}

.modal-simple-view .modal-info {
  display: flex;
  flex-direction: column;
}

.modal-content {
  flex: 0 0 420px;
  width: 400px;
}
#modalTitle, #modalTitle2{
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
  line-height: 1.3;
}
#modalMeta, #modalMeta2 {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  line-height: 1.5;
}
.modal-tag {
  margin-bottom: 0.75rem;
}
.modal-description, #heroDescription {
  color: var(--text-primary);
  margin: 1.25rem 0;
  font-size: 1rem;
  line-height: 1.6;
  /*text-align: justify;*/
}

/* ========== 图片容器 ========== */
.image-gallery-container {
  display: block;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 1rem;
}
.image-gallery-container::-webkit-scrollbar {
  display: none;
}

/* ========== 相册 ========== */
.image-gallery {
  display: grid;
  gap: 1rem;
}
.image-gallery img {
  object-fit: cover;
  border-radius: 1rem;
  flex-shrink: 0;
  cursor: zoom-in;
  width: 100%;
}

.image-gallery video {
  width: 100%;
  height: auto;
  border-radius: 1rem;
  object-fit: cover;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}

/* ========== Lightbox（全屏预览） ========== */
#lightboxOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  animation: fadeIn 0.2s forwards;
}
@keyframes fadeIn {
  to { opacity: 1; }
}
.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}
#lightboxImage {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: var(--accent-2);
  width: 36px;
  height: 36px;
  border-radius: 30%;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #000;
}
.lightbox-close:hover {
  background: var(--secondary-hover);
}

/* ========== Read 按钮样式 ========== */
.read-more-btn {
  align-self: flex-start;
  padding: 0.5rem 1.25rem;
  background: var(--accent-2);
  color: white;
  border: none;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
.read-more-btn:hover {
  opacity: 0.9;
}

.read-less-btn {
  background: var(--accent-2);
  color: white;
  border: none;
  padding: 0.375rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
.read-less-btn:hover {
  opacity: 0.9;
}

/* ========== ReadMore 模式 ========== */
.modal .modal-readmore-view{
  background: var(--bg-primary);
}
.modal-readmore-view {
  display: block;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
  position: relative;
}

/* Hero 区域 */
.modal-hero {
  position: relative;
  width: 100%;
  height: 35vh;
  min-height: 300px;
  max-height: 700px;
  overflow: hidden;
  margin-top: calc(-1 * (0.75rem + 2rem * 2));
}

.modal-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/*Hero 区域的信息块*/
.modal-hero-overlay {
  /*先暂时取消显示*/
  /*position: absolute;*/
  bottom: 1rem;
  left: 1rem;
  /*transform: translateX(-50%);*/

  width: 100%;
  max-width: 500px;
  min-width: 280px;
  padding: 1rem;

  background-color: var(--mask-bg2);
  backdrop-filter: blur(5px) saturate(110%);
  -webkit-backdrop-filter: blur(5px) saturate(110%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);

  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  .modal-hero-overlay {
    width: calc(100% - 2rem);
    max-width: none;
    min-width: auto;
    bottom: 1rem;
    padding: 1rem;
  }
}

/* 滚动后出现的 Nav */
/*直接显示的话需要调整一下那个Hero的位置*/
.modal-scroll-nav {
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: none;
  border-bottom: none;
  padding: 0.75rem 1rem;
  display: flex;
}

.modal-scroll-nav.shown {
  display: block;
}

.modal-header-inner .modal-info {
  display: flex;
  flex-direction: column;
}

/* Markdown 主体 */
.modal-markdown-wrapper {
  width: 60%;
  max-width: 800px; /* 可选：防止在超宽屏上过宽 */
  margin: 0 auto;   /* 关键：自动左右 margin 实现居中 */
  flex: 1;
}
@media (max-width: 768px) {
  .modal-markdown-wrapper {
    width: 85%;
  }
}

/* ========== 自定义滚动条 ========== */
.modal-content::-webkit-scrollbar {
  width: 8px;
}
.modal-content::-webkit-scrollbar-thumb {
  background-color: rgba(100, 116, 139, 0.25);
  border-radius: 4px;
  transition: background-color 0.3s ease;
}
.modal-content::-webkit-scrollbar-thumb:hover {
  background-color: rgba(100, 116, 139, 0.45);
}
.modal-content::-webkit-scrollbar-track {
  background: transparent;
}

/* ========== 按钮样式 ========== */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.75rem;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  font-family: var(--font-sans);
  letter-spacing: -0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--secondary-hover));
  transform: translateY(-2px);
  box-shadow: 0 6px 12px -2px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.03);
  transform: translateY(-2px);
}

.dark .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* === 通用标签样式 === */
.card-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px; /* fully rounded */
  font-size: 0.75rem; /* text-xs */
  font-weight: 600; /* font-semibold */
  line-height: 1.2;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
  user-select: none;
}

/* Architecture */
.tag-architecture {
  background-color: rgba(219, 234, 254, 1); /* bg-blue-100 */
  color: rgb(30, 64, 175); /* text-blue-800 */
}
.dark .tag-architecture {
  background-color: rgba(30, 64, 175, 0.3); /* dark:bg-blue-900/30 */
  color: rgb(191, 219, 254); /* dark:text-blue-300 */
}

/* Programming */
.tag-programming {
  background-color: rgba(237, 233, 254, 1); /* bg-violet-100 */
  color: rgb(91, 33, 182); /* text-violet-800 */
}
.dark .tag-programming {
  background-color: rgba(91, 33, 182, 0.3);
  color: rgb(221, 214, 254);
}

/* AI */
.tag-ai {
  background-color: rgba(243, 232, 255, 1); /* bg-purple-100 */
  color: rgb(107, 33, 168); /* text-purple-800 */
}
.dark .tag-ai {
  background-color: rgba(107, 33, 168, 0.3);
  color: rgb(216, 180, 254);
}

/* Paper */
.tag-paper {
  background-color: rgba(219, 234, 254, 1); /* bg-blue-100 */
  color: rgb(30, 64, 175); /* text-blue-800 */
}
.dark .tag-paper {
  background-color: rgba(30, 64, 175, 0.3);
  color: rgb(191, 219, 254);
}

/* Patent */
.tag-patent {
  background-color: rgba(237, 233, 254, 1); /* bg-purple-100 */
  color: rgb(91, 33, 182); /* text-purple-800 */
}
.dark .tag-patent {
  background-color: rgba(91, 33, 182, 0.3);
  color: rgb(221, 214, 254);
}

/* Workshop */
.tag-workshop {
  background-color: rgb(255, 251, 196); /* bg-yellow-100 */
  color: rgb(195, 112, 27); /* text-yellow-800 */
}
.dark .tag-workshop {
  background-color: rgba(133, 77, 14, 0.3);
  color: rgb(253, 224, 71);
}

/* Internship */
.tag-internship {
  background-color: rgba(220, 252, 231, 1); /* bg-green-100 */
  color: rgb(22, 101, 52); /* text-green-800 */
}
.dark .tag-internship {
  background-color: rgba(22, 101, 52, 0.3);
  color: rgb(187, 247, 208);
}

/* Award */
.tag-award {
  background-color: rgba(254, 226, 226, 1); /* bg-red-100 */
  color: rgb(153, 27, 27); /* text-red-800 */
}
.dark .tag-award {
  background-color: rgba(153, 27, 27, 0.3); /* dark:bg-red-900/30 */
  color: rgb(251, 191, 191); /* dark:text-red-300 */
}

/* Education */
.tag-education {
  background-color: rgb(207, 255, 226); /* bg-teal-100 */
  color: rgb(13, 100, 91); /* text-teal-800 */
}
.dark .tag-education {
  background-color: rgba(13, 100, 91, 0.3); /* dark:bg-teal-900/30 */
  color: rgb(153, 243, 230); /* dark:text-teal-300 */
}

/* Event */
.tag-event {
  background-color: rgba(255, 237, 212, 1); /* bg-orange-100 */
  color: rgb(124, 45, 18); /* text-orange-800 */
}
.dark .tag-event {
  background-color: rgba(124, 45, 18, 0.3); /* dark:bg-orange-900/30 */
  color: rgb(253, 186, 116); /* dark:text-orange-300 */
}
/* === Markdown 样式 === */
/* 基础字体与排版 */
.markdown-body {
  font-family: var(--font-markdown-body);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text-primary);
  /*max-width: 800px;*/
  margin: 0 auto;
  padding: 2rem 0 8rem 0;
  letter-spacing: 0.01em;
  transition: var(--transition);
}

/* ===== Headings ===== */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  font-family: var(--font-heading), serif;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.markdown-body h1 {
  font-size: 2.2rem;
  letter-spacing: -0.01em;
  border-bottom: var(--border-bottom);
  padding-bottom: 0.75rem;
}
@media (max-width: 768px) {
  .markdown-body h1{
    font-size: 1.8rem;
  }
}
.markdown-body h2 {
  font-size: 1.6rem;
  border-bottom: var(--border-bottom);
  padding-left: 0.75rem;
  color: var(--text-primary);
  margin-top: 2rem;
}

.markdown-body h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  opacity: 0.9;
}

/* ===== Paragraphs ===== */
.markdown-body p {
  margin: 0.8rem 0 1.6rem;
}

/* ===== Lists ===== */
.markdown-body ul,
.markdown-body ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.markdown-body li {
  margin-bottom: 0.5rem;
  line-height: 1.8;
}

/* ===== Blockquote ===== */
.markdown-body blockquote {
  border-left: 3px solid var(--accent-2);
  color: var(--text-tertiary);
  padding: 0 0.8rem;
  margin: 1.5rem 0;
}

.markdown-body blockquote p {
  margin: 0.5em 0;
  font-style: italic;
}

/* 深色模式背景（可选） */
.dark .markdown-body blockquote {
  background: rgba(59, 130, 246, 0.08);
}
/* ===== Links ===== */
.markdown-body a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(83, 119, 218, 0.2);
  transition: color 0.25s ease, border-color 0.25s ease;
}

.markdown-body a:hover {
  color: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* ===== Code ===== */
.markdown-body code {
  background: rgba(83, 119, 218, 0.08);
  padding: 0.25rem 0.45rem;
  border-radius: 0.3rem;
  font-family: var(--font-markdown-code);
  font-size: 0.95rem;
}

.dark .markdown-body code {
  background: rgba(96, 165, 250, 0.15);
}

/* ===== Code Blocks ===== */
.markdown-body pre {
  background: rgba(83, 119, 218, 0.1);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 2rem 0;
}

.dark .markdown-body pre {
  background: rgba(30, 41, 59, 0.7);
}

/* ===== Tables ===== */
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  border-radius: 0.5rem;
  overflow: hidden;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid rgba(83, 119, 218, 0.1);
  padding: 0.75rem 0.9rem;
}

.markdown-body th {
  background: rgba(83, 119, 218, 0.08);
  font-weight: 600;
}

/* ===== Images ===== */
.markdown-body img {
  display: block;
  max-width: 100%;
  margin: 2rem auto;
  border-radius: 0.75rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.markdown-vide {
  height: auto;
  margin: 1rem auto;
  border-radius: 0.75rem;
}

/* ===== Horizontal Line ===== */
.markdown-body hr {
  border: none;
  height: 1px;
  background: var(--border-color);
  margin: 2rem 0;
}

/* ===== Strong / Emphasis ===== */
.markdown-body strong {
  font-weight: 600;
  color: var(--text-primary);
}
/*斜体颜色控制*/
/*.markdown-body em {*/
/*  color: var(--accent-2);*/
/*}*/

.markdown-body .md-figure {
  text-align: center;
  margin: 2rem 0;
}

.markdown-body .md-figure img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

.markdown-body .md-figure em {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary, #666);
}

/* ===== Tag / Keyword Capsule ===== */
.markdown-body .tag {
  display: inline-block;
  background: rgba(83, 119, 218, 0.08);
  color: var(--primary-color);
  border-radius: 9999px;
  padding: 0.2rem 0.75rem;
  font-size: 0.85rem;
  margin-right: 0.5rem;
}
