/* ============================================================
   我们什么时候都有空 —— 课表交集
   ============================================================ */

:root {
  --bg: #08080a;
  --bg-1: #0d0d11;
  --panel: rgba(255,255,255,.035);
  --panel-2: rgba(255,255,255,.055);
  --line: rgba(255,255,255,.09);
  --line-2: rgba(255,255,255,.16);

  --text: #f2f0ec;
  --text-soft: #a9a6a0;
  --text-dim: #6f6c67;

  --gold: #d8b26a;
  --gold-soft: #e8cf9c;
  --gold-glow: rgba(216,178,106,.18);
  --green: #5fd39a;

  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);

  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
          "Microsoft YaHei", "PingFang SC", sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 背景光斑 ---------- */
.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}
.glow--1 {
  width: 60vw; height: 60vw;
  top: -22vw; left: -12vw;
  background: radial-gradient(circle, rgba(216,178,106,.16), transparent 68%);
}
.glow--2 {
  width: 52vw; height: 52vw;
  bottom: -20vw; right: -10vw;
  background: radial-gradient(circle, rgba(110,168,254,.10), transparent 68%);
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8,8,10,.72);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand__mark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 26px;
  flex: 0 0 auto;
}
.brand__mark i {
  display: block;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  opacity: .85;
}
.brand__mark i:nth-child(1) { height: 12px; }
.brand__mark i:nth-child(2) { height: 26px; }
.brand__mark i:nth-child(3) { height: 18px; }

.brand__text { min-width: 0; }
.brand__text h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand__text p {
  margin: 1px 0 0;
  font-size: 11.5px;
  color: var(--text-dim);
  letter-spacing: .06em;
  white-space: nowrap;
}

/* ---------- 周次选择 ---------- */
.weekpick {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  flex: 0 0 auto;
}
.wkbtn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-soft);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: all .25s var(--ease);
}
.wkbtn:hover { background: var(--panel-2); color: var(--gold); }
.wkpick__mid {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  color: var(--text-soft);
}
.wkpick__mid select {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  padding: 2px 4px;
  cursor: pointer;
  outline: none;
}
.wkpick__mid select option { background: #14141a; color: #f2f0ec; }

/* ---------- 布局 ---------- */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 22px 60px;
}

/* ---------- 共同空闲卡 ---------- */
.hero {
  position: relative;
  padding: 26px 28px 24px;
  border: 1px solid rgba(216,178,106,.24);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(216,178,106,.10), transparent 55%),
    var(--panel);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  pointer-events: none;
}
.hero__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.hero__eyebrow {
  margin: 0 0 6px;
  font-size: 10px;
  letter-spacing: .28em;
  color: var(--text-dim);
}
.hero__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: .01em;
  background: linear-gradient(120deg, #fff, var(--gold-soft) 60%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: 0 0 auto;
}
.hero__stat strong {
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 26px var(--gold-glow);
}
.hero__stat span { font-size: 12.5px; color: var(--text-dim); }

.hero__note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-soft);
}
.hero__note b { color: var(--gold-soft); font-weight: 600; }

/* ---------- 空闲列表 ---------- */
.freelist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}
.free-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.028);
  border: 1px solid rgba(255,255,255,.05);
}
.free-row__day {
  flex: 0 0 46px;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.free-row__segs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.seg {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  color: #0f1512;
  background: linear-gradient(140deg, #7ee2b0, var(--green));
  font-weight: 600;
  box-shadow: 0 4px 14px -6px rgba(95,211,154,.7);
}
.seg--wide {
  background: linear-gradient(140deg, var(--gold-soft), var(--gold));
  box-shadow: 0 4px 14px -6px rgba(216,178,106,.8);
  color: #1a1509;
}
.free-row__none {
  font-size: 12.5px;
  color: var(--text-dim);
  font-style: italic;
}
.free-row.is-empty { opacity: .55; }

/* ---------- 人员 ---------- */
.people {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 16px;
}
.people__label {
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--text-dim);
}
.people__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pchip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all .25s var(--ease);
}
.pchip:hover { border-color: var(--line-2); background: var(--panel-2); }
.pchip__dot {
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--c, #888);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, #888) 22%, transparent);
  flex: 0 0 auto;
  transition: all .25s var(--ease);
}
.pchip.is-off {
  opacity: .42;
  border-color: var(--line);
}
.pchip.is-off .pchip__dot { box-shadow: none; opacity: .5; }

/* 人员右侧的本校周号 */
.pchip__wk {
  font-style: normal;
  font-size: 10.5px;
  color: var(--text-dim);
  margin-left: 2px;
  padding-left: 7px;
  border-left: 1px solid var(--line-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pchip__wk.is-out { color: #8a7855; }
.linkbtn {
  margin-left: auto;
  padding: 5px 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .25s;
}
.linkbtn:hover { color: var(--gold); }

/* ---------- 总览表 ---------- */
.board {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.board__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.board__head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
}
.board__head p { margin: 0; font-size: 12px; color: var(--text-dim); }

.board__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
/* 可横向滚动时，右侧渐隐提示 */
.board__scroll.is-scrollable::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 42px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(8,8,10,.92));
  border-radius: 0 0 4px 0;
}
.sched {
  width: 100%;
  min-width: 620px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.sched thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 11px 6px;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--text-soft);
  background: #101015;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.sched thead th.corner { background: #101015; }
.sched tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 92px;
  padding: 10px 10px;
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--text-dim);
  background: #0e0e12;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid rgba(255,255,255,.045);
  white-space: nowrap;
}
.sched tbody th.is-period-start { border-top: 1px solid var(--line); }

.sched td {
  padding: 6px;
  border-bottom: 1px solid rgba(255,255,255,.045);
  border-right: 1px solid rgba(255,255,255,.035);
  vertical-align: middle;
  text-align: center;
}
.sched td:last-child { border-right: none; }

.cell {
  position: relative;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: transform .18s var(--ease), background .25s var(--ease), border-color .25s;
  border: 1px solid transparent;
}
.cell:hover { transform: translateY(-1px); }

.cell.is-free {
  background: linear-gradient(140deg, rgba(95,211,154,.14), rgba(95,211,154,.06));
  border-color: rgba(95,211,154,.28);
}
.cell.is-free::after {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(95,211,154,.9);
}
.cell.is-free:hover { background: linear-gradient(140deg, rgba(95,211,154,.22), rgba(95,211,154,.10)); }

.cell.is-busy {
  background: rgba(255,255,255,.035);
  border-color: rgba(255,255,255,.06);
}
.cell.is-busy:hover { background: rgba(255,255,255,.07); }

.cell.is-empty {
  cursor: default;
}
.cell.is-empty::after {
  content: "—";
  color: rgba(255,255,255,.12);
  font-size: 12px;
}

/* 人员圆点 */
.pdot {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #0b0b10;
  background: var(--c, #888);
  flex: 0 0 auto;
  transition: opacity .25s, transform .2s;
}
.pdot.is-off {
  opacity: .22;
  filter: grayscale(1);
}

/* ---------- 图例 ---------- */
.board__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-dim);
}
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg__dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--c);
}
.lg__free {
  width: 14px; height: 14px;
  border-radius: 5px;
  background: linear-gradient(140deg, rgba(95,211,154,.28), rgba(95,211,154,.12));
  border: 1px solid rgba(95,211,154,.4);
}

/* ---------- 页脚 ---------- */
.foot {
  margin-top: 26px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-dim);
}
.foot p { margin: 0; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal__mask {
  position: absolute;
  inset: 0;
  background: rgba(4,4,6,.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade .2s var(--ease) both;
}
.modal__panel {
  position: relative;
  width: min(440px, 100%);
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: #121218;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.95);
  animation: pop .26s var(--ease-out) both;
  overflow: hidden;
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.modal__head h4 {
  margin: 0;
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 700;
}
.modal__x {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: all .25s;
}
.modal__x:hover { color: #fff; border-color: var(--gold); }
.modal__body {
  padding: 14px 18px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mitem {
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line);
  border-left: 3px solid var(--c, #888);
}
.mitem__top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.mitem__who {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--c, #888);
}
.mitem__name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}
.mitem__meta {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-dim);
}
.mitem__meta b { color: var(--text-soft); font-weight: 500; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: none; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .topbar__inner { padding: 11px 15px; gap: 10px; }
  .brand__text h1 { font-size: 15.5px; }
  .brand__text p { display: none; }
  .brand__mark { height: 21px; }
  .brand__mark i:nth-child(2) { height: 21px; }
  .brand__mark i:nth-child(1) { height: 10px; }
  .brand__mark i:nth-child(3) { height: 15px; }

  .wrap { padding: 20px 14px 46px; }

  .hero { padding: 20px 18px 18px; border-radius: 17px; }
  .hero__title { font-size: 23px; }
  .hero__stat strong { font-size: 31px; }
  .hero__eyebrow { font-size: 9px; letter-spacing: .2em; }

  .free-row { padding: 8px 10px; gap: 9px; }
  .free-row__day { flex-basis: 38px; font-size: 13px; }
  .seg { font-size: 11.5px; padding: 3px 9px; }

  .board__head { padding: 13px 15px 10px; }
  .sched { min-width: 560px; }
  .sched tbody th { width: 74px; font-size: 10.5px; padding: 8px 7px; }
  .cell { height: 42px; }
  .pdot { width: 18px; height: 18px; font-size: 9px; }
  .board__legend { padding: 11px 15px; gap: 12px; }

  .modal { padding: 0; place-items: end center; }
  .modal__panel {
    width: 100%;
    max-height: 82vh;
    border-radius: 18px 18px 0 0;
    border-bottom: none;
  }
}
