/* 使用CDN导入霞鹜文楷 */
@import url("https://cdn.jsdelivr.net/npm/lxgw-wenkai-webfont@1.6.0/style.css");

/* 不再使用 * 选择器设置字体，避免影响 MathJax */
body {
  font-family: 
    "LXGW WenKai",
    "PingFang SC",
    "Microsoft YaHei",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  transition: background-color 0.3s, color 0.3s;
}

/* 确保常用文本元素继承 body 字体 */
p, div, span, li, ul, ol, td, th, label, button, input, textarea, blockquote, pre, code, a, h1, h2, h3, h4, h5, h6 {
  font-family: inherit;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600; /* 正常加粗 */
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

/* 关键：重置 MathJax 公式字体，防止被霞鹜文楷影响 */
.mjx-chtml,
.MathJax,
.MathJax_CHTML {
  font-family: MJXZERO, MJXTEX, MJXTEX-I, MJXTEX-S1, serif !important;
}

/* 定义全局颜色变量 */
      :root {
        --bg-color: #ffffff;
        --text-color: #333333;
        --primary-color: #4a6fa5;
        --secondary-color: #f8f9fa;
        --nav-bg: #f1f1f1;
        --card-shadow: rgba(0, 0, 0, 0.1);
      }

      .dark-mode {
        --bg-color: #1a1a1a;
        --text-color: #f8f9fa;
        --primary-color: #6c8fc7;
        --secondary-color: #2d2d2d;
        --nav-bg: #2a2a2a;
        --card-shadow: rgba(255, 255, 255, 0.1);
      }

      .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 20px;
      }

      /* 导航栏样式 */
      .navbar {
        background-color: var(--nav-bg);
        padding: 15px 0;
        position: sticky;
        top: 0;
        z-index: 1000;
        box-shadow: 0 2px 5px var(--card-shadow);
      }

      .nav-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
      }

      .nav-logo {
        font-size: 1.5rem;
        font-weight: bold;
        color: var(--primary-color);
        text-decoration: none;
      }

      .nav-menu {
        display: flex;
        list-style: none;
        margin: 0;
        padding: 0;
      }

      .nav-item {
        margin-left: 20px;
      }

      .nav-link {
        color: var(--text-color);
        text-decoration: none;
        font-weight: 500;
        transition: color 0.3s;
      }

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

      .mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px 12px; /* 增加内边距，扩大点击范围 */
}

      /* 卡片样式 */
      .card {
        background-color: var(--secondary-color);
        border-radius: 8px;
        padding: 25px;
        margin-bottom: 30px;
        box-shadow: 0 4px 6px var(--card-shadow);
        transition: transform 0.3s, box-shadow 0.3s;
      }

      .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 6px 12px var(--card-shadow);
      }

      .card-title {
        color: var(--primary-color);
        margin-top: 0;
        border-bottom: 2px solid var(--primary-color);
        padding-bottom: 10px;
      }

      /* 技能图表 */
      .skill-container {
        margin-bottom: 15px;
      }

      .skill-name {
        display: inline-block;
        width: 120px;
        font-weight: bold;
      }

      .skill-bar {
        display: inline-block;
        height: 10px;
        background-color: #ddd;
        border-radius: 5px;
        width: calc(100% - 130px);
        overflow: hidden;
      }

      .skill-level {
        height: 100%;
        background-color: var(--primary-color);
        border-radius: 5px;
      }

      /* 夜间模式切换 */
      .toggle-container {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1000;
      }

      .toggle-btn {
        background-color: var(--primary-color);
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: background-color 0.3s;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
      }

      .toggle-btn:hover {
        opacity: 0.9;
      }

      .icon {
        width: 16px;
        height: 16px;
      }

      /* 返回顶部按钮 */
      .back-to-top {
        position: fixed;
        bottom: 80px;
        right: 20px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background-color: var(--primary-color);
        color: white;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
        z-index: 1000;
      }

      .back-to-top.visible {
        opacity: 1;
        visibility: visible;
      }

      .back-to-top:hover {
        background-color: #3a5a8a;
      }

      /* 响应式设计 */
      @media (max-width: 768px) {
        .avatar {
          width: 120px;
          height: 120px;
        }
        .nav-menu {
          display: none;
          flex-direction: column;
          position: absolute;
          top: 60px;
          left: 0;
          right: 0;
          background-color: var(--nav-bg);
          padding: 20px;
        }

        .nav-menu.active {
          display: flex;
        }

        .nav-item {
          margin: 10px 0;
        }

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

        .skill-name {
          display: block;
          width: 100%;
          margin-bottom: 5px;
        }

        .skill-bar {
          width: 100%;
        }
      }
      .avatar-container {
        text-align: center;
        margin-bottom: 20px;
      }

      .avatar {
        width: 150px;
        height: 150px;
        border-radius: 50%;
        object-fit: cover;
        border: 3px solid var(--primary-color);
        box-shadow: 0 4px 8px var(--card-shadow);
        transition: transform 0.3s;
      }

      .avatar:hover {
        transform: scale(1.05);
      }
      .simple-contact {
  font-family: "LXGW WenKai", sans-serif; /* 统一用文楷，删除Arial */
  background-color: var(--secondary-color); /* 跟随全局次要背景色 */
}
        
        .contact-title {
  color: var(--primary-color); /* 跟随全局主色，更醒目 */
}
        
        .contact-line {
  background-color: var(--bg-color); /* 跟随全局背景色 */
}
        
        .contact-icon {
            width: 24px;
            height: 24px;
            margin-right: 10px;
            font-size: 16px;
            flex-shrink: 0;
            transition: all 0.3s ease;
        }
        
        .contact-text {
  color: var(--text-color); /* 跟随全局文字色 */
}
        
        .contact-link {
            color: #3498db;
            text-decoration: none;
            transition: all 0.3s ease;
        }
        
        /* 悬停效果 */
        .contact-line:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            background-color: #f0f8ff;
        }
        
        .contact-line:hover .contact-icon {
            transform: scale(1.2);
            background-color: #3498db;
            color: white;
        }
        
        .contact-line:hover .contact-text {
            color: #2c3e50;
            font-weight: 500;
        }
        
        .contact-link:hover {
            color: #2980b9;
            text-decoration: underline;
        }

        /* 平板设备响应式设计 */
        @media (max-width: 768px) {
            .simple-contact {
                max-width: 350px;
                padding: 12px;
            }
            
            .contact-title {
                font-size: 16px;
            }
            
            .contact-text {
                font-size: 13px;
            }
        }

        /* 手机设备响应式设计 */
        @media (max-width: 480px) {
            .simple-contact {
                max-width: 90%;
                margin: 10px auto;
                padding: 10px;
            }
            
            .contact-line {
                flex-direction: row;
                padding: 10px;
            }
            
            .contact-icon {
                width: 20px;
                height: 20px;
                font-size: 14px;
            }
            
            .contact-text {
                font-size: 12px;
            }
        }

        /* 超小屏幕手机响应式设计 */
        @media (max-width: 320px) {
            .simple-contact {
                border-radius: 5px;
            }
            
            .contact-line {
                padding: 8px 5px;
            }
        }
