/* 学生作业展示样式 */

/* 班级Tab样式 */
.class-tabs-section {
  margin-bottom: 24px;
}

.class-tabs {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.class-tab {
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 25px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s ease;
  user-select: none;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.class-tab:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.class-tab.active {
  background: white;
  color: #667eea;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  font-weight: 600;
}

.class-tab.active:hover {
  background: white;
  color: #5a6fd6;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
  .class-tabs {
    gap: 8px;
  }
  
  .class-tab {
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* 作业网格布局 */
.assignments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding: 24px 0;
}

@media (max-width: 768px) {
  .assignments-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    padding: 16px 0;
  }
}

/* 作业卡片 - 整卡可点击跳转 */
.assignment-card {
  display: block;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.assignment-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.assignment-preview {
  position: relative;
  width: 100%;
  padding-top: 40%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
}

.assignment-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
}

.assignment-info {
  padding: 20px;
}

.assignment-name {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin: 0 0 8px 0;
}

.assignment-description {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
  line-height: 1.5;
}

.assignment-meta {
  margin-bottom: 16px;
}

.assignment-type {
  display: inline-block;
  padding: 4px 12px;
  background: #f0f0f0;
  border-radius: 15px;
  font-size: 12px;
  color: #666;
}

/* 作品网格布局 */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 24px 0;
}

@media (max-width: 768px) {
  .works-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    padding: 16px 0;
  }
}

/* 作品卡片 */
.work-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.work-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 禁用状态的卡片 */
.work-card--disabled {
  opacity: 0.6;
  cursor: default;
}

.work-card--disabled:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 作品预览区域 */
.work-preview {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 比例 */
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  overflow: hidden;
}

.work-card--disabled .work-preview {
  background: linear-gradient(135deg, #999 0%, #666 100%);
}

/* 优秀作品奖章 */
.medal-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 36px;
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  animation: medal-shine 2s ease-in-out infinite;
}

@keyframes medal-shine {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.08); }
}

.work-avatar {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.work-avatar:has(.work-thumbnail) {
  top: 0;
  left: 0;
  transform: none;
  width: 100%;
  height: 100%;
}

.work-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-emoji {
  font-size: 48px;
}

.avatar-disabled {
  opacity: 0.5;
}

.work-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.work-card:hover .work-overlay {
  opacity: 1;
}

.work-overlay--disabled {
  background: rgba(0, 0, 0, 0.3);
  opacity: 1;
}

.btn-view {
  padding: 12px 24px;
  background: white;
  color: #333;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  transition: transform 0.2s ease;
}

.btn-view:hover {
  transform: scale(1.05);
}

/* 作业列表页「查看作业」主按钮 - 更醒目 */
.assignment-card .btn-view--primary {
  display: inline-block;
  padding: 14px 28px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.assignment-card:hover .btn-view--primary {
  transform: scale(1.03);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.45);
}

/* 作品信息区域 */
.work-info {
  padding: 16px;
}

.work-title {
  margin-bottom: 8px;
}

.work-nickname {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-description {
  margin-bottom: 12px;
  min-height: 40px;
}

.work-description p {
  font-size: 14px;
  color: #666;
  margin: 0;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.student-id {
  font-size: 13px;
  color: #888;
  margin: 0;
}

.work-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #999;
  flex-wrap: wrap;
  gap: 8px;
}

.work-type {
  color: #666;
}

/* 状态标签 */
.work-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-completed {
  background: #e8f5e9;
  color: #4caf50;
}

.status-pending {
  background: #fff3e0;
  color: #ff9800;
}

.work-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
}

.work-meta-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-portfolio {
  color: #667eea;
  font-size: 12px;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 15px;
  border: 1px solid #667eea;
  transition: all 0.3s ease;
}

.btn-portfolio:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #5568d3;
}

.btn-share {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-share:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* 分享成功提示 */
.share-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 14px;
  z-index: 9999;
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  grid-column: 1 / -1;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.empty-state h2 {
  font-size: 24px;
  color: #333;
  margin-bottom: 10px;
}

.empty-state p {
  font-size: 16px;
  color: #666;
  margin-bottom: 30px;
}

/* 错误消息 */
.error-message {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #f44336;
}

.error-message p {
  margin: 8px 0;
  color: #333;
}

/* 按钮样式 */
.btn-primary {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  display: inline-block;
  padding: 12px 24px;
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  transition: background 0.3s ease, color 0.3s ease;
}

.btn-secondary:hover {
  background: #667eea;
  color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .assignment-info {
    padding: 16px;
  }

  .assignment-name {
    font-size: 18px;
  }

  .work-info {
    padding: 12px;
  }

  .work-nickname {
    font-size: 16px;
  }
}
