/*
 * 矿大校园风
 * 颜色取自学校官网（www.cumt.edu.cn）：主色矿大蓝 #005bac，点缀红 #cf000d。
 * 顶部横幅：放一张校园照片到 images/banner.jpg 就会自动显示；没有照片时显示蓝色渐变。
 */
:root {
  --blue: #005bac;
  --blue-dark: #003a75;
  --blue-light: #e6f0fa;
  --red: #cf000d;
  --red-light: #fdebec;
  --gold: #a86a00;
  --gold-light: #fdf3e1;
  --text: #1f2937;
  --muted: #667085;
  --border: #e3e8ef;
  --bg: #f3f6fa;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* ---------- 顶部横幅 ---------- */
.site-header {
  position: relative;
  color: #fff;
  padding: 56px 0 40px;
  /* 上层：半透明深蓝遮罩，保证白字在照片上看得清；下层：校园照片（文件不存在时自动忽略） */
  background:
    linear-gradient(120deg, rgba(0, 58, 117, .92), rgba(0, 91, 172, .78)),
    url("images/banner.jpg") center / cover no-repeat,
    var(--blue-dark);
  border-bottom: 4px solid var(--red);
}
.school {
  margin: 0 0 6px;
  font-size: 14px;
  letter-spacing: 1px;
  opacity: .85;
}
.site-header h1 {
  margin: 0;
  font-family: "Source Han Serif SC", "Noto Serif SC", "STSong", "SimSun", serif;
  font-size: 40px;
  letter-spacing: 6px;
}
.subtitle { margin: 10px 0 0; max-width: 720px; opacity: .92; }
.updated {
  display: inline-block;
  margin: 14px 0 0;
  padding: 2px 10px;
  font-size: 13px;
  background: rgba(255, 255, 255, .15);
  border-radius: 999px;
}

/* ---------- 顶部状态筛选 ---------- */
.status-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 24px;
  max-width: 760px;
}
.status-tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 12px 16px;
  font: inherit; color: #fff; text-align: left; cursor: pointer;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: var(--radius);
  transition: background .15s;
}
.status-tab:hover { background: rgba(255, 255, 255, .22); }
.status-tab[aria-pressed="true"] { background: #fff; color: var(--blue-dark); border-color: #fff; }
.status-tab:focus-visible { outline: 3px solid #ffd166; outline-offset: 2px; }
.status-label { font-size: 15px; font-weight: bold; }
.status-count { font-size: 26px; font-weight: bold; line-height: 1.2; }
/* 每种状态一个识别色：进行中=绿，可报名=红，即将开始=金 */
.status-tab.status-ongoing .status-count { color: #7ee2a8; }
.status-tab.status-signup .status-count { color: #ff9aa0; }
.status-tab.status-upcoming .status-count { color: #ffd166; }
.status-tab[aria-pressed="true"].status-ongoing .status-count { color: #0a7a3d; }
.status-tab[aria-pressed="true"].status-signup .status-count { color: var(--red); }
.status-tab[aria-pressed="true"].status-upcoming .status-count { color: var(--gold); }

/* ---------- 栏目标题：仿学校官网左侧红条 ---------- */
h2 {
  position: relative;
  margin: 32px 0 14px;
  padding-left: 14px;
  font-size: 21px;
  color: var(--blue-dark);
}
h2::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 5px; height: 1.1em;
  transform: translateY(-50%);
  background: var(--red);
  border-radius: 2px;
}
.count { font-size: 14px; color: var(--muted); font-weight: normal; }

/* ---------- 最新通知列表 ---------- */
.notice-list {
  list-style: none; margin: 0; padding: 0;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
}
.notice-list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px dashed var(--border);
}
.notice-list li:last-child { border-bottom: none; }
.notice-list li:hover { background: #f8fafd; }
.notice-list a { color: var(--text); text-decoration: none; flex: 1 1 320px; }
.notice-list a:hover, .notice-list a:focus { color: var(--blue); text-decoration: underline; }
.notice-meta { font-size: 13px; color: var(--muted); }

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin-bottom: 18px; padding: 14px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
}
.search { flex: 1 1 280px; }
.search input {
  width: 100%; padding: 10px 14px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg);
}
.search input:focus { outline: 2px solid var(--blue); border-color: transparent; background: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px; font-size: 14px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text);
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.toggle { font-size: 14px; color: var(--muted); cursor: pointer; }

/* ---------- 竞赛卡片 ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; gap: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  border-top: 3px solid var(--blue);
  padding: 16px; transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: 0 6px 20px rgba(0, 58, 117, .12); transform: translateY(-2px); }
.card.top { border-top-color: var(--gold); }
.card h3 { margin: 0; font-size: 17px; line-height: 1.4; color: var(--blue-dark); }
.card-info { margin: 0; font-size: 13px; color: var(--muted); }
.card-notice {
  font-size: 14px; background: var(--blue-light); border-left: 3px solid var(--blue);
  border-radius: 4px; padding: 8px 10px;
}
.card-notice a { color: var(--blue); }
/* 官网赛程：绿色左边线，和“校内通知”的蓝色区分开 */
.card-schedule {
  font-size: 14px; background: #eef8f2; border-left: 3px solid #0a7a3d;
  border-radius: 4px; padding: 8px 10px;
}
.card-schedule-title { font-weight: bold; color: #0a5c2e; }
.card-schedule ul { margin: 4px 0; padding-left: 18px; }
.card-schedule a { font-size: 12px; color: #0a5c2e; }
.stage-hint { font-size: 12px; color: var(--muted); }
.card-schedule summary { font-size: 13px; color: #0a5c2e; cursor: pointer; margin: 2px 0 4px; }
.card-times { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }

.badge {
  display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 4px;
  background: var(--blue-light); color: var(--blue); white-space: nowrap;
}
.badge.level-一级甲等 { background: var(--gold-light); color: var(--gold); font-weight: bold; }
.badge.level-三级 { background: #f1f3f6; color: var(--muted); }
.badge.urgent { background: var(--red-light); color: var(--red); font-weight: bold; }
.badge.closed, .badge.other { background: #f1f3f6; color: var(--muted); }
.badge.live, .badge.status-ongoing { background: #e3f6ea; color: #0a7a3d; font-weight: bold; }
.badge.soon, .badge.status-upcoming { background: var(--gold-light); color: var(--gold); }
.badge.status-signup { background: var(--red-light); color: var(--red); font-weight: bold; }

.btn {
  display: inline-block; padding: 6px 16px; font-size: 14px; border-radius: 6px;
  text-decoration: none; border: 1px solid var(--blue); color: var(--blue);
}
.btn.primary { background: var(--blue); color: #fff; }
.btn:hover, .btn:focus { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn.disabled { border-color: var(--border); color: var(--muted); pointer-events: none; }

.empty { text-align: center; color: var(--muted); padding: 32px; }

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 48px; padding: 24px 0;
  font-size: 13px; color: rgba(255, 255, 255, .8);
  background: var(--blue-dark);
}
.site-footer a { color: #fff; }

/* 只给读屏软件看的文字，视觉上隐藏 */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 600px) {
  .site-header { padding: 36px 0 28px; }
  .site-header h1 { font-size: 30px; letter-spacing: 4px; }
  .cards { grid-template-columns: 1fr; }
  .status-tabs { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .status-count { font-size: 22px; }
}
