/* 基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

body {
  background: #f5f6fa;  /* 改为灰色背景，不再使用紫色渐变 */
  min-height: 100vh;
  color: #333;
  line-height: 1.6;
}

/* 基础样式 - 已移至sidebar.css */
/* 
.app-container {
  已移至sidebar.css管理布局
}
*/

/* 头部样式 */
.app-header {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  color: #333;
  padding: 1.2rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-title {
  font-size: 1.6rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-title i {
  -webkit-text-fill-color: #667eea;
}

/* 旧版样式 - 已由sidebar.css接管 */
/*
.app-main {
  flex: 1;
  padding: 2rem;
}

.auth-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: 1.5rem;
  animation: fadeIn 0.5s ease-in-out;
}
*/

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

.auth-section h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.auth-section p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
}

.login-btn {
  background: white;
  color: #667eea;
  border: none;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.15);
}

.login-btn:active {
  transform: translateY(0);
}

/* 用户区域样式 */
.user-section {
  display: none;
  gap: 2rem;
  animation: fadeIn 0.5s ease-in-out;
}

.user-info-card {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  transition: transform 0.3s ease;
}

.user-info-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

.user-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #667eea;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.user-details {
  flex: 1;
}

.user-details h2 {
  font-size: 1.6rem;
  margin: 0;
  color: #2c3e50;
  font-weight: 600;
}

.logout-btn {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.3s ease;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(245, 87, 108, 0.3);
}

.logout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

/* 课程操作区域 */
.course-actions {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.course-actions h3 {
  font-size: 1.4rem;
  color: #2c3e50;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.import-area {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.import-area label {
  color: #666;
  font-weight: 500;
}

.import-area input[type="file"] {
  padding: 0.5rem;
  border: 2px dashed #667eea;
  border-radius: 10px;
  background: rgba(102, 126, 234, 0.05);
  cursor: pointer;
  transition: all 0.3s ease;
}

.import-area input[type="file"]:hover {
  border-color: #764ba2;
  background: rgba(102, 126, 234, 0.1);
}

.delete-btn {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(250, 112, 154, 0.3);
}

.delete-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(250, 112, 154, 0.4);
}

/* 课程表容器样式 */
.course-table {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* 今日列高亮 */
.schedule-table thead th.today-column {
  background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%) !important;
  color: white !important;
  font-weight: 700 !important;
  position: relative;
  animation: pulse 2s infinite;
  z-index: 30 !important;  /* 最高优先级 */
  overflow: visible !important;
}

/* 确保表头始终在最上层 */
.schedule-table thead {
  position: relative;
  z-index: 25;
}


/* 当前时间段高亮 - 只影响普通单元格行背景 */
.current-period td.empty-cell {
  background: rgba(255, 216, 155, 0.08) !important;
}

/* 今日课程样式 */
.course-cell.today-course {
  position: relative;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.empty-cell.today-empty {
  background: rgba(102, 126, 234, 0.03);
}

/* 下一节课自动高亮（只应用于课程单元格） */
.course-cell.next-course-highlight {
  animation: nextClassGlow 2s ease-in-out infinite;
  border: 2px solid #667eea !important;
  position: relative;
  background: linear-gradient(135deg, 
    rgba(102, 126, 234, 0.15) 0%, 
    rgba(118, 75, 162, 0.15) 100%) !important;
}

@keyframes nextClassGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.4),
                inset 0 0 10px rgba(102, 126, 234, 0.1);
  }
  50% {
    box-shadow: 0 0 25px rgba(102, 126, 234, 0.6),
                inset 0 0 15px rgba(102, 126, 234, 0.2);
  }
}

.course-cell.next-course-highlight .course-name {
  font-weight: 700 !important;
  color: #667eea !important;
}

.course-cell.next-course-highlight .course-location {
  font-weight: 600 !important;
  color: #764ba2 !important;
}

.next-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  z-index: 10;
  box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
  animation: pulse 2s infinite;
}

/* 上课中徽章样式 */
.current-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ff4757 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  z-index: 10;
  box-shadow: 0 4px 10px rgba(255, 107, 107, 0.4);
  animation: pulse 1.5s infinite;
}

/* 当前正在上课的课程高亮 */
.current-course-highlight {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(255, 71, 87, 0.1) 100%) !important;
  border: 2px solid #ff6b6b !important;
  animation: currentClass 2s ease-in-out infinite;
}

@keyframes currentClass {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
  }
  50% { 
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

.schedule-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 900px;
  position: relative;
}

.schedule-table thead {
  background: white;
}

.schedule-table th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
  padding: 15px 10px;
  text-align: center;
  border: none;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.schedule-table th:first-child {
  border-top-left-radius: 15px;
}

.schedule-table th:last-child {
  border-top-right-radius: 15px;
}

.schedule-table .time-column {
  width: 120px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.schedule-table td {
  border: 1px solid #f0f0f0;
  padding: 8px;
  vertical-align: middle;
  height: 70px;
  position: relative;
  background: white;
  transition: background 0.3s ease;
}

/* 课程单元格悬停效果 */
.course-cell {
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: visible;
  border-radius: 10px;
  border: none !important;
}

.course-cell.course-hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
  z-index: 15;  /* 降低z-index，不遮挡表头 */
  border: 2px solid currentColor !important;
}

.course-cell.course-hover .course-content {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.95) 0%, 
    rgba(255, 255, 255, 0.85) 100%);
  backdrop-filter: blur(10px);
}

.course-cell.course-hover .course-name {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
}

.course-cell.course-hover .course-location {
  font-size: 13px;
  font-weight: 500;
  color: #555;
}

/* 全局悬浮详情框样式 - 聊天气泡风格 */
.hover-details-popup {
  display: none;
  position: fixed !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
  border-radius: 18px !important;
  padding: 18px 20px !important;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.35) !important;
  z-index: 9999 !important;
  font-size: 13px !important;
  line-height: 1.8 !important;
  min-width: 250px !important;
  max-width: 300px !important;
  pointer-events: none; /* 防止鼠标事件干扰 */
  position: relative;
}

/* 左侧气泡的小尾巴 */
.hover-details-popup.left-bubble::after {
  content: '';
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid #764ba2;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

/* 右侧气泡的小尾巴（当左边空间不够时） */
.hover-details-popup.right-bubble::after {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-right: 12px solid #667eea;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

.hover-details-popup div {
  margin: 8px 0;
  color: white !important;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  font-size: 14px;
}

.hover-details-popup div:before {
  content: '✦';
  color: rgba(255, 255, 255, 0.9);
  font-weight: bold;
  font-size: 12px;
}

/* 从左侧滑入动画 */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 从右侧滑入动画 */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 课程详情卡片 - 默认隐藏 */
.course-details {
  display: none;
  position: fixed !important;  /* 使用fixed定位，不受父元素限制 */
  background: white !important;
  border-radius: 12px !important;
  padding: 15px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
  z-index: 9999 !important;
  font-size: 13px !important;
  line-height: 1.8 !important;
  min-width: 250px !important;
  white-space: nowrap !important;
  border: 1px solid rgba(102, 126, 234, 0.2) !important;
  animation: fadeInUp 0.3s ease-out !important;
}

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

.course-details div {
  margin: 6px 0;
  color: #444;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.course-details div:before {
  content: '▸';
  color: #667eea;
  font-weight: bold;
  font-size: 14px;
}

/* 删除重复的时间列样式 */

/* 时间单元格样式 - 始终保持一致的样式 */
td.time-cell {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%) !important;
  text-align: center !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  border: 1px solid #f0f0f0 !important;
  box-shadow: none !important;
  animation: none !important;
  position: relative !important;
  z-index: 1 !important;
}

.period-number {
  font-weight: 600;
  color: #667eea;
  font-size: 13px;
}

.period-time {
  color: #888;
  font-size: 11px;
  margin-top: 4px;
}

.course-content {
  padding: 10px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;  /* 水平居中 */
  text-align: center;    /* 文本居中 */
  border-radius: 10px;
}

.course-name {
  font-weight: 600;
  font-size: 14px;
  color: #2c3e50;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
  width: 100%;  /* 确保占满宽度 */
}

.course-location {
  font-size: 12px;
  color: #7f8c8d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;  /* 居中对齐 */
  gap: 4px;
  width: 100%;
}

.course-location:before {
  content: '📍';
  font-size: 11px;
}

.empty-cell {
  background: linear-gradient(135deg, rgba(240, 240, 240, 0.5) 0%, rgba(250, 250, 250, 0.5) 100%);
}

.section-divider {
  height: 40px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.section-divider td {
  text-align: center;
  font-weight: 600;
  color: #999;
  border: none;
  padding: 10px;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: 4rem;
  color: #999;
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  display: block;
  color: #667eea;
  opacity: 0.5;
}

.empty-state p {
  font-size: 1.1rem;
  color: #666;
}

/* 消息提示样式 */
.message {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 0.8rem 1.2rem;
  border-radius: 10px;
  display: none;
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  font-weight: 500;
  font-size: 0.9rem;
  max-width: 300px;
  white-space: nowrap;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.message.info {
  display: block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.message.error {
  display: block;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

/* 页脚样式 */
.app-footer {
  text-align: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 3rem;
  font-size: 0.9rem;
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b4199 100%);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .app-header {
    padding: 1rem;
  }

  .app-main {
    padding: 1rem;
  }

  .user-info-card {
    flex-direction: column;
    text-align: center;
  }

  .logout-btn {
    margin-left: 0;
    margin-top: 1rem;
    width: 100%;
    justify-content: center;
  }
  
  /* 移动端顶部栏调整 */
  .top-bar {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }
  
  .top-bar-left,
  .top-bar-center,
  .top-bar-right {
    justify-content: center;
  }
  
  .week-navigator {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .current-week,
  .current-time {
    font-size: 0.8rem;
  }
}

/* 大屏幕调整 */
@media (min-width: 1600px) {
  .top-bar {
    max-width: 1600px;
    margin: 0 auto;
  }
  
  .week-navigator {
    gap: 2rem;
    padding: 0.8rem 2rem;
  }
}

  .import-area {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
  }

  .delete-btn {
    width: 100%;
    justify-content: center;
  }

  .schedule-table {
    font-size: 11px;
  }
  
  .course-name {
    font-size: 12px;
  }
  
  .course-location {
    font-size: 10px;
  }
  
  .schedule-table td {
    height: 60px;
    padding: 4px;
  }

  .message {
    top: 80px;
    right: 10px;
    max-width: calc(100% - 20px);
  }
}

/* 周导航样式 */
.top-bar {
  background: white;
  padding: 0.8rem 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 56px;
}

.top-bar-left,
.top-bar-center,
.top-bar-right {
  display: none; /* 移除旧的布局元素 */
}

.page-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-title i {
  color: #667eea;
}

.week-navigator {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  padding: 0.6rem 1.5rem;
  border-radius: 50px;
  box-shadow: 0 3px 15px rgba(102, 126, 234, 0.15);
}

.week-nav-btn {
  background: white;
  border: 2px solid #667eea;
  color: #667eea;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.week-nav-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.week-nav-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.week-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.week-display {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 280px;
  justify-content: center;
}

.week-number {
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.week-date-range {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

.current-week-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.2);
  margin-left: 0.5rem;
}

.current-week-btn i {
  font-size: 0.75rem;
}

.current-week-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.current-week-btn:active {
  transform: translateY(0);
}

.current-week {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

.current-time {
  font-size: 0.9rem;
  color: #999;
  margin-left: 1rem;
}

/* 主内容区样式 */
.main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f5f6fa;
  overflow: hidden;
}

.content-area {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

.course-table-container {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
}

.schedule-wrapper {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 1rem;
}