/* 基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft YaHei", sans-serif;
}

p img {
  margin-top: 8px;
}

.color-orange {
  color: var(--color-orange);
}

.img-box {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 12px;
}

.img-box img {
  margin: 8px 0;
  border: 1px solid #ddd;
}

.img-box-group {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
}

.img-box-group > img,
.img-box-group .img-box,
.img-box-group div {
  width: 50%;
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  border-radius: 12px;
}
.w33 {
  width: 33% !important;
}
.img-box-group > img {
  height: fit-content;
}
.img-box-group .center-text {
  background: red;
}

.ul-cyan {
  margin-left: 28px;
}
.ul-cyan li {
  font-size: 14px;
  color: #0e8773;
  list-style-type: disc !important;
}

.ul-red {
  margin-left: 28px;
}
.ul-red li {
  font-size: 14px;
  color: #f32708;
  list-style-type: disc !important;
}

.ul-orange {
  margin-left: 28px;
}
.ul-orange li {
  font-size: 14px;
  color: rgb(247, 98, 34);
  list-style-type: disc !important;
}

@media screen and (max-width: 768px) {
  .img-box-group .img-box {
    padding: 0px;
    width: 100%;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  font-size: 1.6rem; /* 添加基础字体大小 */
}

.img-center {
  width: 100%;
  text-align: center;
}

.container {
  margin: 0 auto;
  padding: 2rem;
  margin-top: 8rem;
}

/* 公共样式 */
.tips-yellow {
  background-color: #f7f2d989;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #f6eab1;
}

.tips-green {
  background-color: #f3f9f1;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #d9e8d2;
}

.tips-gray {
  background-color: #ebe9e9e4;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #dfdfdf;
}

.tips-red {
  background-color: #f67e7e67;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #f58181;
}

/* 导航样式 */
.nav-menu {
  background: #fff;
  padding: 2rem 0;
  box-shadow: 0 0.2rem 0.4rem rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.nav-menu ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 3rem;
}

.nav-menu a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: color 0.3s;
  font-size: 1.6rem;
}

/* 激活状态的导航链接样式 - 只保留颜色变化 */
.nav-menu a.active {
  color: #f68;
  font-weight: 600; /* 可选：增加字重来强调 */
}

/* 移除之前的下划线相关样式 */
.nav-menu a.active::after {
  display: none;
}

.nav-menu a:hover {
  color: #f68;
}

/* 内容样式 */
section {
  margin-bottom: 4rem;
  padding: 2rem;
  background: #fff;
  border-radius: 0.8rem;
  box-shadow: 0 0.2rem 0.4rem rgba(0, 0, 0, 0.1);
  border: 1px solid var(--color-card-border);
}

h1 {
  color: #f68;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 0.2rem solid #eee;
  font-size: 2.6rem;
  text-align: center;
}

h2 {
  margin-bottom: 10px;
  margin-top: 20px;
  color: #05ba9c;
  font-size: 2.2rem;
}

h3 {
  margin-bottom: 10px;
  margin-top: 20px;
  color: #1fbcf0;
  font-size: 1.9rem;
}

h4 {
  font-size: 1.8rem;
}

p {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 1.6rem;
}

/* 移动端导航按钮 */
.nav-toggle {
  display: none;
  position: fixed;
  bottom: 0.8rem;
  right: 0.4rem;
  z-index: 1000;
  cursor: pointer;
  font-size: 2.4rem;
}

.nav-header {
  display: none;
}

/* 响应式设计 */
@media (min-width: 768px) {
  /* 当侧边栏显示时的样式 */
  .container.with-sidebar {
    margin-left: 200px;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  img {
    max-width: 100%;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    left: -25rem;
    width: 25rem;
    height: 100vh;
    padding: 2rem;
    transform: translateX(-100%);
    box-shadow: 0.2rem 0 0.8rem rgba(0, 0, 0, 0.1);
    z-index: 1002;
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-menu ul {
    flex-direction: column;
    gap: 0.5rem;
  }

  .nav-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 2rem;
  }

  .close-nav {
    font-size: 2.4rem;
    cursor: pointer;
  }

  .container {
    margin-top: 2rem;
  }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
  body {
    background: #1a1a1a;
    color: #fff;
  }

  .nav-menu,
  section {
    background: #2d2d2d;
  }

  .nav-menu a {
    color: #fff;
  }

  h1 {
    color: #fff;
    border-bottom-color: #444;
  }

  /* 暗色模式下的高亮样式 */
  .nav-menu a.active {
    color: #f68;
  }
}

/* 导航打开时的遮罩 */
body.nav-open::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

/* 优化移动端导航样式 */
.menu-icon {
  display: block;
  width: 4rem;
  height: 4rem;
  line-height: 4rem;
  text-align: center;
  background: #fff;
  border-radius: 0.4rem;
  box-shadow: 0 0.2rem 0.4rem rgba(0, 0, 0, 0.1);
}

.nav-menu {
  transition: transform 0.3s ease, left 0.3s ease;
}

@media (max-width: 768px) {
  .nav-menu {
    transform: translateX(-100%);
    box-shadow: 0.2rem 0 0.8rem rgba(0, 0, 0, 0.1);
  }

  .nav-menu.active {
    transform: translateX(0);
  }

  .close-nav {
    width: 4rem;
    height: 4rem;
    line-height: 4rem;
    text-align: center;
    border-radius: 0.4rem;
    background: #f5f5f5;
  }

  .nav-menu ul {
    margin-top: 2px;
  }

  .nav-menu a {
    display: block;
    padding: 1.2rem 0.5rem;
    border-radius: 0.4rem;
  }

  .nav-menu a:hover {
    background: #f5f5f5;
  }
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
  .menu-icon {
    background: #2d2d2d;
    color: #fff;
  }

  .close-nav {
    background: #3d3d3d;
    color: #fff;
  }

  .nav-menu a:hover {
    background: #3d3d3d;
  }
}

.ul-list {
  list-style-type: disc;
  margin-left: 3rem;
}

.ul-list li {
  list-style: circle;
}

.list-small {
  color: #0e8773;
  font-size: 14px;
  margin-left: 12px;
}
.list-small2 {
  color: #45988b;
  font-size: 14px;
  margin-left: 24px;
}

/* fretboard-chord */
.pic-title {
  color: #05ba9c !important;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  margin-top: 32px;
}

/* 主内容区域调整 */
.container {
  margin-left: 0; /* 默认无边距 */
}

/* 移动端才添加过渡效果 */
@media screen and (max-width: 768px) {
  .container {
    transition: margin-left 0.3s ease-out;
  }
}

/* 侧边栏导航样式 */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 200px;
  height: 100%;
  background: #fff;
  border-right: 1px solid #eee;
  padding-top: 80px;
  overflow-y: auto;
  display: none;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  padding: 0;
  cursor: pointer;
  transition: all 0.3s;
  border-bottom: 1px solid #f0f0f0;
}

.sidebar-nav li:last-child {
  border-bottom: none;
}

.sidebar-nav li a {
  color: #333;
  text-decoration: none;
  font-size: 14px;
  display: block;
  padding: 8px 20px 8px 30px;
  width: 100%;
}

.sidebar-nav li:hover {
  background: #f3f9f1;
}

.sidebar-nav li:hover a {
  color: #52c41a;
}

.sidebar-nav li.active {
  background: #f3f9f1;
  border-right: 3px solid #52c41a;
}

.sidebar-nav li.active a {
  color: #52c41a;
}

/* PC端隐藏顶部导航的二级菜单 */
@media screen and (min-width: 769px) {
  .nav-menu .submenu {
    display: none !important;
  }

  .nav-menu .has-submenu > a:after {
    display: none;
  }
}

/* 移动端样式 */
@media screen and (max-width: 768px) {
  .sidebar {
    display: none !important;
  }

  .container {
    margin-left: 0;
  }

  /* 移动端二级菜单样式 */
  .nav-menu .submenu {
    max-height: 0;
    overflow: hidden;
    padding-left: 20px;
    background: #f5f5f5;
    transition: max-height 0.3s ease-out;
  }

  .nav-menu .has-submenu.active .submenu {
    max-height: 500px; /* 设置一个足够大的高度 */
  }

  /* 增加选择器优先级，确保箭头显示 */
  .nav-menu .has-submenu > a:after,
  .nav-menu .has-submenu.active > a:after {
    content: "▼";
    font-size: 12px;
    margin-left: 5px;
    display: inline-block !important; /* 强制显示 */
  }

  .nav-menu .has-submenu.active > a:after {
    content: "▲";
  }
}
