/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background: #f5f7fa;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 顶部标题区（分离后） */
.nav-top {
  height: 60px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: left; /* 标题居中 */
  padding: 0 15px;
  position: relative;
  overflow: hidden;
}
.nav-title {
  font-size: 20px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* 新增：菜单+面包屑栏（标题下方） */
.toolbar-bar {
  height: 40px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  padding: 0 15px;
  gap: 10px;
}
.sidebar-btn {
  background: none;
  border: none;
  padding: 5px;
  cursor: pointer;
}
.sidebar-btn .icon {
  width: 20px;
  height: 20px;
}
.breadcrumb {
  font-size: 14px;
  color: #666;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 侧边栏 */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 200px;
  height: 100vh;
  background: #fff;
  z-index: 999;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}
.sidebar.show {
  transform: translateX(0);
}
.sidebar-scroll {
  height: 100%;
  overflow-y: auto;
}

/* 导航组 */
.nav-group {
  margin-bottom: 10px;
}
.nav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  font-size: 16px;
  font-weight: bold;
  background: #f8f9fa;
  cursor: pointer;
}
.nav-group-header .icon {
  width: 18px;
  height: 18px;
  margin-right: 10px;
}
.nav-header-left {
  display: flex;
  align-items: center;
  width: calc(100% - 40px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}
.arrow-up {
  transform: rotate(180deg);
}
.arrow-down {
  transform: rotate(0);
}

/* 子菜单 */
.nav-subgroup {
  background: #fff;
}
.nav-item {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  font-size: 15px;
  color: #333;
  cursor: pointer;
}
.nav-item .icon {
  width: 17px;
  height: 17px;
  margin-right: 12px;
}
.nav-item.active {
  background: #e8f4ff;
  color: #007aff;
  font-weight: bold;
}

/* 遮罩层 */
.overlay {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 998;
  display: none;
}
.overlay.show {
  display: block;
}

/* 主内容区 */
.main-content {
  padding: 15px;
}
.container {
  max-width: 1200px; /* 适配PC宽度 */
  margin: 0 auto;
}

/* 标题栏 */
.title {
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 15px;
}
.title-icon {
  width: 20px;
  height: 20px;
  margin-right: 10px;
}

/* 通用卡片 */
.card {
  background: #fff;
  border-radius: 10px;
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.card-header {
  padding: 10px;
  background: #f8f9fa;
  text-align: left;
}
.card-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 2px;
  display: block;
}
.card-meta {
  font-size: 14px;
  color: #666;
  margin-top: 10px;
  display: block;
}
.card-content {
  padding: 15px;
  text-align: left;
}

/* 通知样式 */
.notice-content {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 5px;
  display: block;
  text-align: left;
}
.meta-tag {
  display: inline-flex;
  align-items: center;
  margin-top: 5px;
  gap: 12px;
  padding: 1px 7.5px;
  background-color: #cae7fff3;
  border:0.5px solid #82b8fa9b;
  border-radius: 14px;
  font-size: 14px;
}
.meta-item {
  display: flex;
  align-items: center;
  margin-right: 2px;
}
/* 修复：meta图标大小 */
.meta-item .icon {
  margin-right: 2px;
  width: 14px !important;
  height: 14px !important;
}

/* 优秀作文样式 */
.topic-card {
  background: #fff;
  border-radius: 10px;
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.topic-card-header {
  padding: 10px 15px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
}
.topic-card-title {
  font-size: 18px;
  font-weight: bold;
  color: #007aff;
}
.topic-card-content {
  padding: 10px 15px;
}
/* 修复：画册适配PC宽度，一行多列 */
.essay-album {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0;
}
.essay-card {
  /* 适配PC：一行多列，移动端1列 */
  width: calc(33.3% - 10px); /* PC一行2列，可改为33.33%一行3列 */
  min-width: 150px; /* 最小宽度，防止过小 */
  background: #f5f7fa;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 10px;
  cursor: pointer;
}
/* 移动端适配：小于768px时1列 */
@media (max-width: 768px) {
  .essay-card {
    width: 100%;
  }
}
.item-img {
  width: 100%;
  z-index: 1 !important;           /* 层级高于遮挡层 */
}
.item-img img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  z-index: 1 !important;           /* 层级高于遮挡层 */
}
.essay-card-info {
  padding: 10px;
}
.essay-card-meta {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: #666;
  margin-top: 2px;
  gap: 15px;
}

/* 作文详情 */
.back-btn {
  font-size: 16px;
  color: #257cd9;
  padding: 5px 10px;
  margin-top: 10px;
  margin-bottom: 5px;
  cursor: pointer;
}
.essay-paragraph {
  font-size: 17px;
  line-height: 1.8;
  margin-bottom: 8px;
  display: block;
  color: #333;
  text-align: left;
}
.text-indent {
  text-indent: 2em;
}
.comment {
  margin-top: 10px;
  padding: 10px;
  background: #fbf7e9de;
  border-radius: 6px;
}
/* 修复：教师点评icon大小 */
.comment-icon {
  width: 16px !important;
  height: 16px !important;
  margin-right: 5px;
  vertical-align: middle;
}
.comment-label {
  font-weight: bold;
  color: #d98f40;
  margin-right: 4px;
}

/* 作业样式 */
.date-card {
  background: #fff;
  border-radius: 10px;
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.date-card-header {
  display: flex;
  align-items: center;
  line-height: 1.5;
  padding: 10px 15px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
}
/* 修复：作业日期icon大小 */
.date-card-header .icon {
  width: 16px !important;
  height: 16px !important;
  margin-right: 8px;
}
.date-card-title {
  font-size: 18px;
  font-weight: bold;
  color: #007bffe1;
}
.date-card-content {
  padding: 10px 15px;
}
.homework-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 0;
}
.homework-card {
  background: #fdfdfd;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.homework-card-header {
  padding: 10px 15px;
  background: #f7f8f9;
  display: flex;
  align-items: center;
}
.homework-subject {
  font-size: 18px;
  font-weight: bold;
}
.homework-card-content {
  padding: 10px 15px;
}
.homework-content {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 5px;
  display: block;
}
.homework-publisher {
  font-size: 13px;
  color: #666;
  margin-top: 5px;
}

/* 班级活动 */
.activity-imgs {
  display: flex;
  flex-wrap: wrap;
  gap: 7.5px;
  margin-top: 15px;
}
.activity-img {
  width: calc(33.33% - 5px);
  height: 150px;
  border-radius: 4px;
  cursor: pointer;
  object-fit: cover;
}
.activity-tip {
  font-size: 14px;
  color: #198ed2;
  text-align: right;
  padding: 0;
}
.no-data {
  font-size: 16px;
  color: #999;
  text-align: center;
  padding: 30px 0;
}


/* Swiper轮播样式（固定高度+图片裁剪） */
.swiper-container {
  width: 100%;
  height: 350px !important; /* 固定高度，可改为250px/300px */
  border-radius: 8px;
  overflow: hidden;
  margin: 10px 0;
}

.essay-swiper {
  height: 350px;
}
.swiper-slide {
  text-align: center;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}
/* 轮播图里的图片样式（关键：固定高度+裁剪） */
.swiper-slide img {
  display: block;
  width: 100%;
  height: 100%; /* 继承容器高度 */
  object-fit: cover; /* 裁剪图片，保持比例，不拉伸 */
  /* object-fit: contain; 可选：完整显示图片，留白不裁剪 */
  cursor: pointer;
  z-index: 1 !important;           /* 层级高于遮挡层 */
}

.swiper-pagination {
  bottom: 5px !important;
  text-align: right !important;
  padding-right: 10px;
}
.swiper-pagination-bullet {
  background: #fff !important;
  opacity: 0.7 !important;
}
.swiper-pagination-bullet-active {
  opacity: 1 !important;
  background: #007aff !important;
}

/* 图片预览弹窗（修复点击失效） */
.img-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
.img-preview-content {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 80vh;
}
.img-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}
.img-preview-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  text-align: center;
  line-height: 40px;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
}
.img-preview-nav {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  padding: 0 10px;
  box-sizing: border-box;
}
.img-preview-btn {
  width: 40px;
  height: 60px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 24px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-preview-count {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 16px;
  background: rgba(0,0,0,0.5);
  padding: 2px 10px;
  border-radius: 10px;
}

/* 详情页动画 */
#essay-detail, #activity-detail {
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
/* 作文列表标题和摘录样式优化 */
.essay-card-title {
  font-size: 15px !important;
  font-weight: bold !important;
  margin-bottom: 5px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.essay-card-excerpt {
  font-size: 13px !important;
  color: #666 !important;
  margin-bottom: 5px !important;
  overflow: hidden !important;
  line-height: 1.4 !important;
}
/* 作文详情轮播样式（必须加） */

.essay-swiper- {
  width: 100%;
  height: 350px !important;
}
.swiper-wrapper {
  height: 100%;
}
.swiper-slide {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1 !important;           /* 层级高于遮挡层 */
}

/* 确保分页器容器可见 */
.swiper-pagination {
  position: absolute !important;
  bottom: 15px !important; /* 调整距离底部的位置 */
  left: 0 !important;
  width: 100% !important;
  text-align: center !important;
  z-index: 999 !important; /* 层级置顶，避免被遮挡 */
  pointer-events: auto !important;
}

/* 小圆点样式 */
.swiper-pagination-bullet {
  width: 10px !important;    /* 圆点大小 */
  height: 10px !important;
  background: #ffffff !important; /* 未选中的颜色（白色） */
  opacity: 0.7 !important;   /* 未选中透明度 */
  margin: 0 5px !important;  /* 圆点间距 */
  border-radius: 50% !important; /* 圆形 */
  display: inline-block !important; /* 强制显示 */
}

/* 选中的小圆点样式 */
.swiper-pagination-bullet-active {
  background: #257cd9 !important; /* 选中的颜色（蓝色） */
  opacity: 1 !important;          /* 选中不透明 */
  transform: scale(1.2) !important; /* 选中放大，更醒目 */
}