/* ==========================================================
   青红行 · 共享布局组件库
   统一导航 / 面包屑 / 页头 / 课表 / 卡片 / 无障碍
   ========================================================== */

:root {
  --brand: #2f9e44;
  --brand-d: #237a35;
  --brand-l: #e6f4ea;
  --accent: #d4380d;
  --ink: #1f2933;
  --ink-2: #52606d;
  --ink-3: #7b8794;
  --line: #e4e7eb;
  --bg: #f7f9f8;
  --card: #ffffff;
  --focus: #1b6ec2;
  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 1px 3px rgba(16,42,26,.08), 0 4px 14px rgba(16,42,26,.06);
  --shadow-h: 0 4px 10px rgba(16,42,26,.12), 0 10px 28px rgba(16,42,26,.12);
  --nav-h: 60px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "PingFang SC","Microsoft YaHei","Segoe UI",system-ui,sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-d); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 键盘可达性：跳转链接 */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--brand-d); color: #fff;
  padding: 10px 16px; z-index: 2000; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* 焦点可见 */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============ 顶部导航 ============ */
.topnav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topnav-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; gap: 18px;
  height: var(--nav-h); padding: 0 20px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 19px; color: var(--brand-d);
  text-decoration: none; white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-badge {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #66bb6a);
  display: grid; place-items: center; color: #fff; font-size: 18px;
}
.navlinks { display: flex; gap: 4px; margin-left: auto; }
.navlinks a {
  padding: 8px 13px; border-radius: 8px;
  color: var(--ink-2); font-size: 14.5px; font-weight: 500;
  text-decoration: none; position: relative;
}
.navlinks a:hover { background: var(--brand-l); color: var(--brand-d); }
.navlinks a[aria-current="page"] { color: var(--brand-d); background: var(--brand-l); }
.navlinks a[aria-current="page"]::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 2px;
  height: 3px; border-radius: 3px; background: var(--brand);
}
.nav-toggle {
  display: none; margin-left: auto;
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 8px 10px; cursor: pointer; font-size: 18px;
}

/* ============ 面包屑 ============ */
.breadcrumb-wrap { background: #fff; border-bottom: 1px solid var(--line); }
.breadcrumb {
  max-width: 1180px; margin: 0 auto; padding: 10px 20px;
  font-size: 13.5px; color: var(--ink-3);
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
}
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.breadcrumb li { display: flex; align-items: center; gap: 4px; }
.breadcrumb a { color: var(--ink-2); }
.breadcrumb .sep { color: var(--ink-3); }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 600; }

/* ============ 页面容器 / 页头 ============ */
.page { max-width: 1180px; margin: 0 auto; padding: 26px 20px 60px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.3; }
.page-head .sub { color: var(--ink-2); margin: 0; max-width: 70ch; }

.section-title {
  font-size: 19px; margin: 34px 0 14px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: ""; width: 5px; height: 20px; border-radius: 3px;
  background: linear-gradient(var(--brand), #66bb6a);
}

/* ============ 卡片 ============ */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2,1fr); }
.grid-3 { grid-template-columns: repeat(3,1fr); }
.grid-4 { grid-template-columns: repeat(4,1fr); }

/* ============ 按钮 / 标签 / 表单 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 9px; font-size: 14.5px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-d); }
.btn-ghost { background: #fff; color: var(--brand-d); border-color: var(--brand); }
.btn-ghost:hover { background: var(--brand-l); }
.btn-sm { padding: 6px 11px; font-size: 13px; }

.chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--brand-l); color: var(--brand-d);
  font-size: 12.5px; font-weight: 600;
}
.chip.red { background: #fdecea; color: var(--accent); }
.chip.gray { background: #eef1f4; color: var(--ink-2); }

.seg {
  display: inline-flex; background: #eef1f4; border-radius: 10px; padding: 3px;
}
.seg button {
  border: 0; background: transparent; padding: 7px 15px; border-radius: 8px;
  font-size: 14px; color: var(--ink-2); cursor: pointer; font-weight: 600;
}
.seg button[aria-pressed="true"] { background: #fff; color: var(--brand-d); box-shadow: var(--shadow); }

.input, .select {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line);
  border-radius: 9px; font-size: 14.5px; background: #fff; color: var(--ink);
  font-family: inherit;
}
.input::placeholder { color: var(--ink-3); }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin-bottom: 16px;
}
.toolbar .grow { flex: 1; min-width: 200px; }
.toolbar label { font-size: 13.5px; color: var(--ink-2); font-weight: 600; }

/* ============ 课表表格 ============ */
.sched-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.sched {
  border-collapse: separate; border-spacing: 0; width: 100%; min-width: 760px;
  font-size: 13.5px;
}
table.sched caption {
  caption-side: top; text-align: left; padding: 14px 16px;
  font-weight: 700; font-size: 15.5px; color: var(--ink);
  border-bottom: 1px solid var(--line); background: var(--brand-l);
}
table.sched th, table.sched td {
  border-bottom: 1px solid var(--line); border-right: 1px solid var(--line);
  padding: 9px 8px; text-align: center; vertical-align: middle;
}
table.sched th:last-child, table.sched td:last-child { border-right: 0; }
table.sched tbody tr:last-child th, table.sched tbody tr:last-child td { border-bottom: 0; }
table.sched thead th {
  background: #fafbfc; font-weight: 700; color: var(--ink-2);
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
table.sched tbody th {
  background: #fafbfc; font-weight: 600; color: var(--ink-2);
  white-space: nowrap; min-width: 92px; position: sticky; left: 0; z-index: 1;
}
.cell-course {
  display: block; padding: 5px 6px; border-radius: 7px;
  background: var(--brand-l); color: var(--brand-d); font-weight: 600;
  line-height: 1.35; margin: 2px; font-size: 12.8px;
  word-break: break-word; overflow-wrap: break-word;
}
.cell-course .who { display: block; font-weight: 500; color: var(--ink-2); font-size: 11.8px; }
.cell-plain { color: var(--ink-2); font-size: 12.8px; word-break: break-word; overflow-wrap: break-word; }
.cell-empty { color: #cbd2d9; }

/* 高亮命中 */
.mark { background: #ffe58f; border-radius: 3px; padding: 0 1px; }

/* ============ 志愿者卡片 ============ */
.vol-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: flex-start;
  transition: .15s;
}
.vol-card:hover { box-shadow: var(--shadow-h); transform: translateY(-2px); }
.vol-ava {
  width: 58px; height: 58px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover; border: 3px solid var(--brand-l); background: var(--brand-l);
}
.vol-info { flex: 1; min-width: 0; }
.vol-name { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vol-role { font-size: 12.5px; color: var(--ink-2); }
.vol-bio { font-size: 13px; color: var(--ink-2); margin: 7px 0 9px; }
.vol-courses { display: flex; flex-wrap: wrap; gap: 5px; }

/* ============ 英雄区 ============ */
.hero {
  position: relative; border-radius: 0 0 22px 22px; overflow: hidden;
  color: #fff; background: #1c4627;
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .42; }
.hero-inner {
  position: relative; z-index: 1; max-width: 1180px; margin: 0 auto;
  padding: 70px 20px 54px;
}
.hero h1 { font-size: 40px; margin: 0 0 8px; letter-spacing: 2px; }
.hero p.slogan { font-size: 16.5px; opacity: .92; margin: 0 0 22px; max-width: 60ch; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 34px; margin-top: 34px; flex-wrap: wrap; }
.hero-stats .s { text-align: center; }
.hero-stats .n { font-size: 28px; font-weight: 800; }
.hero-stats .l { font-size: 13px; opacity: .85; }

/* 图集 */
.photo-strip { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.photo-strip figure { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: relative; }
.photo-strip img { width: 100%; height: 180px; object-fit: cover; transition: .3s; }
.photo-strip figure:hover img { transform: scale(1.05); }
.photo-strip figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  color: #fff; font-size: 12.5px; padding: 22px 12px 9px;
}

/* 页脚 */
.footer {
  background: #14301c; color: #cfe6d4; text-align: center;
  padding: 26px 20px; font-size: 13.5px; margin-top: 40px;
}
.footer a { color: #9fd4ab; }

/* 空态 / 提示 */
.empty {
  text-align: center; padding: 46px 20px; color: var(--ink-3);
}
.notice {
  border: 1px solid #ffe1a8; background: #fff7e8; color: #8a6d1d;
  padding: 11px 14px; border-radius: 9px; font-size: 13.5px;
}

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2,1fr); }
  .photo-strip { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px) {
  .navlinks {
    display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; background: #fff; border-bottom: 1px solid var(--line);
    padding: 8px; gap: 2px;
  }
  .navlinks.open { display: flex; }
  .nav-toggle { display: block; }
  .hero h1 { font-size: 30px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .photo-strip { grid-template-columns: 1fr 1fr; }
  .photo-strip img { height: 150px; }
  .hero-stats { gap: 20px; }
}

/* 降低动效 */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 打印课表 */
@media print {
  .topnav, .breadcrumb-wrap, .toolbar, .footer, .btn { display: none !important; }
  .page { padding: 0; }
  table.sched { min-width: 0; font-size: 11px; }
}
