/* 阿里巴巴普惠体字体声明 */
@font-face {
  font-family: 'AlibabaPuHuiTi';
  src: url('../font/AlibabaPuHuiTi-3-65-Medium.eot');
  src: url('../font/AlibabaPuHuiTi-3-65-Medium.eot?#iefix') format('embedded-opentype'),
       url('../font/AlibabaPuHuiTi-3-65-Medium.woff2') format('woff2'),
       url('../font/AlibabaPuHuiTi-3-65-Medium.woff') format('woff'),
       url('../font/AlibabaPuHuiTi-3-65-Medium.ttf') format('truetype'),
       url('../font/AlibabaPuHuiTi-3-65-Medium.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  font-family: "AlibabaPuHuiTi", sans-serif;
  margin-bottom: 60px;
}

/* 神笔马良系统样式 */
.shenbi-body {
  background: linear-gradient(to bottom, #0066cc, #66ccff);
  background-repeat: no-repeat;
  background-size: auto; /* 防止背景拉伸，保持原始尺寸 */
  background-position: center center; /* 背景居中 */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: white;
  padding-top: 90px; /* 为缩小的顶部导航腾出空间 */
  padding-bottom: 40px; /* 为缩小的底部页脚腾出空间 */
  margin: 0;
  overflow-y: auto; /* 允许页面滚动 */
}

/* 固定顶部导航 */
.header-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(to right, #0066cc, #0099ff);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* 顶部导航样式 */
.logo-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* Logo链接样式 */
.logo-link {
  display: inline-block;
  text-decoration: none;
  transition: all 0.3s ease;
}

.logo-link:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.logo-link:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
  border-radius: 4px;
}

.logo {
  width: 200px;
  height: 50px;
  border-radius: 0;
  object-fit: contain;
}

@media (min-width: 768px) {
  .logo {
    width: 200px;
    height: 50px;
  }
  
  .nav-button, .login-button {
    padding: 8px 15px;
    font-size: 1rem;
  }
  
  .avatar-button {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 767px) {
  .logo {
    width: 120px;
    height: 30px;
  }
  
  .nav-button, .login-button {
    padding: 4px 8px;
    font-size: 0.8rem;
    border-radius: 15px;
    white-space: nowrap; /* 保证按钮文字不换行为竖排 */
  }
  
  .avatar-button {
    width: 26px;
    height: 26px;
  }
  
  .nav-buttons {
    gap: 5px !important;
    justify-content: flex-end !important; /* 移动端靠右 */
  }
}

.system-name {
  color: white;
  font-size: 1.5rem;
  text-align: center;
  font-weight: bold;
  letter-spacing: 3px;
  white-space: nowrap; /* 防止文本换行 */
  overflow: hidden; /* 防止溢出 */
  text-overflow: ellipsis; /* 文本溢出时显示省略号 */
}

@media (min-width: 992px) {
  .system-name {
    font-size: 2.2rem;
    letter-spacing: 4px;
  }
}

@media (max-width: 991px) {
  .system-name {
    font-size: 1.2rem;
    letter-spacing: 2px;
  }
}

@media (max-width: 767px) {
  .system-name {
    font-size: 1rem;
    letter-spacing: 1px;
  }
}

.nav-button {
  background-color: #99cc33;
  color: white;
  border: none;
  border-radius: 20px; /* 减小圆角 */
  padding: 6px 12px; /* 减小内边距 */
  font-size: 0.9rem; /* 减小文字大小 */
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-align: center;
  transition: all 0.3s ease;
  font-weight: 500;
  white-space: nowrap; /* 确保文字不换行 */
  min-width: fit-content; /* 确保按钮内容完整显示 */
  flex-shrink: 0; /* 防止按钮被压缩 */
}

.nav-button:hover {
  background-color: #88bb22;
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(136, 187, 34, 0.3);
}

.nav-button i {
  font-size: 0.8rem;
}

.login-button {
  background-color: white;
  color: #333;
  border: none;
  border-radius: 20px; /* 减小圆角 */
  padding: 6px 12px; /* 减小内边距 */
  font-size: 0.9rem; /* 减小文字大小 */
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.login-button:hover {
  background-color: #f0f0f0;
  color: #333;
  text-decoration: none;
}

.avatar-button {
  width: 30px; /* 减小头像按钮尺寸 */
  height: 30px;
  border-radius: 50%;
  border: 2px solid white;
  overflow: hidden;
}

@media (min-width: 768px) {
  .nav-button, .login-button {
    padding: 8px 15px;
    font-size: 1rem;
  }
  .avatar-button {
    width: 36px;
    height: 36px;
  }
}

.avatar-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 主内容区域 */
.main-content {
  flex: 1;
  padding: 0; /* 移除内边距 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden; /* 防止内容超出区域 */
}

/* 注册页面样式 - 严格按照图片布局 */
.register-container {
  background: rgba(0, 122, 204, 0.3);
  border-radius: 20px;
  padding: 30px 0;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 90%; /* 修改为百分比宽度，不再是100% */
  max-width: 1200px; /* 添加最大宽度限制 */
}

.register-container .container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.register-form-wrapper {
  width: 100%;
  max-width: 1000px;
  padding: 0 20px;
  display: flex;
  justify-content: center;
}

.register-form-wrapper .row {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start; /* 改为顶部对齐 */
  min-height: 400px; /* 设置最小高度 */
}

/* 右侧表单区域容器 */
.register-form-wrapper .col-md-7 {
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* 改为顶部对齐 */
  min-height: 400px; /* 与row保持一致 */
  padding-top: 0; /* 移除顶部内边距 */
}

.register-form-wrapper .col-md-5 {
  display: flex;
  flex-direction: column;
  padding-top: 0; /* 移除顶部内边距 */
}

/* 左侧区域 */
.location-selector {
  background-color: white;
  color: #333;
  padding: 15px 20px; /* 增加左右内边距 */
  border-radius: 30px;
  font-size: 1.2rem;
  text-align: center;
  width: 100%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0; /* 移除顶部边距 */
  margin-bottom: 16px; /* 与输入框间距保持一致 */
  height: 50px; /* 设置固定高度 */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.location-selector:hover {
  background-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.location-text {
  color: #0066cc;
  font-weight: bold;
  font-family: "AlibabaPuHuiTi", sans-serif;
}

.location-dropdown-wrapper {
  background-color: white;
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 340px;
  margin-top: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.location-dropdown {
  color: #666;
  font-size: 1.1rem;
  width: 100%;
  text-align: center;
}

.dropdown-arrow {
  display: inline-block;
}

.avatar-display {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0;
  width: 100%;
}

.avatar-display img {
  max-width: 150px;
  max-height: 280px;
  object-fit: contain;
}

/* 右侧表单区域 */
.form-area {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  margin-top: auto;
  margin-bottom: auto;
  padding-top: 0; /* 移除顶部内边距 */
}

.input-field {
  display: flex;
  align-items: center;
  background-color: white;
  border-radius: 30px;
  margin-bottom: 16px; /* 减小间距 */
  padding: 10px 20px;
  height: 50px; /* 确保所有输入框高度一致 */
  transition: all 0.3s ease;
}

.input-field:hover {
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.icon {
  margin-right: 15px;
  color: #0066cc;
  font-size: 1.2rem;
  width: 30px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.input-field input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.1rem;
  color: #333;
  background: transparent;
}

.form-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px; /* 添加上边距 */
}

.remember-me {
  display: flex;
  align-items: center;
  color: white;
  font-size: 1.1rem;
}

.confirm-button {
  background: #00C78C; /* 更改为青绿色 */
  color: white;
  border: none;
  border-radius: 30px;
  padding: 12px 30px;
  font-size: 1.2rem;
  cursor: pointer;
  width: 200px;
  text-align: center;
  transition: all 0.3s ease;
  font-weight: bold;
  letter-spacing: 2px;
  box-shadow: 0 4px 15px rgba(0, 199, 140, 0.3);
}

.confirm-button:hover {
  background: #00E6A2; /* 悬停时颜色变亮 */
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 199, 140, 0.4);
}

.confirm-button:active {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 199, 140, 0.3);
}

/* 媒体查询适配不同屏幕 */
@media (max-width: 768px) {
  .register-form-wrapper {
    padding: 0 10px;
  }
  
  .location-dropdown-wrapper {
    height: auto;
    margin-bottom: 20px;
  }
  
  .avatar-display img {
    max-width: 100px;
    max-height: 160px;
  }
  
  .input-field {
    padding: 8px 15px;
  }
  
  .icon {
    margin-right: 10px;
    font-size: 1rem;
  }
  
  .input-field input {
    font-size: 1rem;
  }
  
  .remember-me {
    font-size: 1rem;
  }
  
  .confirm-button {
    padding: 8px 20px;
    font-size: 1rem;
  }
}

/* 页脚样式 */
.footer-fixed {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to right, #66ccff, #0099ff);
  text-align: center;
  padding: 12px 0;
  color: white;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.footer-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

.company-name {
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.beian-link {
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.beian-link:hover {
  color: #cccccc;
  text-decoration: none;
  transform: translateY(-1px);
}

@media (min-width: 768px) {
  .footer-fixed {
    padding: 15px 0;
  }
  
  .footer-content {
    gap: 40px;
  }
  
  .company-name {
    font-size: 1rem;
  }
  
  .beian-link {
    font-size: 1rem;
  }
}

/* 移动端优化 */
@media (max-width: 767px) {
  .footer-fixed {
    padding: 10px 0;
  }
  
  .footer-content {
    flex-direction: row;
    gap: 15px;
  }
  
  .company-name {
    font-size: 0.8rem;
  }
  
  .beian-link {
    font-size: 0.8rem;
  }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* 自定义样式 */
.navbar-brand {
  font-weight: bold;
  font-size: 1.5rem;
}

.card {
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.display-4 {
  color: white;
  margin-bottom: 1.5rem;
  font-family: "AlibabaPuHuiTi", sans-serif;
}

/* 移动端首页字体优化 */
@media (max-width: 767px) {
  .display-4 {
    font-size: 1.8rem !important; /* 移动端字体大小优化 */
    line-height: 1.3;
    margin-bottom: 1rem;
  }
  
  .home-title {
    font-size: 1.5rem !important;
    line-height: 1.4;
    margin-bottom: 0.8rem;
  }
  
  .home-subtitle {
    font-size: 1.2rem !important;
    line-height: 1.3;
    margin-bottom: 0.6rem;
  }
}

@media (max-width: 480px) {
  .display-4 {
    font-size: 1.6rem !important; /* 超小屏幕进一步优化 */
    line-height: 1.2;
    margin-bottom: 0.8rem;
  }
  
  .home-title {
    font-size: 1.3rem !important;
    line-height: 1.3;
    margin-bottom: 0.6rem;
  }
  
  .home-subtitle {
    font-size: 1rem !important;
    line-height: 1.2;
    margin-bottom: 0.5rem;
  }
}

h1, h2, h3, h4, h5, h6 {
  font-family: "AlibabaPuHuiTi", sans-serif;
}

/* 首页下载按钮样式 */
.btn-download-home {
  background-color: #99cc33;
  color: white;
  border: none;
  border-radius: 25px;
  padding: 15px 30px;
  font-size: 1.2rem;
  font-weight: bold;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(153, 204, 51, 0.3);
  letter-spacing: 1px;
  min-width: 180px;
  justify-content: center;
}

.btn-download-home:hover {
  background-color: #88bb22;
  color: white;
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(153, 204, 51, 0.4);
}

.btn-download-home:active {
  transform: translateY(-1px);
  box-shadow: 0 3px 15px rgba(153, 204, 51, 0.3);
}

.btn-download-home i {
  font-size: 1.1rem;
}

/* 下载区域样式 */
.download-section {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.download-hint {
  font-size: 0.95rem;
  margin-top: 0.8rem;
}

/* 移动端下载按钮优化 */
@media (max-width: 767px) {
  .btn-download-home {
    padding: 12px 24px;
    font-size: 1.1rem;
    min-width: 160px;
  }
  
  .btn-download-home i {
    font-size: 1rem;
  }
  
  .download-section {
    margin-top: 1.5rem;
  }
  
  .download-hint {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .btn-download-home {
    padding: 10px 20px;
    font-size: 1rem;
    min-width: 140px;
  }
  
  .btn-download-home i {
    font-size: 0.9rem;
  }
  
  .download-hint {
    font-size: 0.85rem;
  }
}

/* 性别单选按钮样式 */
.gender-radio-group {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.gender-label {
  font-size: 1.1rem;
  color: #333;
  margin-right: 10px;
}

.gender-radio {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-bottom: 0;
  padding: 5px 10px;
  border-radius: 15px;
  transition: all 0.2s ease;
}

.gender-radio:hover {
  background-color: rgba(0, 102, 204, 0.1);
}

.gender-radio input[type="radio"] {
  margin-right: 5px;
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.gender-radio span {
  color: #333;
  font-size: 1.1rem;
}

.gender-radio input[type="radio"]:checked + span {
  color: #0066cc;
  font-weight: bold;
}

/* 省市选择弹出框样式 */
.location-modal {
  display: none;
  position: fixed;
  z-index: 1100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 102, 204, 0.8);
  overflow: auto;
}

.location-modal-content {
  position: relative;
  background: linear-gradient(to bottom, #0099ff, #66ccff);
  margin: 10% auto;
  padding: 0;
  border-radius: 15px;
  width: 80%;
  max-width: 500px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: modalFadeIn 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes modalFadeIn {
  from {opacity: 0; transform: translateY(-30px);}
  to {opacity: 1; transform: translateY(0);}
}

.location-modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.location-modal-header h4 {
  margin: 0;
  color: white;
  font-weight: bold;
  font-family: "AlibabaPuHuiTi", sans-serif;
  letter-spacing: 1px;
}

.location-close {
  color: white;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  opacity: 0.8;
}

.location-close:hover {
  opacity: 1;
}

.location-modal-body {
  padding: 15px 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.location-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 15px;
}

.location-tab {
  padding: 10px 15px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.8);
  position: relative;
  font-family: "AlibabaPuHuiTi", sans-serif;
}

.location-tab.active {
  color: white;
  font-weight: bold;
}

.location-tab.active:after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: white;
}

.location-panel {
  display: none;
}

.location-panel.active {
  display: block;
}

.location-item {
  padding: 12px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: background-color 0.2s;
  color: white;
  font-family: "AlibabaPuHuiTi", sans-serif;
}

.location-item:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.location-item:last-child {
  border-bottom: none;
}

/* 美化滚动条 */
.location-modal-body::-webkit-scrollbar {
  width: 8px;
}

.location-modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.location-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.4);
  border-radius: 10px;
}

.location-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.6);
}

/* 全屏容器 */
.fullscreen-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  padding: 0;
  margin: 0;
  overflow: hidden;
  z-index: 9999;
}

/* 科目选择页面样式 */
.subject-container {
  background: rgba(0, 122, 204, 0.3);
  border-radius: 20px;
  padding: 30px 0;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 90%;
  max-width: 1200px;
}

.subject-container .container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.subject-form-wrapper {
  width: 100%;
  max-width: 1000px;
  padding: 0 20px;
  display: flex;
  justify-content: center;
}

.subject-form-wrapper .row {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 400px;
}

/* 右侧表单区域容器 */
.subject-form-wrapper .col-md-7 {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 400px;
  padding-top: 0;
}

.subject-form-wrapper .col-md-5 {
  display: flex;
  flex-direction: column;
  padding-top: 0;
}

/* 年级选择器 */


.grade-dropdown-wrapper {
  background-color: white;
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 340px;
  margin-top: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 科目选择标题 */
.subject-selection-title {
  color: #333;
  font-size: 1.3rem;
  margin-bottom: 20px;
  text-align: center;
  font-weight: bold;
  width: 100%;
}

/* 科目网格 */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  width: 100%;
  margin-bottom: 20px;
}

.subject-item {
  background-color: white !important;
  border-radius: 10px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  height: 80px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border: 2px solid transparent;
}

.subject-item:first-child {
  background-color: white !important;
}

.subject-item.selected {
  background-color: rgba(0, 176, 240, 0.15) !important;
  border: 2px solid #6DD5FA !important;
  box-shadow: 0 0 8px rgba(0, 176, 240, 0.3);
}

.subject-name {
  font-size: 1.4rem;
  font-weight: bold;
  color: #333;
}

/* 年级选择弹出框样式 */
.grade-modal {
  display: none;
  position: fixed;
  z-index: 1100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 102, 204, 0.8);
  overflow: auto;
}

.grade-modal-content {
  position: relative;
  background: linear-gradient(to bottom, #0099ff, #66ccff);
  margin: 10% auto;
  padding: 0;
  border-radius: 15px;
  width: 80%;
  max-width: 500px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: modalFadeIn 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.grade-modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.grade-modal-header h4 {
  margin: 0;
  color: white;
  font-weight: bold;
  font-family: "AlibabaPuHuiTi", sans-serif;
  letter-spacing: 1px;
}

.grade-close {
  color: white;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  opacity: 0.8;
}

.grade-close:hover {
  opacity: 1;
}

.grade-modal-body {
  padding: 15px 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.grade-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 15px;
}

.grade-tab {
  padding: 10px 15px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.8);
  position: relative;
  font-family: "AlibabaPuHuiTi", sans-serif;
}

.grade-tab.active {
  color: white;
  font-weight: bold;
}

.grade-tab.active:after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: white;
}

.grade-panel {
  display: none;
}

.grade-panel.active {
  display: block;
}

.grade-item {
  padding: 12px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: background-color 0.2s;
  color: white;
  font-family: "AlibabaPuHuiTi", sans-serif;
}

.grade-item:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.grade-item:last-child {
  border-bottom: none;
}

/* 美化滚动条 */
.grade-modal-body::-webkit-scrollbar {
  width: 8px;
}

.grade-modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.grade-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.4);
  border-radius: 10px;
}

.grade-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.6);
}

/* 响应式适配 */
@media (max-width: 768px) {
  .subject-form-wrapper {
    padding: 0 10px;
  }
  
  .grade-dropdown-wrapper {
    height: auto;
    margin-bottom: 20px;
  }
  
  .subject-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  
  .subject-item {
    height: 60px;
    padding: 8px;
  }
  
  .subject-name {
    font-size: 1.1rem;
  }
  
  .ranking-button {
    padding: 6px 15px;
    font-size: 1rem;
  }
}

@media (max-width: 576px) {
  .subject-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }
  
  .subject-item {
    height: 50px;
    padding: 5px;
  }
  
  .subject-name {
    font-size: 0.9rem;
  }
}

/* 成绩榜按钮样式 */
.ranking-button {
  background-color: rgba(0, 176, 240, 0.6);
  color: white;
  border: none;
  border-radius: 15px;
  padding: 8px 20px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ranking-button:hover {
  background-color: rgba(0, 176, 240, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* 位置下拉样式 */
.location-dropdown {
  margin-bottom: 15px;
}

/* ==================== 用户功能区域样式 ==================== */

/* 用户区域容器 */
.user-area {
  position: relative;
  display: flex;
  align-items: center;
}

/* 登录注册按钮组 */
.auth-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.auth-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 25px;
  padding: 8px 18px;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  white-space: nowrap; /* 确保文字不换行 */
  min-width: fit-content; /* 确保按钮内容完整显示 */
  flex-shrink: 0; /* 防止按钮被压缩 */
}

.auth-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  color: white;
  text-decoration: none;
}

.auth-btn:hover::before {
  left: 100%;
}

.login-btn {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.register-btn {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.auth-btn:active {
  transform: translateY(0);
  transition: transform 0.1s;
}

/* 用户资料区域 */
.user-profile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 学科按钮样式 */
.subject-btn {
  background-color: #99cc33;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 1rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-align: center;
  transition: all 0.3s ease;
  font-weight: 500;
  white-space: nowrap;
  min-width: fit-content;
  flex-shrink: 0;
}

.subject-btn:hover {
  background-color: #88bb22;
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(136, 187, 34, 0.3);
}

.subject-btn i {
  font-size: 0.9rem;
}

.user-dropdown {
  position: relative;
}

.user-avatar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  padding: 6px 12px 6px 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
}

.user-avatar:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  object-fit: cover;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-icon {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
}

.user-avatar:hover .dropdown-icon {
  transform: rotate(180deg);
}

/* 下拉菜单 */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 260px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.15),
    0 5px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  overflow: hidden;
  backdrop-filter: blur(15px);
}

.user-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -8px;
  right: 20px;
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom: none;
  border-right: none;
  transform: rotate(45deg);
  backdrop-filter: blur(15px);
}

/* 下拉菜单头部 */
.dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
}

.dropdown-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dropdown-user-info {
  flex: 1;
}

.dropdown-username {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 3px;
  color: white;
}

.dropdown-userphone {
  font-size: 0.85rem;
  opacity: 0.9;
  color: rgba(255, 255, 255, 0.8);
}

/* 下拉菜单项 */
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  color: white;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  border: none;
  background: none;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.dropdown-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transition: width 0.3s ease;
  z-index: -1;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  text-decoration: none;
  transform: translateX(5px);
}

.dropdown-item:hover::before {
  width: 100%;
}

.dropdown-item i {
  width: 18px;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
  font-size: 1rem;
}

.dropdown-item:hover i {
  color: white;
  transform: scale(1.1);
}

.logout-item {
  color: #ff6b6b;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 5px;
}

.logout-item:hover {
  background: rgba(255, 107, 107, 0.15);
  color: #ff6b6b;
}

.logout-item i {
  color: #ff6b6b;
}

.logout-item:hover i {
  color: #ff6b6b;
  transform: scale(1.1);
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  margin: 8px 0;
}

/* Pad设备专用优化 (768px-991px) */
@media (min-width: 768px) and (max-width: 991px) {
  .system-name {
    font-size: 1rem;
    letter-spacing: 1px;
  }
  
  .nav-button {
    padding: 6px 10px;
    font-size: 0.85rem;
    gap: 4px;
    white-space: nowrap;
  }
  
  .nav-button i {
    font-size: 0.75rem;
  }
  
  .auth-btn {
    padding: 6px 10px;
    font-size: 0.85rem;
    gap: 4px;
    white-space: nowrap;
  }
  
  .user-name {
    font-size: 0.85rem;
    max-width: 60px;
  }
  
  .nav-buttons {
    gap: 8px !important;
  }
}

/* 小屏幕优化 (740px以下) */
@media (max-width: 740px) {
  .system-name {
    display: none; /* 隐藏系统名称 */
  }
  
  .nav-buttons {
    justify-content: flex-end !important; /* 右对齐 */
    gap: 4px !important;
  }
  
  .nav-button {
    padding: 4px 6px;
    font-size: 0.75rem;
    gap: 2px;
    min-width: auto;
  }
  
  .nav-button i {
    font-size: 0.65rem;
  }
  
  .nav-text {
    font-size: 0.7rem;
  }
  
  .auth-btn {
    padding: 4px 6px;
    font-size: 0.75rem;
    gap: 2px;
    min-width: auto;
  }
  
  .auth-text {
    font-size: 0.7rem;
  }
  
  .user-name {
    font-size: 0.75rem;
    max-width: 40px;
  }
  
  .user-area {
    margin-left: 0; /* 移除左边距，因为不再有功能按钮 */
  }
  
  /* 学科按钮样式 */
  .subject-btn {
    margin-right: 4px; /* 与用户头像的间距 */
    padding: 6px 12px;
    font-size: 0.9rem;
  }
  
  .subject-btn i {
    font-size: 0.8rem;
  }
}

/* 超小屏幕优化 (480px以下) */
@media (max-width: 480px) {
  .nav-buttons {
    gap: 3px !important;
    flex-wrap: wrap;
  }
  
  .nav-button {
    padding: 3px 5px;
    font-size: 0.7rem;
    gap: 1px;
    border-radius: 12px;
  }
  
  .nav-button i {
    font-size: 0.6rem;
  }
  
  .nav-text {
    font-size: 0.65rem;
  }
  
  .auth-btn {
    padding: 3px 5px;
    font-size: 0.7rem;
    gap: 1px;
    border-radius: 12px;
  }
  
  .auth-text {
    font-size: 0.65rem;
  }
  
  .user-name {
    font-size: 0.7rem;
    max-width: 35px;
  }
  
  .user-area {
    margin-left: 0;
  }
  
  .subject-btn {
    margin-right: 3px;
    padding: 5px 10px;
    font-size: 0.85rem;
  }
  
  .subject-btn i {
    font-size: 0.75rem;
  }
  
  .logo {
    width: 100px;
    height: 25px;
  }
  
  .logo-link:hover {
    transform: scale(1.02);
  }
}

/* 极小屏幕优化 (360px以下) */
@media (max-width: 360px) {
  .nav-buttons {
    gap: 2px !important;
  }
  
  .nav-button {
    padding: 2px 4px;
    font-size: 0.65rem;
    gap: 1px;
  }
  
  .nav-button i {
    font-size: 0.55rem;
  }
  
  .nav-text {
    font-size: 0.6rem;
  }
  
  .auth-btn {
    padding: 2px 4px;
    font-size: 0.65rem;
    gap: 1px;
  }
  
  .auth-text {
    font-size: 0.6rem;
  }
  
  .user-name {
    font-size: 0.65rem;
    max-width: 30px;
  }
  
  .subject-btn {
    margin-right: 2px;
    padding: 4px 8px;
    font-size: 0.8rem;
  }
  
  .subject-btn i {
    font-size: 0.7rem;
  }
  
  .logo {
    width: 80px;
    height: 20px;
  }
  
  .logo-link:hover {
    transform: scale(1.02);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .auth-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    gap: 4px;
  }
  
  .user-avatar {
    padding: 4px 8px 4px 4px;
  }
  
  .avatar-img {
    width: 28px;
    height: 28px;
  }
  
  .user-name {
    font-size: 0.8rem;
    max-width: 80px;
  }
  
  .user-dropdown-menu {
    min-width: 220px;
    right: -10px;
  }
  
  .dropdown-header {
    padding: 16px;
  }
  
  .dropdown-avatar {
    width: 40px;
    height: 40px;
  }
  
  .dropdown-username {
    font-size: 1rem;
  }
  
  .dropdown-userphone {
    font-size: 0.8rem;
  }
  
  .dropdown-item {
    padding: 12px 16px;
    font-size: 0.9rem;
  }
  
  /* 确保导航按钮在移动端完整显示 */
  .nav-buttons {
    flex-wrap: nowrap;
    overflow: visible;
  }
  
  .user-area {
    flex-shrink: 0;
  }
  
  .subject-btn {
    flex-shrink: 0;
    padding: 7px 14px;
    font-size: 0.95rem;
  }
  
  .subject-btn i {
    font-size: 0.85rem;
  }
}

/* 消息提示样式增强 */
.alert {
  border: none;
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.alert-success {
  background: rgba(40, 167, 69, 0.9);
  color: white;
}

.alert-info {
  background: rgba(23, 162, 184, 0.9);
  color: white;
}

/* 动画效果 */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.user-dropdown-menu.show {
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 深色模式支持预留 */
@media (prefers-color-scheme: dark) {
  .user-dropdown-menu {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    border-color: #4a5568;
  }
  
  .dropdown-item {
    color: #e2e8f0;
  }
  
  .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #90cdf4;
  }
  
  .dropdown-divider {
    background: #4a5568;
  }
}