*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: #1E1B4B;
  background: #F5F5FF;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: #4F46E5;
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: #3730A3;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

.main-content {
  min-height: calc(100vh - 64px - 56px);
  padding: 28px 0 40px;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid #E0E7FF;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.08);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  font-size: 18px;
  font-weight: 700;
  color: #4F46E5;
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-logo svg {
  width: 28px;
  height: 28px;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4F46E5, #818CF8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
}
.user-avatar img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 9999px;
  transition: background 0.2s;
}
.user-menu:hover {
  background: #EEF2FF;
}

.user-name {
  font-size: 14px;
  color: #1E1B4B;
  font-weight: 500;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #1E1B4B;
  padding: 4px;
}

.bottom-nav {
  display: none;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  gap: 3px;
  color: #9CA3AF;
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s;
  text-decoration: none;
}
.bottom-nav-item svg {
  width: 22px;
  height: 22px;
}
.bottom-nav-item.active, .bottom-nav-item:hover {
  color: #4F46E5;
}
.bottom-nav-item.active .bottom-nav-dot {
  display: block;
}

.bottom-nav-dot {
  display: none;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #4F46E5;
  position: absolute;
  bottom: 6px;
}

.card {
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.08);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid #E0E7FF;
  cursor: pointer;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.12);
}

.card-img {
  width: 100%;
  height: 160px;
  -o-object-fit: cover;
     object-fit: cover;
  background: #EEF2FF;
}

.card-body {
  padding: 12px 14px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #1E1B4B;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.card-desc {
  font-size: 13px;
  color: #4B5563;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid #E0E7FF;
  font-size: 12px;
  color: #9CA3AF;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 24px;
  border: none;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  white-space: nowrap;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #4F46E5, #818CF8);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #3730A3, #4F46E5);
  color: #fff;
}

.btn-accent {
  background: linear-gradient(135deg, #F97316, #FB923C);
  color: #fff;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}
.btn-accent:hover {
  background: linear-gradient(135deg, #EA6C0A, #F97316);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 2px solid #4F46E5;
  color: #4F46E5;
}
.btn-outline:hover {
  background: #4F46E5;
  color: #fff;
}

.btn-ghost {
  background: #EEF2FF;
  color: #4F46E5;
}
.btn-ghost:hover {
  background: #C7D2FE;
}

.btn-danger {
  background: #EF4444;
  color: #fff;
}
.btn-danger:hover {
  background: rgb(235.7842364532, 30.4157635468, 30.4157635468);
  color: #fff;
}

.btn-sm {
  padding: 7px 16px;
  font-size: 13px;
}

.btn-block {
  display: flex;
  width: 100%;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #1E1B4B;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #C7D2FE;
  border-radius: 12px;
  font-size: 15px;
  color: #1E1B4B;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-control::-moz-placeholder {
  color: #9CA3AF;
}
.form-control::placeholder {
  color: #9CA3AF;
}
.form-control:focus {
  border-color: #4F46E5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-error {
  color: #EF4444;
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.section {
  margin-bottom: 28px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding: 0 2px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  color: #1E1B4B;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  background: linear-gradient(180deg, #4F46E5, #818CF8);
  border-radius: 2px;
}

.section-more {
  font-size: 13px;
  color: #4F46E5;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 2px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
}

.badge-primary {
  background: #EEF2FF;
  color: #4F46E5;
}

.badge-accent {
  background: #FFF7ED;
  color: #F97316;
}

.badge-success {
  background: #ECFDF5;
  color: #10B981;
}

.badge-danger {
  background: #FEF2F2;
  color: #EF4444;
}

.badge-warning {
  background: #FFFBEB;
  color: #F59E0B;
}

.alert {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.alert-danger {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}

.alert-success {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
}

.alert-warning {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
}

.alert-info {
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  color: #3730A3;
}

.pagination-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}
.pagination-wrapper .pagination {
  display: flex;
  gap: 4px;
  list-style: none;
}
.pagination-wrapper .page-link {
  padding: 8px 14px;
  border: 1.5px solid #C7D2FE;
  border-radius: 8px;
  color: #1E1B4B;
  font-size: 14px;
  transition: all 0.2s;
}
.pagination-wrapper .page-link:hover {
  border-color: #4F46E5;
  color: #4F46E5;
}
.pagination-wrapper .page-item.active .page-link {
  background: #4F46E5;
  color: #fff;
  border-color: #4F46E5;
}
.pagination-wrapper .page-item.disabled .page-link {
  opacity: 0.4;
  cursor: not-allowed;
}

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #0F0F1A;
  border-radius: 12px;
  overflow: hidden;
}
.video-container video, .video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.category-filter-wrapper {
  margin-bottom: 16px;
}

.category-filter {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-filter::-webkit-scrollbar {
  display: none;
}
.category-filter a {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 13px;
  color: #4B5563;
  background: #fff;
  border: 1.5px solid #C7D2FE;
  white-space: nowrap;
  transition: all 0.2s;
}
.category-filter a:hover, .category-filter a.active {
  background: #4F46E5;
  color: #fff;
  border-color: #4F46E5;
}

.quiz-question {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.08);
  border: 1px solid #E0E7FF;
}

.quiz-question-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  color: #1E1B4B;
  line-height: 1.5;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid #C7D2FE;
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  color: #1E1B4B;
}
.quiz-option:hover {
  background: #EEF2FF;
  border-color: #4F46E5;
}
.quiz-option.selected {
  background: #EEF2FF;
  border-color: #4F46E5;
  color: #4F46E5;
}
.quiz-option.correct {
  background: #ECFDF5;
  border-color: #10B981;
  color: #065F46;
}
.quiz-option.wrong {
  background: #FEF2F2;
  border-color: #EF4444;
  color: #991B1B;
}
.quiz-option input[type=radio], .quiz-option input[type=checkbox] {
  accent-color: #4F46E5;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #9CA3AF;
}
.empty-state svg {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  opacity: 0.4;
}
.empty-state p {
  font-size: 15px;
}

.skeleton {
  background: linear-gradient(90deg, #EEF2FF 25%, #E0E7FF 50%, #EEF2FF 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.4s infinite;
  border-radius: 8px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
.site-footer {
  background: #1E1B4B;
  color: rgba(255, 255, 255, 0.6);
  padding: 24px 0;
  text-align: center;
  font-size: 13px;
}
.site-footer a {
  color: rgba(255, 255, 255, 0.8);
}

.text-primary {
  color: #4F46E5 !important;
}

.text-accent {
  color: #F97316 !important;
}

.text-success {
  color: #10B981 !important;
}

.text-danger {
  color: #EF4444 !important;
}

.text-muted {
  color: #9CA3AF !important;
}

.text-center {
  text-align: center;
}

.fw-600 {
  font-weight: 600;
}

.fw-700 {
  font-weight: 700;
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mb-16 {
  margin-bottom: 16px;
}

.gap-8 {
  gap: 8px;
}

.d-flex {
  display: flex;
}

.align-center {
  align-items: center;
}

@media (min-width: 1281px) {
  .container {
    max-width: 1280px;
  }
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 1280px) {
  .container {
    max-width: 1100px;
  }
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 1024px) {
  .container {
    padding: 0 24px;
  }
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .header-inner {
    padding: 0 16px;
  }
  .main-content {
    padding: 16px 0 80px;
  }
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #E0E7FF;
    box-shadow: 0 -2px 12px rgba(79, 70, 229, 0.08);
    z-index: 200;
    height: 60px;
  }
  .nav-links {
    display: none;
  }
  .header-right {
    display: none;
  }
  .site-footer {
    display: none;
  }
  .profile-layout {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 480px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
  .card-img {
    height: 180px;
  }
}
