/* 平板与电脑排版：只在宽度 ≥600 且高度 ≥501 时生效。
   手机竖屏（宽度 <600）和手机横放（高度 ≤500，如 844×390）不进入这里的任何规则，排版与之前完全相同。
   学习页的左右分栏在 study.css，这里不再改它。 */

@media (min-width:600px) and (min-height:501px){
  /* 首页资料库：四个海报排满一行。平板竖屏不再 3+1 换行，电脑上右侧不再空出两列 */
  .posters{grid-template-columns:repeat(auto-fit,minmax(128px,1fr));gap:16px}
}
@media (min-width:600px) and (max-width:899px) and (min-height:501px){
  /* 单集卡片：600–899 宽时两列（原来 600–643 宽只能放一列，卡片过大） */
  .eps{grid-template-columns:repeat(auto-fill,minmax(260px,1fr))}
}
@media (min-width:600px) and (max-width:759px) and (min-height:501px){
  /* 我的学习只有一列时，日历按整行宽度会变成约 95px 的大方块，改为固定高度 */
  .cal-g .day{aspect-ratio:auto;height:48px}
}
@media (min-width:1024px) and (min-height:501px){
  .poster .art{padding:16px;font-size:18px}
  .poster .meta{padding:10px 16px 14px}
}

@media (min-width:760px) and (min-height:501px){
  /* 我的学习：三项统计占满第一行（原来 4 列、6 列网格里只占 3 格，右侧留空洞） */
  .stats-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-column:1/-1;gap:12px;min-width:0}
  /* 日历卡片按内容高度，不再被左侧生词本拉长成大块空卡 */
  .cal{align-self:start}
  /* 每日记录：五项摘要等分一行 */
  .day-sum{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
}
@media (min-width:900px) and (min-height:501px){
  /* 资料库：搜索框不再横跨整页，筛选按钮紧跟在右边 */
  .tools .search{flex:0 1 560px}
}

@media (min-width:1100px) and (min-height:501px){
  .cal{position:sticky;top:calc(var(--top-h) + 16px)}
  .set.words-page,.set.day-page,.set.settings-page{max-width:1200px}

  /* 生词本：两列 */
  .words-page [data-wb]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:32px}
  .words-page [data-wb]>:not(.wb-item){grid-column:1/-1}
  .words-page [data-wb]>.wb-item:nth-last-child(2):nth-child(odd){border-bottom:0}

  /* 每日记录：看过的单集占整行；新词在左，笔记和收藏在右 */
  .day-page{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:24px;align-items:start}
  .day-page>*{grid-column:1/-1}
  .day-page>section:nth-of-type(2){grid-column:1;grid-row:span 2}
  .day-page>section:nth-of-type(3),.day-page>section:nth-of-type(4){grid-column:2}

  /* 设置：分组排成两栏，从左栏往下读，再到右栏 */
  .settings-page{columns:2;column-gap:24px}
  .settings-page>.set-head{column-span:all}
  .settings-page>.sgroup{break-inside:avoid}
  .settings-page .goal-setting{display:grid;grid-template-columns:20px minmax(0,1fr);align-items:start;gap:10px;padding:14px}
  .settings-page .goal-setting .lead{margin-top:2px}
  .settings-page .goal-setting .tx{gap:5px}
  .settings-page .goal-setting .seg{grid-column:1/-1;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));width:100%;min-width:0;margin-top:2px}
  .settings-page .goal-setting .seg button{padding:0 3px;min-width:0;min-height:40px}
}
