/* 基本样式 */
* { 
  box-sizing: border-box; /* 所有元素的边框和内边距都包含在元素的宽度和高度内，避免意外尺寸变化 */
  font-family: "微软雅黑", sans-serif; /* 设置全局字体为微软雅黑 */
  color: #f1f1f1; /* 文字颜色 */
}

/* 统一的标题样式 */
h1, h2, h3 {
  font-weight: bold;
}

h1 {
  font-size: 2em;
}

h2 {
  font-size: 1.5em;
}

h3 {
  font-size: 1.2em;
}

/* 正文文本样式 */
p {
  font-size: 1em;
}

body {
  padding: 10px; /* 页面内容与浏览器边缘的距离 */
  background: #181818; /* 页面背景色 */
}

/* 页眉Blog标题 */
.header {
  padding: 15px; /* 内边距 */
  text-align: center; /* 页眉内容居中 */
  background: #333; /* 页眉背景颜色 */
  border-radius: 5px; /* 圆角效果 */
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); /* 阴影效果 */
}

/* 上导航栏 */
.nav {
  display: flex; /* 使用flex布局 */
  background: #333; /* 导航栏背景颜色 */
  border-radius: 5px; /* 圆角效果 */
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); /* 阴影效果 */
  margin-top: 20px; /* 上外边距 */
}

/* 导航链接样式 */
.nav a {
  float: left; /* 左浮动 */
  font-weight: bold; /* 字体加粗 */
  display: block; /* 变为块级元素 */
  text-align: center; /* 文本居中 */
  padding: 14px 16px; /* 内边距 */
  text-decoration: none; /* 去除下划线 */
  
}

/* 鼠标悬停时的链接样式 */
.nav a:hover {
  transition: background-color 0.3s ease, transform 0.3s ease; /* 鼠标悬停时的平滑过渡 */
  background: linear-gradient(135deg, #638dcd, #7baffe); /* 渐变背景 */
  transform: scale(1.1); /* 放大效果 */
  border-radius: 5px; /* 圆角 */
}

/* 布局样式：左右列布局 */
.leftcolumn {   
  float: left; 
  width: 75%; /* 左列占据75%的宽度 */
}
.rightcolumn {
  float: left;
  width: 25%; /* 右列占据25%的宽度 */
  padding-left: 20px; /* 给右列添加左边距 */
}

/* 文章卡片样式 */
.card {
  background-color: #333; /* 卡片背景颜色 */
  padding: 20px; /* 内边距 */
  margin-top: 20px; /* 顶部外边距 */
  border-radius: 5px; /* 圆角效果 */
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); /* 阴影效果 */
}

/* 清除浮动 */
.row:after { 
  content: ""; /* 生成一个空内容 */
  display: table; /* 创建一个块级元素 */
  clear: both; /* 清除浮动 */
}

/* 各类色块 */
.color-block {
  width: 100%; /* 宽度100% */
  padding: 20px; /* 内边距 */
  box-sizing: border-box; /* 包含内边距和边框 */
  border-radius: 5px;
}

/* 不同颜色 */
.color-blue   { background-color: rgba(123, 175, 254, 0.7); }
.color-yellow { background-color: rgba(245, 194, 75, 0.7);  color: #333; }
.color-red    { background-color: rgba(245, 75, 126, 0.7); }
.color-green  { background-color: rgba(126, 245, 75, 0.7);  color: #333; }
.color-miku   { background-color: rgba(75, 245, 194, 0.7);  color: #333; }
.color-orange { background-color: rgba(194, 75, 245, 0.7); }
.color-gray   { background-color: rgba(204, 204, 204, 0.7); color: #333; }

/* 按钮样式 */
.button {
  width: 100%;
  background: #638dcd; /* 按钮背景色 */
  border: none; /* 去除边框 */
  padding: 10px 22px; /* 内边距 */
  text-align: center; 
  text-decoration: none; /* 去除文本下划线 */
  display: inline-block; /* 行内块级元素 */
  border-radius: 5px; /* 圆角效果 */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 轻微阴影 */
  cursor: pointer; /* 鼠标悬停时变为手指形态 */
  transition: background 0.2s; /* 背景色平滑过渡效果 */
}

/* 按钮悬停效果 */
.button:hover {
  box-shadow: 0 8px 24px rgba(99,141,205,0.18);
  transform: scale(1.0) translateY(-2px); /* 微缩放+浮起 */
  transition: background 0.2s, box-shadow 0.3s, transform 0.2s;
}

/* 输入框样式 */
input {
  width: 100%;                       /* 输入框宽度占比 */
  padding: 10px;                    /* 内边距，增加输入框的点击区域 */
  margin: 20px 0;                   /* 上下间距 */
  font-size: 1rem;                  /* 字体大小 */
  border: 2px solid #ddd;          /* 默认边框为浅灰色 */
  border-radius: 5px;              /* 边框圆角 */
  box-sizing: border-box;          /* 包含内边距和边框的宽度计算 */
  transition: all 0.3s ease;        /* 平滑过渡效果 */
  color: #222;                      /* 输入框内文字颜色更深，更易读 */
/* 输入框占位符文字颜色更深 */
input::placeholder {
  color: #888;
  opacity: 1;
}
}

/* 输入框获得焦点时的样式 */
input:focus {
    border-color: #638dcd;            /* 焦点时边框变蓝 */
    outline: none;                    /* 去除默认的外部轮廓 */
}

/* 置顶按钮样式 */
    #topBtn {
      position: fixed; /* 固定在屏幕上 */
      bottom: 20px; /* 距离底部20px */
      right: 20px; /* 距离右侧20px */
      background-color: rgba(0, 0, 0, 1); /* 按钮背景颜色 */
      color: white; /* 按钮文字颜色 */
      padding: 10px; /* 内边距 */
      border: none; /* 无边框 */
      border-radius: 5px; /* 圆角边框 */
      cursor: pointer; /* 鼠标悬停时显示手型 */
    }
    #topBtn:hover {
      background-color: rgba(0, 0, 0, 0.2); /* 鼠标悬停时颜色变淡 */
    }

/* 页脚样式 */
.footer {
  padding: 10px;
  text-align: center;
  background: #333; /* 背景色 */
  margin-top: 20px; /* 顶部外边距 */
}

/* 响应式布局：当屏幕宽度小于800px时，左右列布局变为单列 */
@media screen and (max-width: 800px) {
  .leftcolumn, .rightcolumn {   
    width: 100%; /* 变为100%的宽度 */
    padding: 0;
  }
}

/* 响应式布局：当屏幕宽度小于400px时，导航栏链接堆叠 */
@media screen and (max-width: 400px) {
  .nav a {
    float: none; /* 清除浮动 */
    width: 100%; /* 使每个链接占据100%的宽度 */
  }
}


/* ======== 项目符号列表 ======== */
ul {
  list-style-type: disc; /* 项目符号为圆点 */
  margin-left: 20px; /* 左外边距 */
}

/* 列表项样式 */
ul li {
  font-size: 1em; /* 列表项字体大小 */
  margin-bottom: 8px; /* 列表项之间的间距 */
}

/* ======== 有序列表样式 ======== */
ol {
  margin-left: 20px;
}

/* 有序列表项样式 */
ol li {
  font-size: 1em; /* 列表项字体大小 */
  margin-bottom: 8px; /* 列表项之间的间距 */
}

/* ======== 折叠列表（可折叠的内容）======== */
details {
  margin-bottom: 10px;
  padding: 10px;
  background: #333; /* 背景色 */
  border-radius: 5px;
}

/* 折叠列表标题样式 */
summary {
  font-weight: bold;
  cursor: pointer;
  background: #4f4f4f; /* 背景色 */
  padding: 5px;
  border-radius: 5px;
}

/* 折叠列表内容样式 */
details[open] {
  background: #444;
}

/* ======== 引用样式 ======== */
blockquote {
  font-style: italic;
  padding: 10px 20px;
  background: #333;
  border-left: 5px solid #7baffe; /* 左侧边框 */
  margin: 15px 0;
}


/* ======== 无序列表样式 ======== */
.card ul {
  list-style: none; /* 去除默认的圆点样式 */
  padding: 0; /* 去除内边距 */
  margin: 0; /* 去除外边距 */
}

/* ======== 一级列表项样式 ======== */
.card ul > li {
  margin: 0.5rem 0; /* 每个列表项上下的间距 */
}

/* ======== 链接样式 ======== */
.card a {
  text-decoration: none; /* 去除默认的下划线 */
  color: #638dcd; /* 链接文字颜色 */
  font-weight: bold; /* 设置加粗字体 */
  transition: color 0.3s ease; /* 设置颜色变换动画，持续时间0.3秒，缓慢过渡 */
}

/* 悬停时的链接效果 */
.card a:hover {
  color: #4b7ef5; /* 鼠标悬停时链接文字变色 */
}

/* ======== 嵌套列表样式 ======== */
.card ul ul {
  margin-top: 0.5rem; /* 嵌套列表与上一层列表的间距 */
  padding-left: 1.5rem; /* 嵌套列表向右缩进 */
  border-left: 2px solid #ddd; /* 在嵌套列表左侧添加浅灰色边框 */
}

/* 嵌套列表项样式 */
.card ul ul > li {
  margin: 0.4rem 0; /* 设置每个嵌套列表项上下间距 */
  font-size: 0.95rem; /* 调整嵌套列表项字体稍小 */
}

/* ======== 表格样式 ======== */
table {
    width: 100%; /* 表格宽度 */
    border-collapse: collapse; /* 去掉单元格间距 */
    margin-top: 10px; /* 表格顶部间距 */
}

th, td {
    border: 1px solid #444; /* 单元格边框 */
    padding: 8px; /* 单元格内边距 */
    text-align: left; /* 文本左对齐 */
}

th {
    background-color: #333; /* 表头背景色 */
    color: #7baffe; /* 表头文字颜色 */
}

tr:nth-child(odd) {
    background-color: #3a3a3a; /* 奇数行背景色 */
}

tr:nth-child(even) {
    background-color: #2b2b2b; /* 偶数行背景色 */
}

tr:hover {
    background-color: #555; /* 鼠标悬停时的背景色 */
}
