/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 字体设置 */
body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(to bottom right, #f9fafb, #eff6ff);
  color: #1f2937;
  line-height: 1.6;
}

/* 主色调 */
:root {
  --primary-color: #1E4ED8;
  --primary-light: rgba(30, 78, 216, 0.1);
  --primary-lighter: rgba(30, 78, 216, 0.05);
  --white: #ffffff;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
}

/* 容器样式 */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

/* 主要内容 */
main {
  margin-top: 2rem;
}

/* 板块卡片样式 */
.section-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  margin-bottom: 3rem;
  border-left: 4px solid var(--primary-color);
}

/* 板块样式 */
section {
  padding: 6rem 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

@media (min-width: 768px) {
  section {
    padding: 8rem 0;
  }
}

/* 标题样式 */
h2 {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  h2 {
    font-size: 1.875rem;
  }
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.75rem;
}

/* 段落样式 */
p {
  color: var(--gray-600);
  margin-bottom: 1.5rem;
  line-height: 1.75;
}

/* 网格布局 */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .grid-cols-2-sm {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .grid-cols-3-lg {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 常用功能板块 */
.feature-section {
  padding-top: 4rem;
}

@media (min-width: 768px) {
  .feature-section {
    padding-top: 6rem;
  }
}

.section-description {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.125rem;
  text-align: center;
  margin-bottom: 2rem;
}

/* 功能卡片网格 */
.features-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 功能卡片 */
.feature-card {
  background: linear-gradient(to bottom right, var(--primary-lighter), var(--primary-light));
  padding: 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(30, 78, 216, 0.2);
  text-decoration: none;
}

.feature-icon {
  width: 3rem;
  height: 3rem;
  background: rgba(30, 78, 216, 0.2);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.5rem;
}

.feature-description {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin: 0;
}

/* 课程章节板块 */
.chapters-section {
  padding-top: 4rem;
}

@media (min-width: 768px) {
  .chapters-section {
    padding-top: 6rem;
  }
}

/* 课程卡片 */
.course-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  margin-bottom: 3rem;
  border-left: 4px solid var(--primary-color);
}

.course-card h2 {
  margin-bottom: 1.5rem;
}

/* 章节列表 */
.chapters-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ========== 网站优化增强样式 ========== */
/* 增强颜色变量 */
:root {
  --primary-dark: #1a3dbb;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --shadow-color: rgba(0, 0, 0, 0.08);
  --shadow-hover: rgba(0, 0, 0, 0.12);
}

/* 海报区域优化 */
.poster {
  background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 50%, #3B82F6 100%);
  position: relative;
  color: white;
  padding: 1.5rem 0;
  text-align: left;
  margin-bottom: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.poster::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.3) 0%, transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(147, 197, 253, 0.2) 0%, transparent 50%);
  z-index: 1;
}

.poster::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: 1;
}

.poster .container {
  position: relative;
  z-index: 2;
  max-width: 900px;
  padding: 0 2rem;
  height: 100%;
  min-height: 100px;
}

.poster-title {
  font-size: 2rem;
  font-weight: normal;
  font-family: "KaiTi", "楷体", serif;
  margin-bottom: 1rem;
  color: white;
  letter-spacing: 0.4em;
  line-height: 1.2;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.5), 0 4px 8px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 1.2s ease-out forwards;
  text-align: left;
}

.poster-text {
  font-size: 1.5rem;
  margin: 0;
  font-family: "STXingkai", "华文行楷", cursive;
  color: white;
  font-weight: normal;
  letter-spacing: 0.6em;
  text-shadow: 0 0 15px rgba(147, 197, 253, 0.5), 0 2px 4px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 1.2s ease-out 0.4s forwards;
  text-align: left;
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* 用户认证区域 */
.user-auth {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.user-auth-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.8rem;
}

.user-avatar {
  background: rgba(255, 255, 255, 0.2);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  flex-shrink: 0;
}

.user-avatar i {
  color: white;
  font-size: 16px;
}

.user-info h4 {
  color: white;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.2;
}

.user-info p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  margin: 0;
  line-height: 1.2;
}

.user-role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
  margin-right: 6px;
  margin-bottom: 4px;
}

.user-role-badge.superadmin {
  background: linear-gradient(135deg, rgba(255,0,0,0.8), rgba(220,0,0,0.8));
  color: white;
}

.user-role-badge.admin {
  background: linear-gradient(135deg, rgba(255,165,0,0.8), rgba(220,140,0,0.8));
  color: white;
}

.user-role-badge.teacher {
  background: linear-gradient(135deg, rgba(0,128,0,0.8), rgba(0,100,0,0.8));
  color: white;
}

.user-role-badge.user {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(37, 99, 235, 0.8));
  color: white;
}

.user-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.8rem;
}

.user-action-btn {
  display: inline-block;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 访客认证样式 */
.user-auth-guest {
  text-align: center;
  padding: 0.8rem 0;
}

.user-auth-guest h3 {
  color: white;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 1rem;
}

.auth-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.auth-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth-btn.login {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.auth-btn.register {
  background: linear-gradient(135deg, #3B82F6, #1E4ED8);
  color: white;
  border: 1px solid rgba(59, 130, 246, 0.5);
}

/* 章节项目优化 */
.chapter-item {
  border: 1px solid rgba(30, 78, 216, 0.2);
  border-radius: 12px;
  overflow: hidden;
}

.chapter-header {
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(to right, rgba(30, 78, 216, 0.05), rgba(30, 78, 216, 0.1));
  border: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chapter-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-800);
}

.chapter-header i {
  color: var(--primary-color);
  font-size: 0.875rem;
}

.chapter-header.active i {
  transform: rotate(180deg);
}

.chapter-content {
  padding: 0;
  overflow: hidden;
}

.chapter-item.active .chapter-content {
  padding: 1.5rem;
}

/* 课程链接网格优化 */
.lessons-grid {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 640px) {
  .lessons-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .lessons-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.lesson-link {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  text-align: center;
}

/* 容器布局优化 */
.container-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 150px;
  width: 100%;
  flex-wrap: wrap;
}

.poster-content {
  flex: 1;
  min-width: 200px;
}

/* 响应式优化 */
@media (min-width: 1024px) {
  .poster {
    padding: 2rem 0;
  }
  
  .poster-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: 0.4em;
  }
  
  .poster-text {
    font-size: 1.75rem;
    letter-spacing: 0.6em;
  }
}

@media (max-width: 768px) {
  .poster {
    padding: 1.5rem 0;
  }
  
  .poster-title {
    font-size: 2rem;
    margin-bottom: 0.8rem;
    letter-spacing: 0.3em;
  }
  
  .poster-text {
    font-size: 1.5rem;
    letter-spacing: 0.5em;
  }
  
  .user-auth {
    max-width: 100%;
    margin-left: 0;
    margin-top: 1.5rem;
  }
  
  .container-content {
    flex-direction: column;
    text-align: center;
  }
  
  .poster-content {
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 640px) {
  .poster {
    padding: 1rem 0;
  }
  
  .poster-title {
    font-size: 1.75rem;
    margin-bottom: 0.6rem;
    letter-spacing: 0.2em;
  }
  
  .poster-text {
    font-size: 1.25rem;
    letter-spacing: 0.4em;
  }
  
  .auth-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .auth-btn {
    width: 100%;
    justify-content: center;
  }
}

/* 动画优化 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.feature-card, .course-card, .chapter-item {
  animation: fadeIn 0.5s ease-out;
}

/* 滚动条优化 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

/* 页脚备案信息样式 */
.footer-info {
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  margin-bottom: 30px;
  background-color: var(--gray-100);
  border-top: 1px solid var(--gray-200);
}

.footer-info a {
  text-decoration: none;
  color: var(--gray-600);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
}

.footer-info img {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  object-fit: contain;
}

/* 按钮点击效果优化 */
.feature-card:active,
.course-card:active,
.lesson-link:active,
.user-action-btn:active,
.auth-btn:active {
  transform: translateY(0);
  transition: transform 0.1s ease;
}

/* 加载动画优化 */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(30, 78, 216, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 焦点状态优化 */
button:focus,
a:focus,
input:focus,
select:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* 禁用状态优化 */
button:disabled,
a:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}