@charset "utf-8";

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  line-height: 1.6;
  background-color: #fafafa;
  color: #333;
  font-family: "微软雅黑", "PingFang SC", "Source Han Sans", "Helvetica", "Arial", sans-serif;
}

a {
  color: #007bff;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* 左侧导航栏 */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100%;
  background: linear-gradient(180deg, #4da6ff 0%, #007bff 100%);
  color: white;
  padding: 20px;
  overflow-y: auto;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* 上下居中 */
  box-shadow: 2px 0 8px rgba(0,0,0,0.1);
  z-index: 1000;
}

nav img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin-bottom: 20px;
  border: 3px solid transparent;
  background: linear-gradient(white, white) padding-box, linear-gradient(135deg, #4da6ff, #007bff) border-box;
  box-shadow: 0 0 15px rgba(77,166,255,0.5); /* 光晕 */
  transition: transform 0.3s, box-shadow 0.3s;
}

nav img:hover {
  transform: scale(1.1);
  box-shadow: 0 0 25px rgba(77,166,255,0.7);
}

nav ul {
  list-style: none;
  width: 100%;
  padding-left: 0;
}

nav li {
  margin: 10px 0;
  text-align: center;
}

nav li hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.3);
  margin: 10px 0;
}

nav a {
  display: block;
  padding: 6px 10px;
  color: white;
  font-weight: 600;
  border-radius: 5px;
  transition: background 0.3s;
}

nav a:hover {
  background-color: rgba(255,255,255,0.2);
}

nav a.active {
  background-color: rgba(255,255,255,0.45);
  color: #fff;
  font-weight: bold;
}

/* 内容区域 */
.container {
  margin-left: 240px;
  padding: 20px;
}

section {
  margin-bottom: 50px;
}

h1, h2, h3 {
  margin-bottom: 10px;
  font-weight: bold;
  text-transform: uppercase; /* 将文字全部大写 */
}

h1 {
  font-size: 4rem;
}

h2 {
  font-size: 1.8rem;
  border-bottom: 2px solid #007bff;
  padding-bottom: 5px;
  margin-bottom: 20px;
}

h3 {
  font-size: 1.2rem;
  color: #007bff;
  margin-top: 20px;
}

.subheading {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 30px;
  text-transform: uppercase; /* 将文字全部大写 */
}

p {
  margin-bottom: 15px;
}

.resume-item {
  margin-top: 60px;
  margin-bottom: 30px;
}

/* 最新文章列表 */
#newarticle ul {
  list-style: none;
  padding-left: 0;
}
#newarticle li {
  margin-bottom: 8px;
}

/* 底部 */
footer {
  margin-left: 240px;
  padding: 20px;
  font-size: 0.85rem;
  color: #666;
  border-top: 1px solid #ccc;
}

footer a {
  color: #007bff;
}

/* ========== 响应式优化 ========== */
@media (max-width: 768px) {
  nav {
    position: relative;
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
  }

  nav img {
    width: 50px;
    height: 50px;
    margin: 0;
  }

  nav ul {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    width: auto;
  }

  nav li {
    margin: 0;
  }

  .container {
    margin-left: 0;
    padding: 10px;
  }

  footer {
    margin-left: 0;
    padding: 10px;
  }

  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1rem; }
}

/* 🌙 黑暗模式自动启用 */
@media (prefers-color-scheme: dark) {
  html, body {
    background-color: #121212; /* 深色背景 */
    color: #e0e0e0; /* 默认文字改亮 */
  }

  /* 表格、卡片、内容块 */
  table, .card, .content, section, div {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
    border-color: #333 !important;
  }

  /* 表格行交替颜色 */
  .evenRow {
    background-color: #1a1a1a !important;
  }

  .oddRow {
    background-color: #222 !important;
  }

  .activeRow {
    background-color: #2a2a2a !important;
  }

  /* 链接颜色 */
  a {
    color: #80bfff !important;
  }
  a:hover {
    color: #a0d0ff !important;
  }

  /* 标题调亮一些 */
  h1, h2, h3, h4, h5 {
    color: #ffffff !important;
  }

  /* 按钮与输入框 */
  button, input, select, textarea {
    background-color: #2b2b2b !important;
    color: #f0f0f0 !important;
    border: 1px solid #444 !important;
  }

  /* 边框与分割线 */
  hr, .line, .border {
    border-color: #333 !important;
  }

  /* 导航栏优化 */
  nav {
    background: linear-gradient(180deg, #222 0%, #111 100%) !important; /* 深色渐变 */
    color: #eee !important;
    box-shadow: 2px 0 8px rgba(0,0,0,0.3) !important; /* 保留阴影 */
  }

  /* 导航链接 */
  nav a {
    color: #80bfff !important; /* 亮蓝色，保证可读性 */
    font-weight: 600;
  }

  nav a:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
  }

  nav a.active {
    background-color: rgba(255, 255, 255, 0.25) !important;
  }

  /* 导航分割线 */
  nav hr {
    border-color: #444 !important;
  }

  /* 导航头像阴影 */
  nav img {
    box-shadow: 0 0 15px rgba(77,166,255,0.7) !important;
  }

  /* 页脚 */
  footer {
    background-color: #181818 !important;
    color: #aaa !important;
    border-top: 1px solid #333 !important;
  }
}