@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

:root {
  --primary-color: #111;
  --secondary-color: #333;
  --accent-color: #3D6B4F;
  --bg-gradient: radial-gradient(circle at 35% 50%, #a2c2ff, #fefefe 60%);
  --nav-bg: rgba(255, 255, 255, 0.3);
  --border-color: rgba(17, 17, 17, 0.08);
  --font-main: 'Inter', Arial, sans-serif;
  --transition-speed: 320ms;
  --ease-out-expo: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-main);
  padding-top: 64px;
  /* 给固定导航留空间 */
  color: var(--secondary-color);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}


.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  z-index: -1;
}

.tearable-entry {
  position: fixed;
  inset: 0;
  z-index: 5000;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 250, 226, 0.9), rgba(239, 235, 220, 0.88) 52%, rgba(214, 211, 199, 0.82)),
    #f6f4ec;
  touch-action: none;
  transition: opacity 650ms var(--ease-out-expo), visibility 650ms var(--ease-out-expo);
}

.tearable-entry::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(20, 20, 20, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 20, 20, 0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mix-blend-mode: multiply;
}

.tearable-entry.is-dismissed {
  opacity: 0;
  visibility: hidden;
}

#tearable-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  display: block;
}

#tearable-canvas:active {
  cursor: grabbing;
}

.tearable-skip {
  position: absolute;
  right: 22px;
  bottom: 20px;
  z-index: 2;
  border: 1px solid rgba(17, 17, 17, 0.22);
  background: rgba(255, 255, 255, 0.52);
  color: rgba(17, 17, 17, 0.72);
  border-radius: 999px;
  padding: 9px 15px 10px;
  font: 600 13px/1 var(--font-main);
  letter-spacing: 0.02em;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
}

.tearable-skip:hover {
  color: #111;
  background: rgba(255, 255, 255, 0.78);
}


.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  /*border-bottom: 1px solid #eee;*/
  padding: 16px 32px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  z-index: 1000;

}

.top-nav ul {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 36px;
  list-style: none;
}

.top-nav a {
  text-decoration: none;
  color: #222;
  font-size: 16px;
  letter-spacing: 0.02em;

}

.hero {
  display: flex;
  align-items: center;
  /* 垂直居中 */
  justify-content: center;
  /* 水平居中 */
  gap: 40px;
  padding: 24px 32px;
  max-width: 980px;
  margin: 0 auto;
  min-height: calc(100vh - 20vh);
  /* 占满整个窗口高度减去导航栏 */
  box-sizing: border-box;

}

.hero-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 垂直居中 */
  justify-content: center;
  /* 水平居中 */
  gap: 40px;
  padding: 24px 32px;
  max-width: 980px;
  margin: 0 auto;
  min-height: calc(100vh - 20vh);
  /* 占满整个窗口高度减去导航栏 */
  box-sizing: border-box;
}

.map-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 垂直居中 */
  justify-content: center;
  /* 水平居中 */
  gap: 20px;
  padding: 24px 32px;
  max-width: 1100px;
  margin: 0 auto;
  min-height: calc(100vh - 80px);
  /* 占满整个窗口高度减去导航栏 */
  box-sizing: border-box;
}

.profile-photo {
  width: 35%;
  height: 35%;
  border-radius: 50%;
  overflow: hidden;
  border: 4.5px solid #fff;
  /* 白色圆环 */
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.1);
  /* 可选，增加立体感 */
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  transform-origin: center;
}


.bio {
  max-width: 100%;
  line-height: 1.6;
  color: #333;
  font-size: 100%;
}

.bio p {
  margin: 0 0 12px;
  font-size: 112%;
}

.bio h1 {
  margin: 0 0 16px;
  font-size: 220%;
  font-weight: 700;
  color: #111;
}

/* Typewriter effect */
.typewriter {
  display: inline;
}

.cursor {
  display: inline-block;
  color: var(--accent-color);
  font-weight: 400;
  animation: blink 1s step-end infinite;
}

@keyframes blink {

  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

.active {
  font-weight: bold;
  transform: scale(1.06);
  text-shadow: 0 12px 28px rgba(15, 23, 42, 0.24);
}

/* =================================== */
/*          地图页面样式             */
/* =================================== */

/* 1. 设置地图容器的样式 */
.map-container {
  position: relative;
  width: 100%;
  max-width: 1100px;
  height: 75vh;
  /* Increased height for better view */
  margin: 30px auto;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  background: #f0f0f0;
  z-index: 1;
  /* Ensure map is below nav but above background */
}

/* Leaflet specific adjustments */
.custom-div-icon {
  background: none;
  border: none;
}

.leaflet-popup-content-wrapper {
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.leaflet-popup-content {
  font-family: var(--font-main);
  font-size: 14px;
  color: var(--primary-color);
}

/* =================================== */
/*        文字悬浮交互效果            */
/* =================================== */

.hover-float {
  display: inline-block;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
    text-shadow 320ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.hover-float:hover {
  transform: translate3d(0, -6px, 0);
  text-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}

.hover-lift {
  display: inline-block;
  transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 360ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.hover-lift:hover {
  transform: translate3d(0, -10px, 0) scale(1.01);
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.2);
}

.hover-pop {
  display: inline-block;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    text-shadow 260ms cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: center;
  will-change: transform;
}

.hover-pop:hover {
  transform: scale(1.06);
  text-shadow: 0 12px 28px rgba(15, 23, 42, 0.24);
}

/* =================================== */
/*             Updates 区块            */
/* =================================== */

.updates {
  max-width: 980px;
  margin: 0 auto 120px;
  padding: 0 32px;
  text-align: left;
}

.updates h2 {
  font-size: 180%;
  margin-bottom: 16px;
  color: #111;
}

.update-entry {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid rgba(17, 17, 17, 0.08);
}

.update-entry a {
  color: #111;
  text-decoration: none;
  font-weight: 600;
  font-size: 120%;
}

.update-date {
  font-size: 105%;
  color: rgba(17, 17, 17, 0.6);
}

.blog-header {
  text-align: center;
  padding: 60px 20px 40px;
}

.blog-header .category {
  color: var(--accent-color);
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.blog-header h1 {
  font-size: 40px;
  font-weight: 400;
  line-height: 1.35;
  margin: 0 auto;
  max-width: 800px;
  color: #111;
}

.blog-header .subtitle {
  font-size: 22px;
  color: #666;
  margin: 10px auto 0;
  max-width: 800px;
  font-weight: 400;
}

.blog-header .update-date {
  margin-top: 14px;
}

.blog-hero-image {
  width: 100%;
  max-width: 1100px;
  max-height: 560px;
  object-fit: cover;
  display: block;
  margin: 0 auto 48px;
  border-radius: 4px;
}

.blog-markdown {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px 60px;
  text-align: left;
}

.blog-markdown .single-image {
  width: 100%;
  display: block;
  margin: 24px 0;
  border-radius: 4px;
}

.blog-markdown .image-row {
  display: flex;
  gap: 16px;
  margin: 24px 0;
}

.blog-markdown .image-row img {
  flex: 1;
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

/* =================================== */
/*          Responsive Design          */
/* =================================== */

@media (max-width: 768px) {
  .top-nav {
    padding: 12px 16px;
  }

  .top-nav ul {
    gap: 20px;
  }

  .top-nav a {
    font-size: 14px;
  }

  .hero {
    flex-direction: column;
    text-align: center;
    gap: 32px;
    padding-top: 40px;
  }

  .profile-photo {
    width: 180px;
    height: 180px;
  }

  .bio h1 {
    font-size: 180%;
  }

  .updates h2 {
    font-size: 150%;
  }

  .update-entry {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .update-entry a {
    font-size: 110%;
  }

  /* 禁用移动端悬浮效果 */
  .hover-float,
  .hover-lift,
  .hover-pop {
    transform: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    transition: none !important;
  }

  .hover-float:hover,
  .hover-lift:hover,
  .hover-pop:hover {
    transform: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
  }
}

@media (max-width: 480px) {
  .top-nav ul {
    gap: 12px;
  }

  .top-nav a {
    font-size: 13px;
  }

  .hero {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* =================================== */
/*          Blog Article Styles        */
/* =================================== */

.blog-page {
  background: #fff;
}

.blog-header {
  text-align: center;
  padding: 60px 20px 40px;
}

.blog-header .category {
  color: var(--accent-color);
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.blog-header h1 {
  font-size: 40px;
  font-weight: 400;
  line-height: 1.35;
  margin: 0 auto;
  max-width: 800px;
  color: #111;
}

.blog-hero-image {
  width: 100%;
  max-width: 1100px;
  max-height: 560px;
  object-fit: cover;
  display: block;
  margin: 0 auto 48px;
  border-radius: 4px;
}

.blog-markdown {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px 60px;
  text-align: left;
  box-sizing: border-box;
}

.blog-markdown h1,
.blog-markdown h2,
.blog-markdown h3 {
  color: #111;
  margin-top: 2em;
}

.blog-markdown p {
  line-height: 1.8;
  margin: 1.2em 0;
  color: #333;
}

.blog-markdown ul {
  padding-left: 1.5em;
}

.blog-markdown li {
  margin: 0.5em 0;
  line-height: 1.6;
}

.blog-markdown code {
  background: #f4f4f4;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-family: monospace;
}

.blog-markdown pre {
  margin: 1.4em 0;
  padding: 16px 18px;
  overflow-x: auto;
  border-radius: 6px;
  background: #f6f7f5;
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.blog-markdown pre code {
  display: block;
  padding: 0;
  background: transparent;
  border-radius: 0;
  line-height: 1.7;
  white-space: pre;
}

.blog-markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 15px;
  line-height: 1.6;
}

.blog-markdown thead {
  background: #f8f8f8;
}

.blog-markdown th,
.blog-markdown td {
  padding: 10px 14px;
  border: 1px solid #e0e0e0;
  text-align: left;
}

.blog-markdown th {
  font-weight: 600;
  color: #111;
}

.blog-markdown .policy-notice {
  margin: 1.5em 0;
  padding: 1em 1.25em;
  border-left: 4px solid var(--accent-color);
  background: rgba(26, 115, 232, 0.06);
  border-radius: 8px;
}

.blog-markdown .policy-notice p {
  margin: 0;
  line-height: 1.65;
}

.blog-markdown .single-image {
  width: 100%;
  display: block;
  margin: 24px 0;
  border-radius: 4px;
}

.blog-markdown .image-row {
  display: flex;
  gap: 16px;
  margin: 12px 0;
  width: 100%;
  align-items: center;
}

.blog-markdown .image-row img {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  max-height: 320px;
  height: auto;
  width: auto;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

/* Blog responsive styles for mobile */
@media (max-width: 768px) {
  .blog-header {
    padding: 40px 20px 24px;
  }

  .blog-header h1 {
    font-size: 24px;
    line-height: 1.4;
  }

  .blog-header .category {
    font-size: 12px;
    margin-bottom: 16px;
  }

  .blog-hero-image {
    margin: 0 0 32px;
    border-radius: 0;
  }

  .blog-markdown {
    padding: 0 16px 40px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
  }

  .blog-markdown p {
    font-size: 16px;
    line-height: 1.75;
    margin: 1em 0;
  }

  .blog-markdown h2 {
    font-size: 20px;
    margin-top: 1.5em;
  }

  .blog-markdown h3 {
    font-size: 18px;
  }

  .blog-markdown ul {
    padding-left: 1.2em;
  }

  .blog-markdown ul ul {
    padding-left: 1em;
  }

  .blog-markdown li {
    font-size: 16px;
    line-height: 1.7;
  }

  .blog-markdown .image-row {
    flex-direction: column;
    gap: 12px;
  }

  .blog-markdown .image-row img {
    max-height: none;
    width: 100%;
  }

  .blog-markdown code {
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 14px;
  }

  .blog-markdown a {
    word-break: break-all;
  }
}
