/* ========================================
   MAIN 全站样式表 (所有页面通用)
   功能：控制导航栏、页面头部、底部、排版等全局样式
   应用于：所有页面 (index.html、research.html、blog.html 等)
   ======================================== */

@import "./styles.css";  /* 导入 Bootstrap 基础样式 */

/* ===== 全局 CSS 变量 =====
   作用：定义全站通用颜色，方便一次性修改整个设计风格
   --h-title-color: 页面标题、导航栏的主色（深蓝色） */
:root{
    --h-title-color:#24306b;  /* 深蓝色，用于标题和导航栏 */
}

/* ===== 导航栏样式 (.header) =====
   作用：为导航栏底部添加蓝色分隔线，设置高 z-index 使其浮在内容之上
   应用于：所有页面的导航栏 <nav class="header"> */
.header {
    border-bottom: solid 2px var(--bs-blue);  /* 导航栏下方的蓝色分隔线 */
    z-index: 10000;  /* 高层级，确保导航栏浮在所有内容之上 */
}


/* ===== 底部样式 (.bg-bottom) =====
   作用：设置页面底部（footer）的背景颜色为深蓝色
   应用于：所有页面的 <footer class="bg-bottom"> */
.bg-bottom {
    background-color: var(--h-title-color);  /* 深蓝色背景 */
}

.top-section {
    position: relative;        /* 相对定位，作为子元素绝对定位的基准 */
    padding: 10rem 0;          /* 上下内边距 10rem（约160px），增加呼吸感 */
    background-position: center; /* 背景图片居中 */
    background-size: cover;    /* 背景图等比缩放至覆盖整个容器 */
    height: 25rem;             /* 固定高度 40rem */
}

.top-section h2 {
    font-weight: 400;
}

.top-section .top-section-content {
    position: relative;
    z-index: 1;
}

.top-section:before {                   /* 在背景图上压一层“暗色滤镜”，目的是让上面的白色文字更清晰，这是 UI 设计中的常用方案 */
    content: "";               /* 伪元素必须包含 content */
    position: absolute;        /* 绝对定位，覆盖整个父容器 */
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* 黑色半透明遮罩（透明度0.5） */
}

section header h2{
    font-family:"Kanit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;

    color: var(--h-title-color);          /* 标题颜色 */
    font-size: 2.5rem;                   /* 字体大小 */
    line-height: 3rem;                    /* 行高，1.2倍字号 */
    font-weight: 800;                    /* 粗体 */
    margin-bottom: 1.5rem;               /* 下方间距 */
}

section .main-body{
    font-size: 1.3rem;   /* 正文字号 */
    font-weight: 400;    /* 常规粗细 */
    line-height: 2rem; /* 行高与字号一致（注：通常建议行高略大于字号以增加易读性） */
}


.bg-gradient-primary-to-secondary-light {
    background: linear-gradient(45deg, #fcfcfc, #ffffff) !important;
}

.bg-gradient-primary-to-secondary-gray {
    background: linear-gradient(45deg, #f0f0f0, #f1f1f1) !important;
}



.on-top {
    position: relative;
    z-index: 10000;
}

.top-bg {
    background-position: center;
    background-size: fill;
    width: 100%;
    height: 100%;
}

.top-bg::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}


#avatar {
    position: relative;
    height: 0;
    top:min(-65px,max(-100px,calc(-1*100vw/12)));
    max-width: 55em;
    margin: 0 1.5rem 0 0;
    float: right;
    z-index: 9000;
}

#avatar img {
    height: max(130px,min(200px,calc(100vw/6)));
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.2);
}

@media screen and (max-width: 991px) {
    #avatar {
        margin: 0;
    }
}

/* =========================
   Email toggle + copy
   ========================= */

.email-container {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 0;
}

.email-icon {
    cursor: pointer;
    font-size: 1rem;
    color: var(--h-title-color);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.email-icon:hover {
    transform: scale(1.15);
    opacity: 0.85;
}

.email-text {
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.6rem;
    color: var(--h-title-color);
    cursor: pointer;
}

/* 复制成功提示 */
.email-text.copied::after {
    content: "  ✔ Copied";
    font-size: 0.95rem;
    color: #2e7d32;
    margin-left: 0.4rem;
}

.email-item {
    cursor: pointer;
}

.email-item:hover {
    text-decoration: underline;
}
.email-item.copied::after {
    content: "  ✔ Copied";
    font-size: 0.95rem;
    color: #2e7d32;
    margin-left: 0.4rem;
}


/* ===== 右侧导航功能区 ===== */
/* 右侧导航整体靠右 */
#navbar-right-section {
  margin-left: auto;           /* 关键：把右侧部分推到最右边 */
  align-items: center;
  gap: 0.5rem;                 /* 三部分间距，可调 */
}

/* 搜索框 */
#nav-search-input {
  width: 120px;                /* 宽度可调 */
  font-size: 0.85rem;          /* 字体大小 */
}
#nav-search-form button {
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
}

/* 中英文切换按钮 */
.lang-switch button {
  font-size: 0.75rem;
  color: #7b7c7d;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}
.lang-switch button.active {
  background-color: #797979;
  color: #fff;
}

/* 社交图标 */
.nav-social-links .social-icon i {
  font-size: 1rem;
  color: #7b7c7d;
  transition: all 0.2s ease;
}
.nav-social-links .social-icon:hover i {
  color: #858587;
}

/* ===== 导航栏链接高亮 ===== */
.navbar-nav .nav-link.active {
  color: var(--bs-blue) !important;
  font-weight: 600;
  border-bottom: 2px solid var(--bs-blue);
  padding-bottom: 0.3rem;
}

.navbar-nav .nav-link.active:hover {
  color: var(--bs-blue) !important;
}

/* 小屏幕响应式 */
@media (max-width: 991px) {
  #navbar-right-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    margin-top: 0.5rem;
  }
  #nav-search-input {
    width: 100px;
  }
}


