* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Microsoft YaHei", "Arial", sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  /* 移动端优化 */
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* 移动端设备特定样式 */
.mobile-device {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.mobile-device * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* 头部样式 */
.header {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 20px 30px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.header h1 {
  color: #333;
  font-size: 2rem;
  font-weight: 600;
}

.header h1 i {
  color: #667eea;
  margin-right: 10px;
}

.header-controls {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

/* 桌面端隐藏移动端菜单 */
.desktop-controls {
  display: flex;
  gap: 15px;
  align-items: center;
}

/* 移动端菜单样式 */
.mobile-menu {
  position: relative;
  display: none;
  z-index: 99999;
}

/* 移动端菜单背景遮罩 */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.1);
  z-index: 99998;
  display: none;
}

.mobile-menu-btn {
  padding: 12px 16px;
  min-width: auto;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.mobile-menu-btn.active {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  transform: rotate(90deg);
}

.mobile-menu-btn.active:hover {
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

.mobile-menu-btn i {
  transition: transform 0.3s ease;
}

.mobile-dropdown {
  position: fixed; /* 改为fixed定位，确保相对于视口 */
  top: 60px; /* 距离顶部固定距离 */
  right: 30px; /* 距离右边固定距离，与header padding对应 */
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  min-width: 200px;
  z-index: 99999; /* 进一步提高层级 */
  display: none;
  animation: fadeInDown 0.3s ease;
}

.mobile-dropdown.show {
  display: block;
}

.mobile-menu-item {
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #333;
}

.mobile-menu-item:hover {
  background-color: #f8f9fa;
}

.mobile-menu-item:first-child {
  border-radius: 8px 8px 0 0;
}

.mobile-menu-item:last-child {
  border-radius: 0 0 8px 8px;
}

.mobile-menu-item i {
  width: 16px;
  text-align: center;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 按钮样式 */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px; /* iOS推荐的最小触摸目标 */
  min-width: 44px;
  justify-content: center;
  /* 移动端触摸优化 */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5a6fd8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #218838;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.btn-info {
  background: #17a2b8;
  color: white;
}

.btn-info:hover {
  background: #138496;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.btn-warning {
  background: #ffc107;
  color: #212529;
}

.btn-warning:hover {
  background: #ffb300;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

/* 主内容区域 */
.main-content {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

/* 周次导航 */
.week-navigation {
  margin-top: 20px;
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid #dee2e6;
}

.week-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.week-display {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  color: #495057;
}

.week-input {
  width: 60px;
  padding: 5px 8px;
  border: 1px solid #ced4da;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  background: white;
}

.week-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.25);
}

.week-date {
  color: #6c757d;
  font-size: 14px;
  margin-left: 10px;
}

.btn-outline-primary {
  background: transparent;
  color: #667eea;
  border: 1px solid #667eea;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-outline-primary:hover {
  background: #667eea;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 课表容器 */
.schedule-container {
  width: 100%;
  overflow-x: auto;
}

.schedule-header {
  display: grid;
  grid-template-columns: 120px repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 2px;
}

.time-column,
.day-column {
  background: #667eea;
  color: white;
  padding: 15px 10px;
  text-align: center;
  font-weight: 600;
  border-radius: 8px;
}

.schedule-grid {
  display: grid;
  grid-template-columns: 120px repeat(7, 1fr);
  gap: 2px;
}

.time-slot {
  background: #f8f9fa;
  padding: 20px 10px;
  text-align: center;
  font-weight: 500;
  color: #666;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}

/* 休息时间样式 */
.time-slot.break-time {
  background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
  color: #2d3436;
  font-style: italic;
}

.schedule-cell {
  background: #fff;
  border: 2px dashed #e9ecef;
  border-radius: 8px;
  min-height: 80px;
  padding: 8px;
  position: relative;
  transition: all 0.3s ease;
}

/* 休息时间格子样式 */
.schedule-cell.break-cell {
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  transition: all 0.3s ease;
}

.schedule-cell.break-cell:hover {
  border-color: #ffc107;
  background: #fff8e1;
}

.schedule-cell.break-cell.droppable {
  border-color: #28a745;
  background: #e8f5e8;
}

.schedule-cell:hover {
  border-color: #667eea;
  background: #f8f9ff;
}

.schedule-cell.droppable {
  border-color: #28a745;
  background: #f8fff8;
}

/* 课程卡片 */
.course-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 10px;
  border-radius: 8px;
  margin: 2px 0;
  cursor: move;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  /* 移动端触摸优化 */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2; /* 确保在时间标签之上 */
  justify-content: center;
}

.course-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.course-card.dragging {
  opacity: 0.7;
  transform: rotate(5deg);
}

/* 移动端拖拽占位符 */
.drag-placeholder {
  background: rgba(0, 123, 255, 0.1) !important;
  border: 2px dashed #007bff !important;
  border-radius: 4px !important;
  opacity: 0.8 !important;
  animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }
  100% {
    opacity: 1;
  }
}

/* 移动端拖拽状态优化 */
.mobile-device .course-card {
  /* 移动端拖拽触摸优化 */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  /* 减少触摸延迟 */
  touch-action: none;
  /* 快速响应触摸 */
  -webkit-tap-highlight-color: transparent;
  /* 移动端移除卡片边距以减少空白 */
  margin: 0;
}

.mobile-device .course-card.dragging {
  pointer-events: none;
  z-index: 9999;
  transition: none !important;
  transform: scale(0.95) !important;
  opacity: 0.2 !important;
}

/* 移动端拖拽元素样式优化 */
.mobile-device .course-card:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

/* 移动端拖拽时的反馈 */
.mobile-device .schedule-cell.droppable {
  background: rgba(40, 167, 69, 0.2) !important;
  border-color: #28a745 !important;
  animation: dropZonePulse 1s ease-in-out infinite alternate;
  transition: all 0.2s ease;
}

/* 移动端时间槽优化 */
.mobile-device .time-slot {
  touch-action: auto;
  -webkit-tap-highlight-color: transparent;
}

/* 拖拽成功反馈动画 */
@keyframes dropSuccess {
  0% {
    background-color: #d4edda;
    transform: scale(1);
  }
  50% {
    background-color: #c3e6cb;
    transform: scale(1.02);
  }
  100% {
    background-color: transparent;
    transform: scale(1);
  }
}

@keyframes dropZonePulse {
  0% {
    background-color: rgba(40, 167, 69, 0.1);
  }
  100% {
    background-color: rgba(40, 167, 69, 0.3);
  }
}

.course-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.course-info {
  font-size: 12px;
  opacity: 0.9;
}

.course-location {
  font-size: 11px;
  opacity: 0.8;
  margin-top: 2px;
}

/* 模态框样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: white;
  margin: 5% auto;
  border-radius: 15px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 20px 30px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  color: #333;
  font-size: 1.5rem;
  font-weight: 600;
}

.close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close:hover {
  color: #333;
}

.modal-body {
  padding: 30px;
}

/* 上传区域 */
.upload-area {
  border: 3px dashed #667eea;
  border-radius: 15px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #f8f9ff;
}

.upload-area:hover {
  border-color: #5a6fd8;
  background: #f0f4ff;
}

.upload-area.dragover {
  border-color: #28a745;
  background: #f8fff8;
}

.upload-area i {
  font-size: 3rem;
  color: #667eea;
  margin-bottom: 15px;
}

.upload-area p {
  color: #666;
  font-size: 16px;
  margin: 10px 0;
}

.upload-hint {
  font-size: 14px !important;
  color: #999 !important;
}

/* 表单样式 */
.form-group {
  margin-bottom: 20px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.form-group.hidden {
  max-height: 0;
  margin-bottom: 0;
  opacity: 0;
  transform: translateY(-10px);
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}

.form-actions {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}

/* 预览表格 */
#previewTable {
  max-height: 300px;
  overflow: auto;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin: 20px 0;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
}

.preview-table th,
.preview-table td {
  padding: 8px 12px;
  border: 1px solid #e9ecef;
  text-align: left;
  font-size: 12px;
}

.preview-table th {
  background: #f8f9fa;
  font-weight: 600;
}

.preview-table tr:nth-child(even) {
  background: #f8f9fa;
}

/* 课程详情样式 */
.course-detail-info {
  margin-bottom: 20px;
}

.detail-item {
  margin-bottom: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 5px;
  border-left: 4px solid #667eea;
}

.detail-item strong {
  color: #333;
  display: inline-block;
  width: 100px;
  min-width: 100px;
}

.detail-item span {
  color: #666;
}

.detail-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.detail-actions .btn {
  padding: 8px 16px;
  font-size: 14px;
}

.btn-danger {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
  border: none;
}
@media (max-width: 768px) {
  .container {
    padding: 5px 0; /* 只保留上下内边距，移除左右内边距 */
    max-width: none; /* 移除最大宽度限制 */
    margin: 0; /* 移除居中边距 */
  }

  .main-content {
    padding: 20px 0; /* 移除左右内边距 */
    border-radius: 0; /* 移除圆角以贴合屏幕边缘 */
  }

  .header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    text-align: left;
    padding: 15px 30px; /* 进一步增加左右内边距 */
    margin-bottom: 10px;
    background: linear-gradient(
      135deg,
      #f8f9fa 0%,
      #e9ecef 100%
    ); /* 添加背景色用于调试 */
    border-radius: 0 0 10px 10px;
  }

  .header h1 {
    font-size: 16px;
    margin: 0;
    margin-right: 10px; /* 给标题添加右边距 */
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header h1 i {
    font-size: 14px;
    margin-right: 6px;
    margin-left: 8px; /* 添加左边距，让图标往右移 */
  }

  .header-controls {
    flex-shrink: 0;
  }

  .desktop-controls {
    display: none;
  }

  .mobile-menu {
    display: block;
  }

  .mobile-menu-btn {
    padding: 10px 12px;
    font-size: 16px;
    margin-left: -15px; /* 更多往左移 */
    background: linear-gradient(
      135deg,
      #dc3545 0%,
      #c82333 100%
    ) !important; /* 明显的红色背景用于调试 */
    border: 2px solid #fff !important;
  }

  .btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  /* 周次导航优化 */
  .week-navigation {
    margin-top: 10px;
    margin-bottom: 20px;
    padding: 10px 0; /* 完全移除左右内边距 */
  }

  .week-controls {
    flex-direction: row;
    gap: 5px;
    align-items: center;
    justify-content: space-between;
  }

  .week-display {
    order: 0;
    flex: 1;
    text-align: center;
    font-size: 11px;
    line-height: 1.2;
  }

  .week-display .week-date {
    display: block;
    font-size: 9px;
    color: #666;
    margin-top: 1px;
  }

  .week-input {
    width: 40px;
    height: 32px;
    font-size: 12px;
    padding: 2px 4px;
    margin: 0 2px;
  }

  /* 优化周次切换按钮 */
  #prevWeek,
  #nextWeek {
    padding: 6px 8px;
    font-size: 11px;
    min-width: 60px;
  }

  #prevWeek .fas,
  #nextWeek .fas {
    font-size: 10px;
  }

  /* 课表布局优化 */
  .schedule-container {
    overflow-x: hidden; /* 移除水平滚动 */
    -webkit-overflow-scrolling: touch;
    width: 100%; /* 填充父容器宽度 */
    margin: 0; /* 确保无边距 */
    padding: 0; /* 确保无内边距 */
  }

  /* 隐藏时间列 */
  .time-slot {
    display: none;
  }

  /* 在移动端隐藏时间列标题 */
  .time-column {
    display: none;
  }

  /* 在移动端为每个格子显示时间信息 */
  .schedule-cell::before {
    content: attr(data-time-label) " " attr(data-time-range);
    position: absolute;
    top: 2px;
    left: 4px;
    right: 4px;
    font-size: 9px;
    color: #666;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 4px;
    border-radius: 3px;
    text-align: center;
    z-index: 1;
  }

  /* 为有课程的格子调整内容位置 */
  .schedule-cell:not(:empty) {
    padding-top: 20px;
  }

  .schedule-header,
  .schedule-grid {
    grid-template-columns: repeat(7, 1fr); /* 7等分，不包含时间列 */
    min-width: unset; /* 移除最小宽度限制 */
    gap: 0; /* 移除格子间距，完全贴合 */
  }

  .day-column {
    padding: 8px 4px;
    font-size: 11px;
    border-right: 1px solid #e0e0e0;
  }

  .day-column:last-child {
    border-right: none; /* 移除最右侧列标题的右边框 */
  }

  .schedule-cell {
    min-height: 60px;
    padding: 2px;
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
  }

  /* 有课程卡片的格子减少padding */
  .schedule-cell:not(:empty) {
    padding: 1px;
  }

  .schedule-cell:nth-child(7n) {
    border-right: none; /* 移除每行最右侧格子的右边框 */
  }

  /* 课程卡片优化 */
  .course-card {
    font-size: 10px;
    padding: 4px;
    min-height: 58px; /* 接近格子的60px高度，减去padding */
    margin: 0; /* 移除边距以减少空白 */
  }

  .course-card h4 {
    font-size: 11px;
    margin-bottom: 2px;
  }

  .course-title {
    font-size: 11px;
    line-height: 1.1;
  }

  .course-card p {
    font-size: 9px;
    margin-bottom: 1px;
  }

  /* 模态框优化 */
  .modal-content {
    width: 95%;
    margin: 5% auto;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-body {
    padding: 15px;
  }

  .form-group {
    margin-bottom: 15px;
  }

  .form-actions {
    flex-direction: column;
    gap: 10px;
  }

  .form-actions .btn {
    width: 100%;
  }

  /* 上传区域优化 */
  .upload-area {
    padding: 20px;
    font-size: 14px;
  }

  /* 预览表格优化 */
  .preview-table {
    font-size: 12px;
  }

  .preview-table th,
  .preview-table td {
    padding: 6px 4px;
  }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
  .container {
    padding: 2px 0; /* 只保留上下内边距，移除左右内边距 */
    max-width: none; /* 移除最大宽度限制 */
    margin: 0; /* 移除居中边距 */
  }

  .main-content {
    padding: 15px 0; /* 移除左右内边距 */
    border-radius: 0; /* 移除圆角以贴合屏幕边缘 */
  }

  .header h1 {
    font-size: 18px;
  }

  .header {
    padding: 10px 0; /* 完全移除左右内边距 */
    margin-bottom: 8px;
    gap: 8px;
  }

  .week-navigation {
    margin-top: 8px;
    margin-bottom: 15px;
    padding: 6px 0; /* 完全移除左右内边距 */
  }

  .week-controls {
    gap: 3px;
  }

  .week-display {
    font-size: 10px;
    line-height: 1.1;
  }

  .week-display .week-date {
    display: block;
    font-size: 8px;
    color: #666;
    margin-top: 1px;
  }

  .week-input {
    width: 35px;
    height: 28px;
    font-size: 11px;
    padding: 1px 3px;
  }

  #prevWeek,
  #nextWeek {
    padding: 4px 6px;
    font-size: 10px;
    min-width: 40px;
  }

  /* 超小屏幕优化按钮文字 */
  #prevWeek {
    white-space: nowrap;
  }

  #nextWeek {
    white-space: nowrap;
  }

  .btn {
    padding: 6px 10px;
    font-size: 11px;
  }

  /* 隐藏时间列 */
  .time-slot {
    display: none;
  }

  /* 在移动端隐藏时间列标题 */
  .time-column {
    display: none;
  }

  /* 在移动端为每个格子显示时间信息 */
  .schedule-cell::before {
    content: attr(data-time-label) " " attr(data-time-range);
    position: absolute;
    top: 1px;
    left: 2px;
    right: 2px;
    font-size: 8px;
    color: #666;
    background: rgba(255, 255, 255, 0.9);
    padding: 1px 2px;
    border-radius: 2px;
    text-align: center;
    z-index: 1; /* 降低层级，显示在课程卡片下方 */
  }

  /* 为有课程的格子移除顶部预留空间 */
  .schedule-cell:not(:empty) {
    padding: 1px; /* 统一使用1px padding，不再为时间标签预留顶部空间 */
  }

  /* 有课程时让时间标签更透明 */
  .schedule-cell:not(:empty)::before {
    background: rgba(255, 255, 255, 0.6); /* 降低透明度 */
    opacity: 0.8; /* 整体透明度 */
  }

  .schedule-header,
  .schedule-grid {
    grid-template-columns: repeat(7, 1fr); /* 7等分，不包含时间列 */
    min-width: unset; /* 移除最小宽度限制 */
    gap: 0; /* 移除格子间距，完全贴合 */
  }

  .day-column {
    padding: 6px 1px;
    font-size: 10px;
    border-right: 1px solid #e0e0e0;
  }

  .day-column:last-child {
    border-right: none; /* 移除最右侧列标题的右边框 */
  }

  .schedule-cell {
    min-height: 50px;
    padding: 1px;
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
  }

  .schedule-cell:nth-child(7n) {
    border-right: none; /* 移除每行最右侧格子的右边框 */
  }

  .course-card {
    font-size: 9px;
    padding: 2px;
    min-height: 48px; /* 接近格子的50px高度，减去padding */
    margin: 0; /* 移除边距 */
  }

  .course-card h4 {
    font-size: 10px;
  }

  .course-title {
    font-size: 10px;
    line-height: 1;
  }

  .course-card p {
    font-size: 8px;
  }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #5a6fd8;
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 课程颜色主题 */
.course-card.theme-blue {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.course-card.theme-green {
  background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
}

.course-card.theme-orange {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.course-card.theme-purple {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.course-card.theme-red {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* 设置选项卡样式 */
.settings-tabs {
  display: flex;
  border-bottom: 2px solid #e9ecef;
  margin-bottom: 20px;
  gap: 5px;
}

.settings-tab {
  background: none;
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: all 0.3s ease;
  color: #666;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-tab:hover {
  background: #f8f9fa;
  color: #333;
}

.settings-tab.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3);
}

.settings-tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.settings-tab-content.active {
  display: block;
}

.settings-tab-content h3 {
  color: #333;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 云端状态显示 */
.cloud-status {
  background: #e8f4f8;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid #17a2b8;
}

.cloud-status h4 {
  margin: 0 0 10px 0;
  color: #17a2b8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cloud-status p {
  margin: 5px 0;
  color: #666;
  font-size: 0.9rem;
}

/* 警告框样式 */
.warning-box {
  background: linear-gradient(45deg, #ffc107, #fd7e14);
  color: white;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.warning-box h4 {
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.warning-box p {
  margin: 0;
  font-size: 0.9rem;
}

/* 帮助操作样式 */
.help-actions {
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.help-actions .btn {
  margin-bottom: 8px;
}

.help-text {
  margin: 8px 0 0 0;
  font-size: 0.85rem;
  color: #666;
  line-height: 1.4;
}

/* 设置页脚 */
.settings-footer {
  border-top: 1px solid #e9ecef;
  padding-top: 20px;
  margin-top: 20px;
  text-align: center;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .settings-tabs {
    flex-wrap: wrap;
  }

  .settings-tab {
    flex: 1;
    min-width: 120px;
    padding: 10px 15px;
    font-size: 0.9rem;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* PWA 独立模式样式 */
.pwa-standalone .container {
  /* 当以PWA独立模式运行时的特殊样式 */
  padding-top: max(20px, env(safe-area-inset-top));
}

.pwa-standalone .header {
  /* 独立模式下的头部样式调整 */
  padding-top: max(20px, env(safe-area-inset-top));
}

/* PWA 移动端安装按钮 */
@media (max-width: 768px) {
  /* 移动端样式已整合到主样式中 */
}

/* PWA 启动画面样式 */
@media (display-mode: standalone) {
  body {
    /* 独立模式下的特殊样式 */
    user-select: none;
    -webkit-touch-callout: none;
  }
}

/* iOS PWA 状态栏适配 */
@supports (padding-top: env(safe-area-inset-top)) {
  .pwa-standalone .container {
    padding-top: env(safe-area-inset-top);
  }
}

/* 网络状态指示器 */
.network-status {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #ff6b6b;
  color: white;
  text-align: center;
  padding: 8px;
  font-size: 14px;
  z-index: 9999;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.network-status.offline {
  transform: translateY(0);
}

.network-status.online {
  background: #51cf66;
  transform: translateY(0);
}

/* PWA 更新提示 */
.pwa-update-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px 20px;
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pwa-update-banner.show {
  transform: translateY(0);
}

.pwa-update-banner button {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  margin-left: 10px;
}

.pwa-update-banner button:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 备案信息样式 */
.footer-beian {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding: 15px 0;
  margin-top: 30px;
  text-align: center;
  font-size: 12px;
  color: #666;
}

.beian-info {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.icp-beian,
.police-beian {
  display: flex;
  align-items: center;
  gap: 5px;
}

.no-underline {
  text-decoration: none;
  color: #666;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.no-underline:hover {
  color: #667eea;
}

.beian-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

/* 移动端备案信息样式 */
@media (max-width: 768px) {
  .footer-beian {
    font-size: 11px;
    padding: 12px 0;
  }

  .beian-info {
    flex-direction: column;
    gap: 8px;
    padding: 0 15px;
  }

  .icp-beian,
  .police-beian {
    justify-content: center;
  }

  .beian-icon {
    width: 14px;
    height: 14px;
  }
}

/* PWA 模态框样式 */
.pwa-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.pwa-modal {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: pwaModalIn 0.3s ease-out;
}

@keyframes pwaModalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.pwa-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}

.pwa-modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 18px;
}

.pwa-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.pwa-modal-close:hover {
  background: #f5f5f5;
  color: #333;
}

.pwa-modal-body {
  padding: 24px;
}

.pwa-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #eee;
  text-align: right;
}

/* 安装说明样式 */
.install-instructions {
  margin: 0;
}

.install-step {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
  padding: 16px;
  background: #f8f9ff;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.step-icon {
  width: 40px;
  height: 40px;
  background: #667eea;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
  flex-shrink: 0;
  font-size: 16px;
}

.step-content h4 {
  margin: 0 0 8px 0;
  color: #333;
  font-size: 16px;
}

.step-content p {
  margin: 0;
  color: #666;
  line-height: 1.5;
}

.install-tip {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 6px;
  margin-top: 16px;
  color: #856404;
}

.install-tip i {
  margin-right: 8px;
  color: #f39c12;
}

/* 不同平台的特殊样式 */
.install-instructions.ios .step-icon {
  background: #007aff;
}

.install-instructions.ios .install-step {
  border-left-color: #007aff;
}

.install-instructions.android .step-icon {
  background: #4caf50;
}

.install-instructions.android .install-step {
  border-left-color: #4caf50;
}

.install-instructions.desktop .step-icon {
  background: #2196f3;
}

.install-instructions.desktop .install-step {
  border-left-color: #2196f3;
}

/* PWA Toast 消息样式 */
.pwa-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  padding: 16px 20px;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #667eea;
  z-index: 10001;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  max-width: 350px;
}

.pwa-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.pwa-toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-toast-success {
  border-left-color: #4caf50;
}

.pwa-toast-success i {
  color: #4caf50;
}

.pwa-toast-error {
  border-left-color: #f44336;
}

.pwa-toast-error i {
  color: #f44336;
}

.pwa-toast-info {
  border-left-color: #2196f3;
}

.pwa-toast-info i {
  color: #2196f3;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .pwa-modal {
    width: 95%;
    margin: 20px;
  }

  .pwa-toast {
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .install-step {
    padding: 12px;
  }

  .step-icon {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
}
