:root {
  --font-size: 18px;
  --circle-size: 30px;
}

/* 主体样式 */
body {
  font-family: Arial, sans-serif;
  background-color: #a38f8f;
  color: #333;
  margin: 0;
  padding: 20px;
}

/* 项目列表容器样式 */
ul {
  list-style: none;
  width: 40%;
  border-radius: 10px;
  background: linear-gradient(to bottom, #fb5b5b, #d54242, #c73838);
  padding: 20px;
  color: white;
  font-family: Arial, sans-serif;
  margin: 10px auto; /* 居中 */
  counter-reset: list-counter; /* 初始化计数器 */
}

/* 标题样式 */
ul:before {
  content: "我的 Web 项目练手集合";
  display: block;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 10px;
  text-align: center;
  color: #333;
}

/* 列表项样式 */
ul li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  counter-increment: list-counter; /* 每个列表项增加计数器 */
  transition: background-color 0.25s ease-in-out; /* 添加背景颜色平滑过渡效果 */
}

ul li:last-child {
  border-bottom: none;
}

/* 列表项排名样式 */
ul li:before {
  content: counter(list-counter) "";
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: var(--circle-size);
  height: var(--circle-size);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: var(--font-size);
  margin-right: 20px;
  margin-left: 10px;
  transition: font-size 0.35s ease-in-out; /* 添加字体大小平滑过渡效果 */
}

/* 列表项链接样式 */
ul li a {
  color: white;
  text-decoration: none;
  flex: 1;
  transition: font-size 0.35s ease-in-out; /* 添加字体大小平滑过渡效果 */
}

ul li:hover {
  background-color: rgba(1, 0, 5, 0.2);
  --font-size: 20px; /* 字体大小变化 */
  --circle-size: 40px; /* 圆圈大小变化 */
}

ul li:hover a {
  font-size: 19px; /* 字体大小变化 */
  text-decoration: underline;
}
