/* ========== 基础样式 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  width: 100%;
  font-family: Arial, sans-serif;
  background: #f9f9f9;
  color: #333;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }


/* ========== Header / Footer 全屏 ========== */
header, footer {
  width: 100%;
  background: #20232a;
  color: #fff;
}
.header-container, .footer-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  align-items: center;
  padding: 10px 20px;
}
.logo {
  font-size: 20px;
  font-weight: bold;
}
.menu-toggle {
  display: none;
  font-size: 26px;
  cursor: pointer;
}

/* ========== 搜索框样式 ========== */
.search-box {
  display: flex;
  width: 100%;
}
.search-container {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 5px;
  background: #fff;
  padding: 2px 5px;
  border-radius: 20px;
  border: 1px solid #ccc;
}
.search-container input {
  flex: 1;
  border: none;
  outline: none;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 14px;
}
.search-container .search-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-container .search-btn svg {
  width: 20px;
  height: 20px;
  fill: #999;
  transition: fill 0.3s;
}
.search-container .search-btn:hover svg {
  fill: #ff4757;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ========== PC端布局 ========== */
@media (min-width: 769px) {
  .header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }
  .logo { flex: 0 0 auto; }
  .right-group {
    display: flex;
    align-items: center;
    gap: 30px;
  }
  .search-container { flex: 0 0 300px; }
  .nav-list {
    display: flex;
    gap: 15px;
    list-style: none;
    flex: 0 0 auto;
    align-items: center;
  }
  
}

/* ========== 导航路径 ========== */
.navlist {
  max-width: 1400px;
  font-size: 14px;
  padding: 15px 15px 5px 15px;
  margin: 0 auto;
  color: #777;
}
.navlist a { color: #777; }
.sohg {
  text-align: center;
  font-size: 14px;
  padding: 10px;
  color: #999;
}

/* ========== 主体布局 ========== */
.week-page {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  max-width: 1400px;
  margin: 40px auto;
  gap: 20px;
  padding: 0 15px;
}
.main-content {
  flex: 1;
  min-width: 0;
}

/* ========== 右侧放送表 ========== */
.weekly-schedule {
  max-height: calc(100vh - 40px);
  overflow-y: auto; 
  flex: 0 0 320px;
  background: #fff;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  position: sticky;
  top: 20px; 
  scrollbar-width: none;
  -ms-overflow-style: none; 
  box-shadow: inset 0 0 8px rgba(0,0,0,0.05);
}
.weekly-schedule::-webkit-scrollbar {
  display: none;
}
.weekly-schedule h2 {
  font-size: 18px;
  color: #333;
  margin-bottom: 12px;
  text-align: center;
}

/* 修复 PC 端周日按钮换行 */
.week-tabs {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 12px;
}
.week-tabs button {
  background: #eee;
  border: none;
  border-radius: 4px;
  padding: 6px 0;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.week-tabs button.active {
  background: #ff4757;
  color: #fff;
}
.week-tabs button:hover {
  background: #ff6b81;
  color: #fff;
}

/* 放送表列表 */
.day-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.anime-item {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fafafa;
  border-radius: 6px;
  padding: 6px;
  transition: background 0.2s;
}
.anime-item:hover { background: #f2f2f2; }
.anime-item img {
  width: 80px;
  height: 60px;
  border-radius: 4px;
  object-fit: cover;
}
.anime-item .info { flex: 1; }
.anime-item .name {
  font-size: 13px;
  font-weight: bold;
  color: #333;
}
.anime-item .time {
  font-size: 12px;
  color: #777;
}
.anime-item .score { color: #ff6b81; font-weight: bold;}
/* ========== 追番区样式 ========== */
.week-section {
  margin-bottom: 20px;
}

.week-title {
  font-size: 24px;
  font-weight: bold;
  color: #777;
  margin: 40px 0 10px;
  text-align: center;
}
.list-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 20px;
}

.card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}
.card:hover { transform: scale(1.05); }

.card .img-box {
  position: relative;
}

.card img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

/* 评分显示在右下角 */
.card .score {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #f39c12;
  font-size: 16px;
  padding: 3px 8px;
  border-radius: 4px;
}

.card .title {
  font-size: 14px;
  font-weight: bold;
  padding: 6px 6px 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card .info {
  font-size: 13px;
  color: #888;
  padding: 6px;
}


/* ========== Footer ========== */
footer {
  background: #333;
  color: #fff;
  text-align: center;
  padding: 15px;
}

/* ========== 抽屉菜单修正版 ========== */
.side-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 250px;
  height: 100%;
  background: #20232a;
  box-shadow: -3px 0 6px rgba(0,0,0,0.3);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.side-menu.show {
  transform: translateX(0);
}
.side-menu-inner {
  padding: 50px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.side-menu-inner ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.side-menu-inner li {
  color: #fff;
  font-size: 16px;
  line-height: 1.6;
  padding: 6px 0;
}
.side-menu-inner a {
  color: #fff;
  font-size: 16px;
}

/* 遮罩层 */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 50;
}
.overlay.show {
  opacity: 1;
  visibility: visible;
}

/* ========== 响应式：手机端下移放送表 ========== */

/* ========== 移动端布局 ========== */

@media (max-width: 900px) {
  .week-page {
    flex-direction: column;
    align-items: stretch;
  }
  .weekly-schedule {
    flex: none;
    width: 100%;
    position: static;
    margin-top: 20px;
  }
}

@media (max-width: 768px) {
  .nav-list { display: none; }
  .menu-toggle { display: block; }
  .header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .list-container {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 15px;
  }
  .card img { height: 220px; }
  .search-container { order: -1; flex: 1; }
  .search-container input { flex: 1; }
  #week3, #week4, #week5, #week6, #week7{ display: none; }
}

@media (max-width: 420px) {
  .header-container {
    flex-wrap: nowrap; /* 保持单行 */
    justify-content: space-between;
    gap: 10px; /* 缩小间距 */
  }
  .logo {
    flex: 0 0 auto;
    font-size: 16px; /* 缩小字体避免过宽 */
  }
  .menu-toggle {
    flex: 0 0 auto;
    font-size: 22px;
  }
  .search-container {
    flex: 1 1 auto; /* 可伸缩 */
    min-width: 80px; /* 限制最小宽度避免被挤没 */
    max-width: 100%; /* 不超过容器宽度 */
  }
  .search-container input {
    font-size: 13px;
    padding: 5px 8px;
  }
  .score { font-size: 14px; }
}

/* 超小屏优化 */
@media (max-width: 380px) {
  .list-container {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  }
  .card img { height: 200px; }
  
  .search-container input { max-width: 140px; }
}


/* ========== 历史记录下拉 ========== */
#historyMenu { position: relative; }
#historyBox {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  max-height: 300px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 999;
}
#historyBox ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
#historyBox li {
  border-bottom: 1px solid #eee;
}
#historyBox li a {
  display: block;
  padding: 6px 10px;
  font-size: 13px;
  color: #333;
  text-decoration: none;
}
#historyBox li a:hover {
  background: #f2f2f2;
}
