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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #F9FAFB;
  color: #1D2939;
  min-height: 100vh;
  line-height: 1.5;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.loading-message {
  text-align: center;
  padding: 40px 0;
  color: #667085;
}

/* 头部导航 */
header {
  position: sticky;
  top: 0;
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  z-index: 50;
  transition: all 0.3s ease;
  padding: 12px 0; /* 手机端减小顶部导航高度 */
}

.navbar-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

@media (min-width: 768px) {
  .navbar-content {
    flex-direction: row;
  }
}

.logo {
  display: flex;
  align-items: center;
  margin-bottom: 8px; /* 手机端原样式 */
  /* 新增：防止被挤压，确保有足够宽度显示文字 */
  flex-shrink: 0; 
}

@media (min-width: 768px) {
  .logo {
    margin-bottom: 0; /* 桌面端原样式 */
    flex-shrink: 0; /* 桌面端也保留，避免异常挤压 */
  }
}

.logo-icon {
  color: #165DFF;
  font-size: 20px; /* 手机端缩小图标 */
  margin-right: 8px;
}

.logo-text {
  font-size: 18px; /* 手机端原样式 */
  font-weight: bold;
  color: #165DFF;
  /* 新增：强制单行 + 溢出处理 */
  white-space: nowrap; /* 关键：禁止文字自动换行 */
  overflow: hidden; /* 溢出部分隐藏（避免超出容器） */
  text-overflow: ellipsis; /* 极端情况溢出时显示省略号（可选） */
}

@media (min-width: 768px) {
  .logo-text {
    font-size: 24px; /* 桌面端原样式 */
    /* 桌面端空间充足，可保留nowrap确保一致性 */
    white-space: nowrap;
  }
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px; /* 手机端原间距 */
  width: 100%;
  /* 原样式max-width: 280px，可适当减小（比如250px），给logo腾空间 */
  max-width: 250px; /* 调整后：减小右侧最大宽度，避免挤压左侧logo */
}

@media (min-width: 768px) {
  .header-right {
    flex-direction: row;
    align-items: center;
    max-width: none;
  }
}

.current-datetime {
  text-align: center;
  width: 100%;
}

@media (min-width: 768px) {
  .current-datetime {
    text-align: right;
    width: auto;
  }
}

.date-text {
  font-size: 13px; /* 手机端缩小日期文字 */
  color: #667085;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.time-text {
  font-weight: 500;
  font-size: 15px; /* 手机端时间文字大小 */
}

.today-btn {
  background-color: #165DFF;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 12px; /* 手机端减小按钮大小 */
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s ease;
  font-size: 14px; /* 手机端按钮文字 */
  width: 100%;
  justify-content: center;
}

@media (min-width: 768px) {
  .today-btn {
    width: auto;
  }
}

.today-btn:hover {
  background-color: #0E4CD1;
}

/* 主内容区 */
main {
  padding: 20px 0; /* 手机端减小上下间距 */
}

/* 日期选择器 */
.date-picker {
  display: flex;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 20px; /* 手机端减小底部间距 */
  gap: 6px;
  scrollbar-width: none; /* 隐藏滚动条 */
  -ms-overflow-style: none;
}

.date-picker::-webkit-scrollbar {
  display: none; /* 隐藏滚动条 */
}

.date-item {
  flex-shrink: 0;
  padding: 8px 12px; /* 手机端减小日期项大小 */
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: white;
  color: #344054;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  min-width: 60px; /* 确保日期项有足够宽度 */
}

.date-item:hover {
  background-color: #F2F4F7;
}

.date-item.selected {
  background-color: #165DFF;
  color: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.date-weekday {
  font-size: 13px; /* 手机端缩小文字 */
}

.date-day {
  font-weight: 500;
  font-size: 15px;
}

/* 时间轴容器 */
.timeline-container {
  position: relative;
  padding-left: 16px; /* 手机端增加左侧内边距，避免时间轴太靠边 */
}

.timeline-line {
  position: absolute;
  left: 16px; /* 手机端调整时间轴位置 */
  height: 100%;
  width: 2px;
  background-color: #D0D5DD;
}

@media (min-width: 768px) {
  .timeline-line {
    left: 50%;
    transform: translateX(-50%);
  }
}

.timeline-dot {
  position: absolute;
  left: 16px; /* 手机端调整时间点位置 */
  width: 10px; /* 手机端缩小时间点 */
  height: 10px;
  border-radius: 50%;
  background-color: #165DFF;
  transform: translateX(-50%);
  z-index: 10;
}

@media (min-width: 768px) {
  .timeline-dot {
    left: 50%;
    width: 12px;
    height: 12px;
  }
}

.current-time-indicator {
  position: absolute;
  left: 16px; /* 手机端调整当前时间指示器位置 */
  width: 18px; /* 手机端缩小指示器 */
  height: 18px;
  border-radius: 50%;
  background-color: rgba(255, 125, 0, 0.2);
  border: 2px solid #FF7D00;
  transform: translateX(-50%);
  z-index: 10;
  animation: pulse 2s infinite;
  display: none;
}

@media (min-width: 768px) {
  .current-time-indicator {
    left: 50%;
    width: 20px;
    height: 20px;
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 125, 0, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 125, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 125, 0, 0);
  }
}

/* 节目列表 */
.programs-container {
  display: flex;
  flex-direction: column;
  gap: 20px; /* 手机端减小节目间距 */
  padding-bottom: 40px; /* 手机端减小底部留白 */
}

.program-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  opacity: 1;
}

@media (min-width: 768px) {
  .program-card {
    flex-direction: row;
    align-items: center;
  }
}

.program-card.past {
  opacity: 0.7;
}

.program-card.current {
  opacity: 1;
}

.time-label {
  flex-shrink: 0;
  width: 70px; /* 手机端调整时间标签宽度 */
  text-align: center;
  margin-bottom: 8px; /* 手机端减小间距 */
  font-weight: 500;
  font-size: 14px;
}

@media (min-width: 768px) {
  .time-label {
    width: auto;
    margin-right: 24px;
    margin-bottom: 0;
    font-size: 16px;
  }
}

.program-card.current .time-label {
  color: #FF7D00;
}

.content-card {
  width: 100%;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 12px 14px; /* 手机端减小内边距 */
  cursor: pointer;
  transition: all 0.3s ease;
}

@media (min-width: 768px) {
  .content-card {
    padding: 20px;
    flex: 1;
  }
}

.content-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

.program-card.current .content-card {
  border-left: 4px solid #FF7D00;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap; /* 确保在小屏幕内容不会溢出 */
  gap: 8px;
}

.program-title {
  font-size: 16px; /* 手机端减小标题大小 */
  font-weight: bold;
  margin-bottom: 3px;
  flex: 1;
  min-width: 0; /* 允许文字溢出时显示省略号 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  .program-title {
    font-size: 18px;
    white-space: normal;
  }
}

.program-card.current .program-title {
  color: #FF7D00;
}

.program-duration {
  font-size: 12px; /* 手机端减小文字 */
  color: #667085;
  display: flex;
  align-items: center;
  gap: 4px;
}

.program-category {
  padding: 2px 8px; /* 手机端减小内边距 */
  background-color: rgba(22, 93, 255, 0.1);
  color: #165DFF;
  border-radius: 12px;
  font-size: 11px; /* 手机端减小文字 */
  font-weight: 500;
  white-space: nowrap;
}

/* 页脚 */
footer {
  background-color: #1D2939;
  color: white;
  padding: 16px 0; /* 手机端减小页脚高度 */
  margin-top: 20px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
  }
}

.copyright {
  font-size: 12px; /* 手机端缩小文字 */
  color: #94A3B8;
  margin-bottom: 12px;
  text-align: center;
}

@media (min-width: 768px) {
  .copyright {
    margin-bottom: 0;
    text-align: left;
  }
}

.social-links {
  display: flex;
  gap: 12px; /* 手机端减小图标间距 */
}

.social-link {
  color: #94A3B8;
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: 16px;
}

.social-link:hover {
  color: white;
}

/* 节目详情弹窗 - 手机端优化 */
.program-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 50;
  display: none;
  align-items: flex-end; /* 手机端弹窗从底部弹出 */
  justify-content: center;
  padding: 0;
  overflow-y: auto;
}

@media (min-width: 768px) {
  .program-modal {
    align-items: center;
    padding: 16px;
  }
}

.modal-content {
  background-color: white;
  border-radius: 16px 16px 0 0; /* 手机端顶部圆角 */
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  transform: translateY(100%); /* 初始位置在屏幕外 */
}

.program-modal.active .modal-content {
  transform: translateY(0); /* 显示时滑入屏幕 */
}

@media (min-width: 768px) {
  .modal-content {
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    opacity: 0;
  }
  
  .program-modal.active .modal-content {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-image-container {
  height: 180px; /* 手机端减小图片高度 */
  background-color: #F2F4F7;
}

@media (min-width: 768px) {
  .modal-image-container {
    height: 320px;
  }
}

.modal-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.close-modal {
  position: absolute;
  top: 12px;
  right: 12px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  width: 30px; /* 手机端调整关闭按钮 */
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
  z-index: 10;
}

.close-modal:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

.modal-body {
  padding: 16px; /* 手机端减小内边距 */
}

.modal-header {
  display: flex;
  flex-direction: column; /* 手机端垂直排列 */
  gap: 10px;
  margin-bottom: 12px;
}

@media (min-width: 768px) {
  .modal-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
  }
}

.modal-title {
  font-size: 20px; /* 手机端减小标题 */
  font-weight: bold;
  margin-bottom: 4px;
}

.modal-time {
  color: #667085;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  margin-bottom: 8px;
}

@media (min-width: 768px) {
  .modal-time {
    margin-bottom: 0;
  }
}

.modal-details {
  border-top: 1px solid #F2F4F7;
  padding-top: 14px;
  margin-top: 14px;
}

.modal-description-title {
  font-size: 16px; /* 手机端减小标题 */
  font-weight: 600;
  margin-bottom: 10px;
}

.modal-description {
  color: #344054;
  line-height: 1.6;
  font-size: 14px; /* 手机端减小文字 */
}

.modal-actions {
  display: flex;
  flex-direction: column; /* 手机端按钮垂直排列 */
  gap: 10px;
  margin-top: 20px;
}

@media (min-width: 768px) {
  .modal-actions {
    flex-direction: row;
    justify-content: flex-end;
    gap: 12px;
  }
}

.remind-btn, .share-btn {
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.2s ease;
  font-size: 15px;
  width: 100%; /* 手机端按钮占满宽度 */
}

@media (min-width: 768px) {
  .remind-btn, .share-btn {
    width: auto;
    padding: 8px 16px;
  }
}

.remind-btn {
  border: 1px solid #165DFF;
  color: #165DFF;
  background-color: transparent;
}

.remind-btn:hover {
  background-color: rgba(22, 93, 255, 0.05);
}

.share-btn {
  background-color: #165DFF;
  color: white;
  border: none;
}

.share-btn:hover {
  background-color: #0E4CD1;
}

/* 自定义图标 */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  position: relative;
}

.icon-television::before { content: "📺"; }
.icon-calendar::before { content: "📅"; }
.icon-clock::before { content: "⏰"; }
.icon-times::before { content: "✕"; }
.icon-bell::before { content: "🔔"; }
.icon-share::before { content: "🔗"; }
.icon-facebook::before { content: "f"; font-weight: bold; }
.icon-twitter::before { content: "t"; font-weight: bold; }
.icon-instagram::before { content: "i"; font-weight: bold; }
.icon-youtube::before { content: "Y"; font-weight: bold; }
    