body {
  position: relative;
  overflow-x: hidden;
  height: 100%;
}
html {
  height: 100%;
}
.nav .open > a {
  background-color: transparent;
}
.nav .open > a:hover,
.nav .open > a:focus {
  background-color: transparent;
}
#wrapper {
  padding-left: 0;
  -webkit-transition: all 0.5s ease;
  -moz-transition: all 0.5s ease;
  -o-transition: all 0.5s ease;
  transition: all 0.5s ease;
}
#wrapper.toggled {
  padding-left: 220px;
}
#sidebar-wrapper {
  z-index: 1000;
  left: 220px;
  width: 0;
  height: 100%;
  margin-left: -220px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #1a1a1a;
  -webkit-transition: all 0.5s ease;
  -moz-transition: all 0.5s ease;
  -o-transition: all 0.5s ease;
  transition: all 0.5s ease;
}
#sidebar-wrapper::-webkit-scrollbar {
  display: none;
}
#wrapper.toggled #sidebar-wrapper {
  width: 220px;
}
#page-content-wrapper {
  width: 100%;
  padding-top: 70px;
}
#wrapper.toggled #page-content-wrapper {
  position: absolute;
  margin-right: -220px;
}
.sidebar-nav {
  position: absolute;
  top: 0;
  width: 220px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sidebar-nav li {
  position: relative;
  line-height: 20px;
  display: inline-block;
  width: 100%;
}
.sidebar-nav li:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  height: 100%;
  width: 3px;
  background-color: #1c1c1c;
  -webkit-transition: width 0.2s ease-in;
  -moz-transition: width 0.2s ease-in;
  -ms-transition: width 0.2s ease-in;
  transition: width 0.2s ease-in;
}
.sidebar-nav li:first-child a {
  color: #fff;
  background-color: #1a1a1a;
}
.sidebar-nav li:nth-child(2):before {
  background-color: #ec1b5a;
}
.sidebar-nav li:nth-child(3):before {
  background-color: #79aefe;
}
.sidebar-nav li:nth-child(4):before {
  background-color: #314190;
}
.sidebar-nav li:nth-child(5):before {
  background-color: #279636;
}
.sidebar-nav li:nth-child(6):before {
  background-color: #7d5d81;
}
.sidebar-nav li:nth-child(7):before {
  background-color: #ead24c;
}
.sidebar-nav li:nth-child(8):before {
  background-color: #2d2366;
}
.sidebar-nav li:nth-child(9):before {
  background-color: #35acdf;
}
.sidebar-nav li:hover:before,
.sidebar-nav li.open:hover:before {
  width: 100%;
  -webkit-transition: width 0.2s ease-in;
  -moz-transition: width 0.2s ease-in;
  -ms-transition: width 0.2s ease-in;
  transition: width 0.2s ease-in;
}
.sidebar-nav li a {
  display: block;
  color: #ddd;
  text-decoration: none;
  padding: 10px 15px 10px 30px;
}
.sidebar-nav li a:hover,
.sidebar-nav li a:active,
.sidebar-nav li a:focus {
  color: #fff;
  text-decoration: none;
  background-color: transparent;
}
.sidebar-nav li.open a:hover,
.sidebar-nav li.open a:active,
.sidebar-nav li.open a:focus {
  color: #fff;
  text-decoration: none;
  background-color: transparent;
}
.sidebar-nav > .sidebar-brand {
  height: 65px;
  font-size: 20px;
  line-height: 44px;
}
.sidebar-nav .dropdown-menu {
  position: relative;
  width: 100%;
  padding: 0;
  margin: 0;
  border-radius: 0;
  border: none;
  background-color: #222;
  box-shadow: none;
}
.hamburger {
  position: fixed;
  top: 20px;
  z-index: 999;
  display: block;
  width: 32px;
  height: 32px;
  margin-left: 15px;
  background: transparent;
  border: none;
}
.hamburger:hover,
.hamburger:focus,
.hamburger:active {
  outline: none;
}
.hamburger.is-closed:before {
  content: "";
  display: block;
  width: 100px;
  font-size: 14px;
  color: #fff;
  line-height: 32px;
  text-align: center;
  opacity: 0;
  -webkit-transform: translate3d(0, 0, 0);
  -webkit-transition: all 0.35s ease-in-out;
}
.hamburger.is-closed:hover:before {
  opacity: 1;
  display: block;
  -webkit-transform: translate3d(-100px, 0, 0);
  -webkit-transition: all 0.35s ease-in-out;
}
.hamburger.is-closed .hamb-top,
.hamburger.is-closed .hamb-middle,
.hamburger.is-closed .hamb-bottom {
  position: absolute;
  left: 0;
  height: 4px;
  width: 100%;
}
.hamburger.is-open .hamb-top,
.hamburger.is-open .hamb-middle,
.hamburger.is-open .hamb-bottom {
  position: absolute;
  left: 0;
  height: 4px;
  width: 100%;
}
.hamburger.is-closed .hamb-top {
  top: 5px;
  -webkit-transition: all 0.35s ease-in-out;
}
.hamburger.is-closed .hamb-middle {
  top: 50%;
  margin-top: -2px;
}
.hamburger.is-closed .hamb-bottom {
  bottom: 5px;
  -webkit-transition: all 0.35s ease-in-out;
}
.hamburger.is-closed:hover .hamb-top {
  top: 0;
  -webkit-transition: all 0.35s ease-in-out;
}
.hamburger.is-closed:hover .hamb-bottom {
  bottom: 0;
  -webkit-transition: all 0.35s ease-in-out;
}
.hamburger.is-open .hamb-top,
.hamburger.is-open .hamb-bottom {
  top: 50%;
  margin-top: -2px;
}
.hamburger.is-open .hamb-top {
  -webkit-transform: rotate(45deg);
  -webkit-transition: -webkit-transform 0.2s cubic-bezier(0.73, 1, 0.28, 0.08);
}
.hamburger.is-open .hamb-middle {
  display: none;
}
.hamburger.is-open .hamb-bottom {
  -webkit-transform: rotate(-45deg);
  -webkit-transition: -webkit-transform 0.2s cubic-bezier(0.73, 1, 0.28, 0.08);
}
.hamburger.is-open:before {
  content: "";
  display: block;
  width: 100px;
  font-size: 14px;
  color: #fff;
  line-height: 32px;
  text-align: center;
  opacity: 0;
  -webkit-transform: translate3d(0, 0, 0);
  -webkit-transition: all 0.35s ease-in-out;
}
.hamburger.is-open:hover:before {
  opacity: 1;
  display: block;
  -webkit-transform: translate3d(-100px, 0, 0);
  -webkit-transition: all 0.35s ease-in-out;
}
.overlay {
  position: fixed;
  display: none;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(250,250,250,0.8);
  z-index: 1;
}
#goback {
  position: fixed;
  top: 20px;
  z-index: 999;
  display: block;
  width: 32px;
  height: 32px;
  margin-left: 50px;
  background: transparent;
  border: none;
}
.japan,
.japan a,
:lang(jp) {
  font-family: "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", Osaka, "メイリオ", Meiryo, "Yu Gothic", "ＭＳ Ｐゴシック", "MS PGothic", sans-serif;
}
.hidekanji ruby rt,
.hidekanji ruby {
  background-color: #000;
}
.hidekanji ruby rt:hover,
.hidekanji ruby:hover {
  background-color: inherit;
}
.accent,
.accent0 {
  border-top: #f63 1px solid;
  padding: 1px 0px 0px 0px;
}
.accent {
  position: relative;
  white-space: nowrap;
}
.accent:after {
  content: "";
  height: 20%;
  width: 1px;
  padding: 0;
  margin: 0;
  background-color: #f63;
  position: absolute;
  top: -0.5px;
  right: -0.5px;
}
.japan.hideruby ruby rt {
  color: #fff;
}
.japan.hideruby ruby rt:hover {
  color: inherit;
}
.lesson {
  font-size: 17px;
}

/* 减少分类面板间的空白 */
.col-sm-4.col-md-3 {
  margin-bottom: 15px;
}

.panel {
  margin-bottom: 15px;
}

/* 优化数字表格的列宽 */
.numbers-table {
  width: 100%;
  table-layout: auto !important;
}

.numbers-table th,
.numbers-table td {
  padding: 8px 6px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  min-width: auto;
}

.numbers-table th {
  background-color: #f8f9fa;
  font-weight: bold;
  white-space: nowrap;
}

.number-cell {
  font-weight: bold;
  color: #007bff;
  white-space: nowrap;
}

.pronunciation-cell {
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
}

/* 响应式表格优化 */
@media (max-width: 768px) {
  .numbers-table {
    font-size: 12px;
  }
  
  .numbers-table th,
  .numbers-table td {
    padding: 4px 2px;
  }
}

/* 返回顶部按钮样式 */
.scroll-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 50px;
  height: 50px;
  background: #007bff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background: #0056b3;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.scroll-to-top:active,
.scroll-to-top.touch-active {
  transform: translateY(0) scale(0.95);
  background: #004085;
}

/* Font Awesome 箭头图标样式 - 精确居中 */
.scroll-to-top .fa {
  font-size: 18px;
  color: white;
  transition: all 0.3s ease;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  line-height: 1;
  margin: 0;
  padding: 0;
}

.scroll-to-top:hover .fa {
  transform: translate(-50%, -50%) translateY(-1px);
}

/* 备用的CSS箭头样式（如果需要的话） */
.scroll-to-top .arrow-up {
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 16px solid white;
  transition: all 0.3s ease;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .scroll-to-top {
    right: 15px;
    bottom: 15px;
    width: 45px;
    height: 45px;
  }
  
  .scroll-to-top .fa {
    font-size: 16px;
  }
  
  .scroll-to-top .arrow-up {
    border-left-width: 6px;
    border-right-width: 6px;
    border-bottom-width: 10px;
  }
}

/* 深色主题适配 */
@media (prefers-color-scheme: dark) {
  .scroll-to-top {
    background: #0d6efd;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
  }
  
  .scroll-to-top:hover {
    background: #0b5ed7;
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
  }
  
  .scroll-to-top:active,
  .scroll-to-top.touch-active {
    background: #0a58ca;
  }
}
