:root {
  --primary: #3d6ad6;
  --accent: #f2b544;
  --dark: #0b132b;
  --light: #f8f9fc;
  --text: #1f2d3d;
}

body {
  font-family: 'Open Sans', sans-serif;
  color: var(--text);
  background-color: #ffffff;
  scroll-behavior: smooth;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Lora', serif;
  color: var(--dark);
}

.navbar {
  background: rgba(11, 19, 43, 0.9);
  backdrop-filter: blur(6px);
  transition: background 0.3s ease-in-out;
}

.navbar .navbar-brand {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.navbar-nav .nav-link {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.85);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
  color: #ffffff;
}

.hero {
  position: relative;
  padding: 180px 0 140px;
  background: linear-gradient(135deg, #f5f0e6 0%, #e7eef7 100%);
  color: #ffffff;
}

.hero .overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 19, 43, 0.25);
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  color: #ffffff;
}

.hero p {
  color: rgba(255, 255, 255, 0.85);
}

.profile-card img {
  max-width: 240px;
  border: 6px solid rgba(255, 255, 255, 0.8);
}

.section-title {
  font-size: 2.4rem;
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: var(--primary);
  margin-top: 12px;
}

.highlight-box {
  background: linear-gradient(135deg, rgba(61, 106, 214, 0.1), rgba(242, 181, 68, 0.15));
  border-left: 4px solid var(--primary);
  padding: 1.5rem;
  border-radius: 12px;
}

.highlight-box ul {
  margin-bottom: 0;
}

.timeline {
  position: relative;
  margin: 2rem 0;
  padding-left: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 12px;
  width: 2px;
  background: linear-gradient(180deg, rgba(61, 106, 214, 0.2), rgba(11, 19, 43, 0.4));
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
}

.timeline-marker {
  position: absolute;
  top: 6px;
  left: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid var(--primary);
}

.timeline-content {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
  padding: 1.5rem;
}

.timeline-content h3 {
  margin-bottom: 0.5rem;
}

.card {
  border: none;
  border-radius: 16px;
  background: #ffffff;
}

.card-body {
  padding: 2rem;
}

.card ul {
  margin-bottom: 0;
}

.experience-photo {
  width: clamp(180px, 55%, 260px);
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.award-card,
.skill-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
  border-top: 4px solid var(--primary);
}

.award-card h3,
.skill-card h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.skill-card ul {
  padding-left: 1.2rem;
}

.contact-info .btn {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  border-radius: 50px;
  padding-inline: 1.8rem;
}

footer {
  background: #f5f7fb;
}

@media (max-width: 991px) {
  .hero {
    padding: 160px 0 120px;
  }

  .profile-card img {
    max-width: 200px;
  }
}

@media (max-width: 767px) {
  .navbar {
    background: rgba(11, 19, 43, 0.95);
  }

  .timeline {
    padding-left: 15px;
  }

  .timeline::before {
    left: 6px;
  }

  .timeline-marker {
    left: -8px;
  }
}

/* Blog styles */
.blog-page {
  background-color: #f7f9fc;
}

.blog-hero {
  position: relative;
  padding: 160px 0 120px;
  background: linear-gradient(120deg, rgba(11, 19, 43, 0.85), rgba(61, 106, 214, 0.75)),
              url('../img/tao-hu.jpg') center/cover no-repeat;
  color: #ffffff;
}

.blog-hero .overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 19, 43, 0.45);
}

.blog-hero .container {
  position: relative;
  z-index: 1;
}

.blog-hero h1 {
  color: #ffffff;
}

.blog-hero .lead {
  color: rgba(255, 255, 255, 0.85);
  max-width: 720px;
  margin: 1rem auto 0;
}

.blog-meta {
  margin-top: 1.5rem;
  display: inline-flex;
  gap: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.blog-meta i {
  margin-right: 0.35rem;
}

.blog-content {
  background: transparent;
}

.blog-post {
  background: #ffffff;
  border-radius: 20px;
  padding: 3rem;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.08);
}

.blog-post h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.blog-post h3,
.blog-post h4 {
  color: var(--primary);
}

.blog-post p {
  line-height: 1.75;
  font-size: 1.05rem;
}

.blog-post .math-display {
  text-align: center;
  margin: 1.25rem 0;
  font-size: 1.05rem;
}

.blog-post ul {
  padding-left: 1.2rem;
}

.algorithm,
.theorem-block,
.example-block {
  background: rgba(61, 106, 214, 0.05);
  border-left: 4px solid var(--primary);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.algorithm-header {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  color: var(--primary);
}

.algorithm-steps {
  margin-bottom: 0;
  padding-left: 1.1rem;
}

.theorem-block h4,
.example-block h4 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.references {
  padding-left: 1.2rem;
  list-style: disc;
}

.references li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.blog-highlight {
  background: linear-gradient(135deg, rgba(61, 106, 214, 0.15), rgba(242, 181, 68, 0.25));
}

@media (max-width: 767px) {
  .blog-post {
    padding: 2rem;
  }

  .blog-meta {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }
}

/* 紫色随机矩阵风格背景 */
.hero.math-bg {
  position: relative;
  /* 淡紫底色 */
  background-color: #f6f1ff;

  /* 紫色网格 + 紫色谱云 */
  background-image:
    /* 横向网格线 */
    linear-gradient(rgba(168, 85, 247, 0.06) 1px, transparent 1px),
    /* 纵向网格线 */
    linear-gradient(90deg, rgba(168, 85, 247, 0.06) 1px, transparent 1px),
    /* 中间很淡的谱云（radial gradient） */
    url("data:image/svg+xml,%3Csvg width='600' height='600' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3CradialGradient id='g' cx='50%25' cy='50%25' r='50%25'%3E%3Cstop offset='0%25' stop-color='%23a855f7' stop-opacity='0.12'/%3E%3Cstop offset='100%25' stop-color='%23a855f7' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect width='600' height='600' fill='url(%23g)'/%3E%3C/svg%3E");

  background-size:
    40px 40px,   /* 网格行距 */
    40px 40px,   /* 网格列距 */
    600px 600px; /* 谱云大小 */

  background-position: center;
  padding: 120px 0;
}


