/* =====================================================================
   首页样式 —— 版式对齐省级青少年科技教育协会门户
   ---------------------------------------------------------------------
   版式要点（与参考站一致）：
   · 容器 1300px，行间距 50px；主栏按黄金比 61.8% / 38.2% 分左右
   · 每个模块是一张白卡：顶部红色圆角标签页 + 右侧 + MORE，卡体 padding 15px
   · 列表行：红色小圆点 + 标题（超出省略） + 可选 NEW 角标 + 右侧日期
   · 图文卡：图片 + 底部 40px 半透明落幕白字（object-fit: cover）
   · 全宽模块：品牌活动（130px 图标格）、活动影像（等分缩略图）、
                专家团队（220 方正头像横滑）、友情链接（标签流）
   ===================================================================== */

:root {
  --h-red: #e60016;
  --h-red-d: #b72e2e;
  --h-ink: #333;
  --h-ink-2: #555;
  --h-ink-3: #888;
  --h-gray: #999;
  --h-line: #e8e8e8;
  --h-wrap: 1300px;
  --h-gap: 50px;
}

/* ---------------- 首屏：轮播 + 通知速览 ---------------- */
.h-hero {
  max-width: var(--h-wrap); margin: 0 auto; padding: 16px 20px 0;
  display: grid; grid-template-columns: 1fr 150px; gap: 12px; align-items: stretch;
}

/* 参考站 .module-wrap{height:410px}：三端统一的固定高，图片 cover 裁切 */
.h-slider { position: relative; overflow: hidden; background: #e9eef5; height: 410px; }
.h-track { display: flex; width: 100%; height: 100%; transition: transform .55s cubic-bezier(.22, .61, .36, 1); }
.h-slide { position: relative; flex: 0 0 100%; height: 100%; display: block; overflow: hidden; }
.h-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 参考站 .swiper-bottom / .s-b-bg / .tit：
   底部通栏 = 深红(#b72e2e) 70% + 半透明黑 36%，白字居中加粗 18px/1.35 */
.h-slide .h-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  min-height: 44px; padding: 6px 0; background: rgba(183, 46, 46, .7);
  display: flex; align-items: center; justify-content: center;
}
.h-slide .h-cap-tit {
  width: 100%; box-sizing: border-box; padding: 2px 20px;
  background: rgba(0, 0, 0, .36);
  color: #fff; font-size: 18px; font-weight: 700; line-height: 1.35; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.h-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 34px; height: 52px; border: 0; cursor: pointer;
  background: rgba(0, 0, 0, .26); color: #fff; font-size: 24px; line-height: 1;
  opacity: 0; transition: opacity .25s var(--ease), background-color .2s;
}
.h-slider:hover .h-arrow { opacity: 1; }
.h-arrow:hover { background: rgba(0, 0, 0, .5); }
.h-arrow.prev { left: 0; }
.h-arrow.next { right: 0; }
.h-dots { grid-column: 1; display: flex; gap: 8px; justify-content: center; padding-top: 10px; min-height: 19px; }
.h-dots button {
  width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%;
  background: #c9d5e2; cursor: pointer; transition: background-color .2s, transform .2s;
}
.h-dots button:hover { background: #93a8bd; }
.h-dots button.on { background: var(--h-red); transform: scale(1.3); }

/* 右侧红色通告卡 */
.h-notice {
  display: flex; flex-direction: column;
  background: linear-gradient(155deg, #c8121d 0%, #9c0b14 100%);
  color: #fff; padding: 12px 10px 10px; overflow: hidden;
}
.h-notice h3 {
  font-size: 16px; letter-spacing: 1px; font-weight: 700; margin: 0 0 3px;
  display: flex; align-items: center; gap: 6px;
}
.h-notice h3::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .35); }
.h-notice .sub { font-size: 10px; opacity: .75; margin-bottom: 8px; letter-spacing: .3px; }
.h-notice ul { list-style: none; margin: 0; padding: 0; flex: 1; }
.h-notice li { margin-bottom: 7px; }
.h-notice li a {
  font-size: 12.5px; line-height: 1.5; color: #fff;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.h-notice li a:hover { text-decoration: underline; }
.h-notice li em { display: block; font-style: normal; font-size: 10px; opacity: .72; margin-top: 1px; }
.h-notice .all {
  margin-top: auto; display: block; text-align: center; height: 28px; line-height: 28px;
  background: rgba(255, 255, 255, .16); font-size: 11.5px; color: #fff;
  border: 1px solid rgba(255, 255, 255, .3);
}
.h-notice .all:hover { background: rgba(255, 255, 255, .26); }

/* ---------------- 模块栅格 ---------------- */
.h-main { max-width: var(--h-wrap); margin: 0 auto; padding: 0 20px; }
.h-row { display: flex; flex-wrap: wrap; align-items: stretch; margin: 0 -5px; padding-top: var(--h-gap); }
.h-col { display: flex; padding: 0 5px; min-width: 0; }
.h-col.c618 { width: 61.8%; }
.h-col.c382 { width: 38.2%; }
.h-col.c100 { width: 100%; }

/* 模块卡片 */
.m-card {
  flex: 1; display: flex; flex-direction: column; min-width: 0;
  background: #fff; border-radius: 5px; box-shadow: 0 1px 2px rgba(16, 42, 70, .04);
}
.m-head {
  display: flex; align-items: flex-end; height: 35px; padding: 0 8px; min-width: 0;
  border-bottom: 1px solid var(--h-line); background: #fff;
  border-radius: 5px 5px 0 0;
}
.m-tabs { display: flex; align-items: flex-end; min-width: 0; }
.m-tab {
  padding: 6px 16px; font-size: 16px; font-weight: 500; line-height: 1.5;
  color: var(--h-ink); border-radius: 6px 6px 0 0;
  white-space: nowrap; transition: background-color .18s, color .18s;
}
.m-tab[data-pane] { cursor: pointer; }
.m-tab[data-pane]:hover { background: var(--h-red); color: #fff; }
.m-tab.on { background: var(--h-red); color: #fff; }
.m-head .more {
  margin-left: auto; padding-bottom: 9px; font-size: 14px; font-weight: 500;
  color: var(--h-red); white-space: nowrap; flex-shrink: 0;
}
.m-head .more:hover { color: var(--h-red-d); font-weight: 700; }
.m-body { flex: 1; min-width: 0; padding: 15px 15px 16px; }
.m-body.tight { padding: 12px 12px 14px; }

/* 列表行 */
.m-list { display: flex; flex-direction: column; }
.m-list a {
  display: flex; align-items: baseline; gap: 6px;
  padding: 3px 0; font-size: 16px; line-height: 1.75; color: var(--h-ink);
  min-width: 0; overflow: hidden;
}
.m-list a::before {
  content: ""; flex-shrink: 0; width: 4px; height: 4px; border-radius: 50%;
  background: var(--h-red); opacity: .75; transform: translateY(-4px);
}
.m-list .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-list a:hover .t { color: var(--h-red); }
.m-list .d {
  flex-shrink: 0; color: var(--h-gray); font-size: 14px;
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.m-list .newmark {
  flex-shrink: 0; font-size: 11px; font-weight: 700; font-style: italic;
  color: var(--h-red); letter-spacing: .02em; transform: translateY(-2px);
}
.m-list .srcmark {
  flex-shrink: 0; font-size: 11px; color: #1a7fc4; background: #eaf4fd;
  border-radius: 2px; padding: 0 5px; line-height: 17px; transform: translateY(-1px);
  max-width: 6em; flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 无日期的紧凑行 */
.m-list.plain a { padding: 4px 0; font-size: 15px; }

/* ---------------- 图文卡（封面 + 落幕白字） ---------------- */
.m-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.m-thumb {
  position: relative; display: block; overflow: hidden; background: #e9eef5;
  aspect-ratio: 376 / 272;
}
.m-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.m-thumb:hover img { transform: scale(1.045); }
.m-thumb .cap {
  position: absolute; left: 0; right: 0; bottom: 0; height: 40px; line-height: 40px;
  padding: 0 10px; color: #fff; font-size: 15px; text-align: center;
  background: linear-gradient(transparent, rgba(0, 0, 0, .74));
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.m-thumb .play {
  position: absolute; left: 50%; top: 50%; width: 46px; height: 46px;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: rgba(0, 0, 0, .45); border: 2px solid rgba(255, 255, 255, .85);
  display: grid; place-items: center; color: #fff; font-size: 16px;
}

/* ---------------- 图文列表（缩略图 + 摘要） ---------------- */
.m-news { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--h-line); }
.m-news:last-child { border-bottom: 0; }
.m-news .pic { width: 132px; height: 92px; flex-shrink: 0; overflow: hidden; background: #e9eef5; }
.m-news .pic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.m-news:hover .pic img { transform: scale(1.05); }
.m-news .txt { min-width: 0; flex: 1; }
.m-news .ttl {
  font-size: 16px; font-weight: 600; color: var(--h-ink); line-height: 1.5;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}
.m-news:hover .ttl { color: var(--h-red); }
.m-news .desc {
  margin-top: 4px; font-size: 13.5px; color: var(--h-ink-3); line-height: 1.6;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.m-news .meta { margin-top: 4px; font-size: 12.5px; color: var(--h-gray); display: flex; gap: 10px; }
.m-news .meta i { font-style: normal; }

/* tab 面板 */
.m-pane { display: none; }
.m-pane.on { display: block; }

/* ---------------- 品牌活动（图标流） ---------------- */
/* 参考站：.img-link-cont{grid-template-columns:repeat(auto-fill,216px);gap:0 30px} */
.m-brands {
  display: grid; grid-template-columns: repeat(auto-fill, 216px);
  justify-content: space-between; gap: 0 30px; padding: 10px 10px 4px;
}
.m-brand {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 6px 0; text-align: center; min-width: 0;
}
.m-brand img { width: 100%; height: auto; max-height: 183px; object-fit: contain; display: block; }
.m-brand b {
  margin-top: 6px; font-size: 13.5px; font-weight: 500; color: var(--h-ink-2); line-height: 1.5;
}
.m-brand:hover b { color: var(--h-red); }

/* ---------------- 活动影像（等分缩略图） ---------------- */
.m-plates { display: flex; gap: 10px; }
.m-plate { flex: 1; min-width: 0; overflow: hidden; position: relative; display: block; background: #e9eef5; }
.m-plate img { width: 100%; height: 100%; max-height: 180px; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.m-plate:hover img { transform: scale(1.05); }
.m-plate span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 8px 6px;
  font-size: 12.5px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .6));
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

/* ---------------- 专家团队（横滑方形头像） ---------------- */
.m-experts { display: flex; gap: 19px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.m-expert { flex: 0 0 auto; width: 220px; text-align: center; }
.m-expert .av {
  width: 220px; height: 220px; background: #f2f6fa; overflow: hidden;
  display: grid; place-items: center;
}
.m-expert .av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-expert b {
  display: block; margin-top: 10px; font-size: 16px; font-weight: 700; color: var(--h-ink);
}
.m-expert em {
  display: block; font-style: normal; font-size: 12.5px; color: var(--h-gray);
  margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.m-expert:hover b { color: var(--h-red); }

/* ---------------- 友情链接（标签流） ---------------- */
.m-links { display: flex; flex-wrap: wrap; gap: 10px; }
.m-links a {
  padding: 8px 16px; border: 1px solid var(--h-line); border-radius: 3px;
  font-size: 14px; color: var(--h-ink-2); background: #fcfcfc;
  max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.m-links a:hover { border-color: var(--h-red); color: var(--h-red); background: #fff; }

/* ---------------- 杂项 ---------------- */
.tag-demo {
  display: inline-block; font-style: normal; font-size: 11px; line-height: 16px;
  padding: 0 5px; border-radius: 2px; background: #fff4e5; color: #b76b00;
  margin-left: 4px; vertical-align: 1px;
}
.h-empty { padding: 26px 0; text-align: center; color: var(--h-gray); font-size: 14px; }
.h-skel { padding: 8px 0; }
.h-skel i {
  display: block; height: 14px; border-radius: 3px; background: #eef2f6;
  margin-bottom: 10px; animation: h-shine 1.4s infinite linear;
}
@keyframes h-shine { 0% { opacity: .55; } 50% { opacity: 1; } 100% { opacity: .55; } }

/* ================= 响应式：iPad / 手机 ================= */
@media (hover: none) {
  .h-arrow { opacity: .9; }
}
@media (max-width: 1200px) {
  .h-arrow { opacity: .85; }
  .m-brand img { max-height: 150px; }
  .m-brand b { font-size: 12.5px; }
  .m-expert, .m-expert .av { width: 190px; }
  .m-expert .av { height: 190px; }
}

@media (max-width: 1024px) {
  /* iPad 竖屏：两栏改单栏堆叠，模块顺序不变 */
  .h-hero { grid-template-columns: 1fr; }
  .h-dots { grid-column: 1; order: 2; }
  .h-notice { order: 3; min-height: 0; }
  .h-notice ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
  .h-col.c618, .h-col.c382 { width: 100%; }
  .m-brands { grid-template-columns: repeat(auto-fill, 150px); }
  .m-plates { flex-wrap: wrap; }
  .m-plate { flex: 0 0 calc(50% - 5px); }
  .m-plate img { max-height: 200px; }
}

@media (max-width: 768px) {
  :root { --h-gap: 30px; }
  .h-hero { padding-top: 12px; }
  .h-slide .h-cap-tit { font-size: 16px; padding: 2px 12px; }
  .h-dots { left: 12px; bottom: 10px; }
  .m-list a { font-size: 15px; }
  .m-list .d { font-size: 13px; }
  .m-head .more { font-size: 13px; }
  .m-body { padding: 12px 12px 14px; }
  .m-cards { gap: 14px; }
  .m-thumb .cap { height: 34px; line-height: 34px; font-size: 13.5px; }
  .m-news .pic { width: 108px; height: 76px; }
  .m-news .ttl { font-size: 15px; }
  .m-experts { gap: 14px; }
  .m-expert, .m-expert .av { width: 150px; }
  .m-expert .av { height: 150px; }
  .m-expert b { font-size: 14.5px; }
}

@media (max-width: 520px) {
  :root { --h-gap: 22px; }
  .h-hero { padding: 10px 12px 0; }
  .h-slide .h-cap-tit { font-size: 15px; padding: 2px 10px; }
  .h-notice ul { grid-template-columns: 1fr; }
  .h-main { padding: 0 12px; }
  .h-row { margin: 0; }
  .h-col { padding: 0; }
  .m-head { padding: 0 6px; }
  .m-tab { padding: 6px 12px; font-size: 15px; }
  .m-body { padding: 10px 10px 12px; }
  .m-list a { font-size: 14.5px; }
  .m-list .d { font-size: 12px; }
  .m-cards { grid-template-columns: 1fr; gap: 12px; }
  .m-brands { grid-template-columns: repeat(auto-fill, 96px); gap: 0 14px; }
  .m-brand img { max-height: 96px; }
  .m-brand b { font-size: 12px; }
  .m-plates { flex-wrap: wrap; gap: 8px; }
  .m-plate { flex: 0 0 calc(50% - 4px); }
  .m-plate img { max-height: 120px; }
  .m-news { gap: 10px; }
  .m-news .pic { width: 92px; height: 66px; }
  .m-news .desc { -webkit-line-clamp: 2; font-size: 12.5px; }
  .m-links a { padding: 6px 10px; font-size: 12.5px; }
}

/* ---------------- 学校活跃度排行榜（2026-11-03） ----------------
   10 名排成上下两排：上排 1-5、下排 6-10，每格一张微缩卡片。
   卡片只放「名次 / 校名简称 / 综合分 / 三个维度的小数字」，
   完整口径写在卡底一行，鼠标悬停有上浮，键盘可 Tab 到。 */
.rank-period {
  flex: none; font-size: 12px; color: var(--h-ink-3);
  padding: 2px 9px; border-radius: 999px; background: #f6f8fb;
}
.rank-board { display: flex; flex-direction: column; gap: 8px; }
.rank-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }

.rank-card {
  display: flex; flex-direction: column; gap: 5px;
  padding: 9px 9px 8px; border: 1px solid var(--h-line); border-radius: 10px;
  background: linear-gradient(180deg, #fff, #fbfcfe);
  text-decoration: none; color: inherit; min-width: 0;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.rank-card:hover, .rank-card:focus-visible {
  transform: translateY(-2px);
  border-color: #f0c9cc;
  box-shadow: 0 8px 18px rgba(230, 0, 22, .10);
  outline: none;
}
.rank-card.is-blank {
  border-style: dashed; border-color: #eef1f5; background: #fcfdfe;
  pointer-events: none;
}

.rank-no {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 6px;
  font-size: 11px; font-weight: 700; line-height: 1;
  color: #fff; background: #b9c4d2; font-variant-numeric: tabular-nums;
}
.rank-card.is-1 .rank-no { background: linear-gradient(135deg, #f6b73c, #e08c00); box-shadow: 0 2px 6px rgba(224, 140, 0, .30); }
.rank-card.is-2 .rank-no { background: linear-gradient(135deg, #b9c6d4, #8e9dae); box-shadow: 0 2px 6px rgba(142, 157, 174, .28); }
.rank-card.is-3 .rank-no { background: linear-gradient(135deg, #d3a179, #b4784b); box-shadow: 0 2px 6px rgba(180, 120, 75, .26); }

/* 徽标 + 校名 + 分数挤在同一行，卡片只留两行高，微缩但不局促 */
.rank-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rank-mid { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; min-width: 0; }
.rank-name {
  flex: 1 1 auto; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--h-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rank-score {
  flex: none; font-style: normal; font-size: 11px; font-weight: 700;
  color: var(--h-red-d); font-variant-numeric: tabular-nums;
}
.rank-meta {
  display: flex; gap: 6px; font-size: 10.5px; color: var(--h-ink-3);
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden;
}
.rank-meta em { font-style: normal; }

.rank-empty {
  padding: 26px 10px; text-align: center; font-size: 12.5px; line-height: 1.9;
  color: var(--h-ink-3); background: #fbfcfe; border: 1px dashed #eef1f5; border-radius: 10px;
}
.rank-foot {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  margin-top: 10px; padding-top: 8px; border-top: 1px dashed #f0f2f6;
  font-size: 11.5px; color: var(--h-ink-3);
}
.rank-foot b { color: var(--h-red-d); font-weight: 700; font-variant-numeric: tabular-nums; }

/* 窄屏：仍然两排 5 列（这是需求硬要求），但一格只有 ~62px，
   横排「徽标+校名+分数」会把校名挤成「孱…」，所以改成竖排：
   徽标在上、校名两行、维度数字隐藏（底栏还有总计）。 */
@media (max-width: 760px) {
  .rank-card { padding: 6px 5px 5px; gap: 3px; border-radius: 8px; align-items: flex-start; justify-content: flex-start; }
  .rank-top { flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; }
  .rank-no { width: 15px; height: 15px; font-size: 9.5px; border-radius: 5px; }
  .rank-name {
    font-size: 10.5px; line-height: 1.3; white-space: normal; width: 100%;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .rank-score { display: none; }
  /* 窄屏卡片里只留「爱心 + 点赞数」——榜下的引导条写着「点卡片上的爱心」，
     这儿就必须真能点到，三个维度数字让位（底栏还有总计） */
  .rank-meta { display: flex; justify-content: flex-start; gap: 0; }
  .rank-meta > em { display: none; }
  .rank-like { font-size: 9.5px; gap: 1px; }
  .rank-like svg { width: 9px; height: 9px; }
  .rank-like-cap { font-size: 8px; }
  .rank-row { gap: 5px; }
  .rank-board { gap: 5px; }
}

/* 左右两列等高（.h-row 是 stretch），让排行榜两排均分剩余高度，
   否则左列卡片只有 130px 高，下面会空出一大片 */
#rank-card .m-body { display: flex; flex-direction: column; }
#rank-card .rank-board { flex: 1 1 auto; justify-content: space-between; }
#rank-card .rank-row { flex: 1 1 0; min-height: 84px; }
#rank-card .rank-card { height: 100%; justify-content: center; }

/* ===== 排行榜增强：校徽 / 前三名皇冠 / 点赞 / 走马灯（2026-11-03） ===== */

/* 卡片右上角需要浮皇冠，所以允许溢出 */
.rank-card { position: relative; }

/* 校徽：没上传真校徽时是后端生成的 SVG 徽标 */
.rank-logo {
  flex: none; width: 15px; height: 15px; border-radius: 50%;
  background: #eef2f7; object-fit: cover;
}
.rank-top { gap: 5px; }

/* 前三名皇冠：别在卡片左上角，稍微露出卡片外沿更像「奖牌」 */
.rank-crown {
  position: absolute; top: -9px; left: 7px; z-index: 2;
  width: 18px; height: 18px; line-height: 0;
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, .22));
  pointer-events: none;
}
.rank-crown svg { width: 100%; height: 100%; fill: currentColor; }
.rank-card.is-1 .rank-crown { color: #e6a100; }
.rank-card.is-2 .rank-crown { color: #9aa7b4; }
.rank-card.is-3 .rank-crown { color: #c07a4a; }

.rank-card.is-1 {
  border-color: #f2ddb0;
  background: linear-gradient(180deg, #fffef9, #fff9ea);
  box-shadow: 0 2px 10px rgba(230, 161, 0, .10);
}
.rank-card.is-2 { border-color: #e3e9f0; background: linear-gradient(180deg, #fff, #f8fafc); }
.rank-card.is-3 { border-color: #f0e2d8; background: linear-gradient(180deg, #fffdfb, #fdf6f1); }

/* 卡片上的点赞：一行「❤ N」，正下方一行小字「给学校点赞」。
   提示单独占一行、不进 meta 的 flex 流，免得跟「访/生/师」抢宽度。 */
.rank-like {
  display: inline-flex; align-items: center; gap: 2px;
  color: #9aa8ba; cursor: pointer; transition: color .15s ease, transform .15s ease;
  line-height: 1;
}
.rank-like svg { width: 11px; height: 11px; fill: currentColor; }
.rank-like i { font-style: normal; font-variant-numeric: tabular-nums; }
.rank-like:hover { color: #e11d48; transform: scale(1.06); }
.rank-like.is-on { color: #e11d48; }
.rank-like.is-on svg { animation: rank-pop .28s ease; }

.rank-like-cap {
  display: block; margin-top: 2px;
  font-style: normal; font-size: 9px; line-height: 1.1;
  color: #b3c0cf; letter-spacing: .01em; white-space: nowrap;
}
.rank-card:hover .rank-like-cap { color: #e5879f; }
@keyframes rank-pop {
  0% { transform: scale(.7); }
  60% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

/* 走马灯：最近谁进了学校 / 谁点了赞 */
.rank-ticker {
  display: flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 14px;
  border-bottom: 1px solid #f1f4f8; background: #fbfcfe;
  overflow: hidden;
}
.rank-ticker[hidden] { display: none; }
.rank-ticker-ico {
  flex: none; font-size: 7px; color: #e60016; line-height: 1;
  animation: rank-blink 1.8s ease-in-out infinite;
}
@keyframes rank-blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.rank-ticker-view { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.rank-ticker-track {
  display: inline-flex; align-items: center; gap: 26px;
  white-space: nowrap; will-change: transform;
  animation-name: rank-scroll; animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-duration: 30s;
}
@keyframes rank-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.rank-ticker:hover .rank-ticker-track { animation-play-state: paused; }
.rank-ticker-track a {
  display: inline-flex; align-items: baseline; gap: 5px;
  font-size: 12px; color: #7b8ba0; text-decoration: none;
}
.rank-ticker-track a:hover { color: var(--h-red-d); }
.rank-ticker-track b { color: #33475f; font-weight: 700; }
.rank-ticker-track i { font-style: normal; color: #94a3b8; }
.rank-ticker-track em { font-style: normal; color: #a8b6c6; }

@media (max-width: 760px) {
  .rank-crown { top: -7px; left: 4px; width: 15px; height: 15px; }
  .rank-logo { display: none; }        /* 一格 ~62px，校徽和校名抢位置，留校名 */
  .rank-ticker { height: 26px; padding: 0 10px; }
  .rank-ticker-track a { font-size: 11px; }
  .rank-ticker-track { gap: 18px; }
}

/* 走马灯条目之间补一个分隔点，滚动时也能分清是哪一条 */
.rank-ticker-track a + a::before {
  content: ""; display: inline-block; flex: none;
  width: 4px; height: 4px; border-radius: 50%;
  background: #d7dfe9; margin-right: 3px; align-self: center;
}

/* 窄屏覆盖必须放在最后：上面 #rank-card .rank-row{min-height:76px} 是桌面端等高用的，
   窄屏卡片「校名两行 + 爱心两行」更高，必须按内容撑开，
   否则卡片被压扁、内容溢出盖到下面的底栏上。 */
@media (max-width: 760px) {
  #rank-card .rank-row { min-height: 96px; }
  #rank-card .rank-card { height: auto; }
}

/* ===== 学生优秀作品展（2026-11-03，替换原「工作报道」） =====
   两排各 5 格；封面用纯 CSS 渐变块（按学校稳定取色，--h），不加载图片。
   前三名：金色/银色/铜色皇冠 + 卡片高光扫过 + 描边发光，做出「闪闪发亮」。 */
.wk-board { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.wk-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }

.wk-card {
  position: relative;
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0; text-decoration: none; color: inherit;
}
.wk-card.is-blank { visibility: hidden; }

.wk-cover {
  position: relative; display: block;
  aspect-ratio: 16 / 10;
  border-radius: 9px; overflow: hidden;
  background:
    radial-gradient(120% 95% at 16% 6%, hsl(var(--h) 82% 70% / .95), transparent 62%),
    linear-gradient(142deg, hsl(var(--h) 58% 56%), hsl(calc(var(--h) + 32) 52% 40%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 0 3px 10px hsl(var(--h) 38% 32% / .18);
  transition: transform .2s var(--ease, ease), box-shadow .2s ease;
}
/* 封面上的积木纹理，让色块不空 */
.wk-cover::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(72deg, rgba(255, 255, 255, .12) 0 6px, transparent 6px 22px);
  opacity: .5;
}
.wk-card:hover .wk-cover {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), 0 8px 18px hsl(var(--h) 40% 30% / .26);
}

.wk-rank {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 6px; background: rgba(12, 20, 32, .42);
  color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums; backdrop-filter: blur(2px);
}
.wk-badge {
  position: absolute; bottom: 5px; left: 6px; z-index: 2;
  padding: 1px 5px; border-radius: 4px;
  background: rgba(255, 255, 255, .9); color: #37485c;
  font-size: 9px; font-weight: 700; letter-spacing: .02em; line-height: 1.4;
}

/* 前三名：皇冠 + 高光 + 描边 */
.wk-card.is-1 .wk-rank { background: linear-gradient(135deg, #f6b73c, #e08c00); }
.wk-card.is-2 .wk-rank { background: linear-gradient(135deg, #b9c6d4, #8e9dae); }
.wk-card.is-3 .wk-rank { background: linear-gradient(135deg, #d3a179, #b4784b); }

.wk-crown {
  position: absolute; top: -11px; right: 2px; z-index: 4;
  width: 25px; height: 25px; line-height: 0;
  color: #f7b32b;
  animation: wk-twinkle 1.6s ease-in-out infinite;
  pointer-events: none;
}
.wk-crown svg { width: 100%; height: 100%; fill: currentColor; }
.wk-card.is-2 .wk-crown { color: #c3ced9; animation-duration: 1.9s; }
.wk-card.is-3 .wk-crown { color: #cf8a54; animation-duration: 2.1s; }
@keyframes wk-twinkle {
  0%, 100% {
    transform: scale(1) rotate(-5deg);
    filter: drop-shadow(0 0 3px rgba(255, 190, 0, .75));
    opacity: .92;
  }
  50% {
    transform: scale(1.14) rotate(5deg);
    filter: drop-shadow(0 0 10px rgba(255, 214, 64, 1));
    opacity: 1;
  }
}

/* 高光扫过：只在 1~3 名，3.6 秒一轮，不抢注意力 */
.wk-card.is-1 .wk-cover::after,
.wk-card.is-2 .wk-cover::after,
.wk-card.is-3 .wk-cover::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(105deg, transparent 34%, rgba(255, 255, 255, .62) 48%, transparent 62%);
  transform: translateX(-130%);
  animation: wk-sheen 3.6s ease-in-out infinite;
  pointer-events: none;
}
.wk-card.is-2 .wk-cover::after { animation-delay: .25s; }
.wk-card.is-3 .wk-cover::after { animation-delay: .5s; }
@keyframes wk-sheen {
  0% { transform: translateX(-130%); }
  55%, 100% { transform: translateX(130%); }
}

.wk-card.is-1 .wk-cover { box-shadow: inset 0 0 0 1.5px rgba(255, 214, 102, .95), 0 4px 14px rgba(230, 161, 0, .28); }
.wk-card.is-2 .wk-cover { box-shadow: inset 0 0 0 1.5px rgba(200, 212, 224, .9), 0 4px 14px rgba(142, 157, 174, .22); }
.wk-card.is-3 .wk-cover { box-shadow: inset 0 0 0 1.5px rgba(220, 170, 130, .95), 0 4px 14px rgba(180, 120, 75, .2); }

.wk-title {
  font-size: 12.5px; font-weight: 600; line-height: 1.35; color: var(--h-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-sub {
  font-size: 11px; line-height: 1.3; color: var(--h-ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-nums {
  display: flex; gap: 7px; font-size: 10px; line-height: 1.2;
  color: #8798ab; font-variant-numeric: tabular-nums; white-space: nowrap;
  overflow: hidden;
}
.wk-nums em { font-style: normal; }
.wk-card.is-1 .wk-nums em:first-child,
.wk-card.is-2 .wk-nums em:first-child,
.wk-card.is-3 .wk-nums em:first-child { color: #d81f42; font-weight: 700; }

/* 窄屏：两列 5 行。用 display:contents 把两排打散成一个 10 格的网格，
   否则每排 5 个各占 3 行，会留一个孤零零的第 5 名。 */
@media (max-width: 900px) {
  .wk-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; height: auto; }
  .wk-row { display: contents; }
  .wk-cover { aspect-ratio: 16 / 9; }
}
@media (max-width: 760px) {
  .wk-board { gap: 10px; }
  .wk-title { font-size: 12px; }
  .wk-sub { font-size: 10.5px; }
  .wk-nums { font-size: 9.5px; gap: 6px; }
  .wk-crown { width: 19px; height: 19px; top: -7px; }
}

/* 作品卡片上的学校徽标（每所学校自己的 logo 位） */
.wk-sub { display: flex; align-items: center; gap: 4px; min-width: 0; }
.wk-sub i { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-logo { flex: none; width: 13px; height: 13px; border-radius: 50%; object-fit: cover; background: #eef2f7; }

/* ===== 排行榜「怎么排的」说明（2026-11-03） =====
   两处共用一套外观：左侧一枚「怎么排的？」小标，右侧一句大白话。
   权重数字由接口 weights 回传，文案在 JS 里拼，改算法不用改文案。 */
.rank-howto,
.wk-howto {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed #eef1f5;
  font-size: 11px;
  line-height: 1.7;
  color: #8b9aab;
}
.rank-howto[hidden],
.wk-howto[hidden] { display: none; }
.rank-howto b,
.wk-howto b {
  flex: none;
  margin-top: 2px;
  padding: 0 5px;
  height: 17px;
  line-height: 17px;
  border-radius: 4px;
  background: #fff2f4;
  color: #c0344a;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.rank-howto span,
.wk-howto span { min-width: 0; }

/* 榜单头里的「+ MORE」跟周期标签挤在一起，留点间距 */
#rank-card .m-head { gap: 8px; }

@media (max-width: 760px) {
  .rank-howto,
  .wk-howto { font-size: 10.5px; line-height: 1.65; gap: 5px; }
  .rank-howto b,
  .wk-howto b { font-size: 10px; height: 16px; line-height: 16px; }
}

/* 作品展的说明条：.wk-board 原来 height:100%，会把说明条顶出卡片外，
   改成按内容高 + m-body 变纵向 flex，说明条用 margin-top:auto 贴底。 */
#wk-card .m-body { display: flex; flex-direction: column; }
#wk-card .wk-board { height: auto; flex: 0 0 auto; }
#wk-card .wk-howto { margin-top: auto; }

/* ===== 作品卡：点赞 + 微信分享按钮（2026-11-03 V2） =====
   卡片改成 div + 内部链接，按钮才不会嵌在 <a> 里（HTML 不允许）。
   两个按钮都做成 28px 高的胶囊，按「放大」的要求比原来那行小字明显大一号。 */
.wk-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; text-decoration: none; color: inherit; }

.wk-acts {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  margin-top: 3px;
}
.wk-like, .wk-share {
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 9px 0 7px;
  border: 1px solid #eef2f7; border-radius: 8px;
  background: #fff; color: #78899d;
  font: inherit; font-size: 11.5px; font-weight: 600; line-height: 1;
  cursor: pointer; transition: all .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.wk-like svg, .wk-share svg { width: 13px; height: 13px; flex: none; }
.wk-like svg { fill: currentColor; }
.wk-share svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.wk-like i { font-style: normal; font-variant-numeric: tabular-nums; }
.wk-share u { text-decoration: none; }

.wk-like:hover { border-color: #f7cbd5; background: #fff7f9; color: #e11d48; }
.wk-like:active { transform: scale(.95); }
.wk-like.is-on { background: #e11d48; border-color: #e11d48; color: #fff; box-shadow: 0 3px 10px rgba(225, 29, 72, .28); }
.wk-like.is-on svg { animation: rank-pop .28s ease; }

.wk-share:hover { border-color: #c9dcff; background: #f5f9ff; color: #1f6feb; }
.wk-share:active { transform: scale(.95); }

.wk-views { margin-left: auto; font-size: 9.5px; color: #9aa8ba; white-space: nowrap; }

/* 前三名的点赞按钮跟皇冠同色系，看着像一套 */
.wk-card.is-1 .wk-like:hover { border-color: #f0d9a3; background: #fffdf5; color: #c8890a; }
.wk-card.is-2 .wk-like:hover { border-color: #dae2ea; background: #f8fafc; color: #6f8195; }
.wk-card.is-3 .wk-like:hover { border-color: #f0dccd; background: #fffaf6; color: #b4784b; }

/* 活跃度榜卡片：分数后面标「人气」 */
.rank-score u {
  display: inline;
  margin-left: 1px;
  font-size: 9px; font-style: normal; font-weight: 400;
  color: #8b9aab; text-decoration: none;
}
.rank-card.is-1 .rank-score u { color: #d7a53a; }

@media (max-width: 900px) {
  .wk-like, .wk-share { height: 30px; font-size: 12px; padding: 0 10px 0 8px; }
  .wk-like svg, .wk-share svg { width: 14px; height: 14px; }
  .wk-views { font-size: 10px; }
}

/* 阅读数挪到封面右下角：按钮行只放「点赞 / 分享」两个，窄卡片也不会换行 */
.wk-cover .wk-views {
  position: absolute; right: 5px; bottom: 5px; z-index: 2;
  margin: 0; padding: 1px 5px; border-radius: 4px;
  background: rgba(12, 20, 32, .42); color: #fff;
  font-size: 9px; line-height: 1.5; backdrop-filter: blur(2px);
}

/* 分数改成「数字 / 人气」两行竖排：横排会把校名挤成「孱…」 */
.rank-score {
  display: inline-flex; flex-direction: column; align-items: flex-end;
  gap: 0; line-height: 1.05; flex: none;
}
.rank-score b {
  font-size: 11.5px; font-weight: 700; font-style: normal;
  color: var(--h-red-d); font-variant-numeric: tabular-nums;
}
.rank-score u { margin: 0; font-size: 8.5px; }

/* ===== 作品卡分享按钮：微信绿，与子站作品详情页 .wk-share 完全一致 =====
   同一枚「气泡 + 三点」SVG，同一组 #07c160 / 白字 / 999px 胶囊 / 呼吸光晕。 */
.wk-share {
  border: 1px solid #07c160;
  border-radius: 999px;
  background: #07c160;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(7, 195, 96, .3);
  animation: wkPulse 2.6s ease-in-out infinite;
}
.wk-share u { font-weight: 700; }
.wk-share:hover {
  border-color: #07c160;
  background: #06ad56;
  color: #fff;
  box-shadow: 0 3px 12px rgba(7, 195, 96, .45);
}
.wk-share:active { transform: scale(.94); }
@keyframes wkPulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(7, 195, 96, .3); }
  50% { box-shadow: 0 2px 8px rgba(7, 195, 96, .3), 0 0 0 5px rgba(7, 195, 96, .16); }
}
/* 前三名的 hover 特例不要再盖掉微信绿 */
.wk-card.is-1 .wk-share:hover,
.wk-card.is-2 .wk-share:hover,
.wk-card.is-3 .wk-share:hover { color: #fff; background: #06ad56; border-color: #07c160; }

/* 访问数 / 分享次数：独立一行，字色加深，确保「访问数」明确可见 */
.wk-metrics {
  display: flex; align-items: center; gap: 8px;
  margin-top: 3px;
  font-size: 10px; line-height: 1.3; color: #7b8ba0;
  white-space: nowrap; overflow: hidden;
}
.wk-metrics em { font-style: normal; }
.wk-metrics b { font-weight: 700; color: #53687f; font-variant-numeric: tabular-nums; }
.wk-metrics em:last-child { margin-left: auto; }

/* 窄屏：活跃度榜卡片把「访问数」也显示出来（原来整行藏了） */
@media (max-width: 760px) {
  .rank-meta > em:not(:first-of-type) { display: none; }
  .rank-meta > em:first-of-type { display: inline; font-size: 9px; }
}

/* ===== 作品卡：点开就是作品本身（2026-11-03 V3） =====
   角标按类型区分（Scratch 米色 / Python 青色），封面上加一个 hover 才出现的
   ▶ 播放提示，明确「这张卡可以点进去看/运行作品」。 */
.wk-badge.is-scratch { background: rgba(255, 255, 255, .92); color: #37485c; }
.wk-badge.is-python {
  background: rgba(240, 253, 250, .95); color: #0f766e;
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, .28);
}
/* C++：靛紫角标 + 靛紫细带，和 Scratch（米色）/ Python（青色）三色区分 */
.wk-badge.is-cpp {
  background: rgba(245, 243, 255, .95); color: #4c1d95;
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, .3);
}

.wk-play {
  position: absolute; top: 50%; left: 50%; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border-radius: 50%;
  background: rgba(9, 16, 28, .52);
  color: #fff; font-size: 12px; line-height: 1;
  padding-left: 2px;                       /* ▶ 视觉居中 */
  opacity: 0; transform: scale(.82);
  transition: opacity .18s ease, transform .18s ease;
  backdrop-filter: blur(2px);
  pointer-events: none;
}
.wk-card:hover .wk-play,
.wk-main:focus-visible .wk-play { opacity: 1; transform: scale(1); }

/* Python 作品的封面底部一条青色细带（用独立元素，别抢 ::after ——
   那个伪元素是前三名的高光扫过，占了它高光就没了） */
.wk-band {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  height: 3px; opacity: .95;
  background: linear-gradient(90deg, #0d9488, #22d3ee);
  pointer-events: none;
}
.wk-card.is-cpp .wk-band { background: linear-gradient(90deg, #4c1d95, #7c3aed); }
