:root {
  color-scheme: light;
  --zju-blue: #0068b7;
  --zju-blue-deep: #064678;
  --zju-blue-bright: #138ad5;
  --ink: #11334f;
  --muted: #61788e;
  --line: #c8ddef;
  --line-strong: #a8c9e4;
  --surface: #ffffff;
  --surface-soft: #f5f9fc;
  --header-fill: #eaf4fb;
  --compressed-fill: rgba(225, 239, 250, 0.62);
  --danger: #e53935;
  --group-width: 6.5rem;
  --subcategory-width: 5rem;
  --labels-width: calc(var(--group-width) + var(--subcategory-width));
  --time-width: 63.5rem;
  --row-height: 3rem;
  --header-height: 4rem;
  --shadow: 0 18px 50px rgba(18, 69, 105, 0.1);
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui,
    sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #edf5fb;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% -10%, rgba(0, 104, 183, 0.13), transparent 29rem),
    linear-gradient(180deg, #f7fbfe 0%, #eef6fb 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  width: min(100% - 3rem, 100rem);
  margin: 0 auto;
  padding: 2.25rem 0 3rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.identity {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.identity-mark {
  display: grid;
  width: 3.25rem;
  height: 3.25rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 1rem;
  color: #fff;
  background: linear-gradient(145deg, var(--zju-blue-bright), var(--zju-blue));
  box-shadow: 0 10px 24px rgba(0, 104, 183, 0.24);
}

.identity-mark svg {
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow {
  margin: 0 0 0.18rem;
  color: var(--zju-blue);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

h1 {
  margin: 0;
  color: var(--zju-blue-deep);
  font-size: clamp(1.55rem, 2.25vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.clock-status {
  display: flex;
  min-height: 2.65rem;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(0, 104, 183, 0.16);
  border-radius: 0.8rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
  font-weight: 650;
  box-shadow: 0 6px 20px rgba(18, 69, 105, 0.06);
  backdrop-filter: blur(12px);
}

.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--zju-blue);
  box-shadow: 0 0 0 0.25rem rgba(0, 104, 183, 0.11);
}

.clock-status.is-outside .status-dot {
  background: #8ba1b4;
  box-shadow: 0 0 0 0.25rem rgba(91, 116, 137, 0.1);
}

.workspace {
  overflow: hidden;
  border: 1px solid rgba(142, 181, 211, 0.44);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.toolbar {
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.9rem 1rem 0.9rem 1.15rem;
  border-bottom: 1px solid var(--line);
}

.mode-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 0.25rem;
  border: 1px solid #b8d4e9;
  border-radius: 0.85rem;
  background: #f6fafd;
}

.mode-button {
  min-width: 8.75rem;
  min-height: 2.55rem;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 0.66rem;
  color: var(--zju-blue-deep);
  background: transparent;
  font-size: 0.95rem;
  font-weight: 750;
  cursor: pointer;
  transition:
    color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.mode-button:hover:not(.is-active) {
  background: #eaf4fb;
}

.mode-button:focus-visible {
  outline: 3px solid rgba(0, 104, 183, 0.28);
  outline-offset: 2px;
}

.mode-button:active {
  transform: translateY(1px);
}

.mode-button.is-active {
  color: #fff;
  background: var(--zju-blue);
  box-shadow: 0 5px 14px rgba(0, 104, 183, 0.23);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem 1rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  white-space: nowrap;
}

.legend i {
  display: inline-block;
  width: 1.25rem;
  height: 0.46rem;
  border-radius: 999px;
}

.legend-bar {
  background: linear-gradient(90deg, var(--zju-blue-bright), var(--zju-blue));
}

.legend-now {
  height: 0.14rem !important;
  background: var(--danger);
}

.legend-compressed {
  border: 1px solid #c8deee;
  background: var(--compressed-fill);
}

.schedule-scroller {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: #99bdd9 #eaf3f9;
  scrollbar-width: thin;
}

.schedule-scroller:focus-visible {
  outline: 3px solid rgba(0, 104, 183, 0.22);
  outline-offset: -3px;
}

.schedule-table {
  position: relative;
  width: 100%;
  min-width: calc(var(--labels-width) + var(--time-width));
  color: var(--ink);
}

.axis-header {
  position: relative;
  z-index: 9;
  display: grid;
  height: var(--header-height);
  grid-template-columns: var(--group-width) var(--subcategory-width) minmax(var(--time-width), 1fr);
  border-bottom: 1px solid var(--line-strong);
  background: var(--header-fill);
}

.axis-corner {
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--zju-blue-deep);
  font-size: 0.92rem;
  font-weight: 800;
}

.axis-track,
.timeline-row {
  position: relative;
  overflow: hidden;
}

.axis-track {
  isolation: isolate;
}

.axis-title {
  position: absolute;
  z-index: 4;
  top: 0.65rem;
  left: 50%;
  color: var(--zju-blue-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  transform: translateX(-50%);
}

.compressed-band {
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  background:
    linear-gradient(135deg, rgba(0, 104, 183, 0.035) 25%, transparent 25%) 0 0 / 8px 8px,
    var(--compressed-fill);
}

.axis-tick,
.grid-line {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.axis-tick.is-boundary,
.grid-line.is-boundary {
  background: var(--line-strong);
}

.axis-label {
  position: absolute;
  z-index: 4;
  bottom: 0.85rem;
  color: #315979;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1;
  transform: translateX(-50%);
  white-space: nowrap;
}

.axis-label.is-boundary {
  color: var(--zju-blue-deep);
  font-weight: 800;
}

.axis-label.is-start {
  transform: none;
}

.axis-label.is-end {
  transform: translateX(-100%);
}

.hall-group {
  display: grid;
  grid-template-columns: var(--group-width) 1fr;
}

.hall-name {
  position: sticky;
  z-index: 7;
  left: 0;
  display: grid;
  min-height: calc(var(--rows) * var(--row-height));
  place-items: center;
  padding: 0.8rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--zju-blue-deep);
  background: #eaf4fb;
  font-size: 0.96rem;
  font-weight: 800;
  text-align: center;
}

.hall-rows {
  min-width: 0;
}

.schedule-row {
  display: grid;
  height: var(--row-height);
  grid-template-columns: var(--subcategory-width) minmax(var(--time-width), 1fr);
}

.subcategory {
  position: sticky;
  z-index: 6;
  left: var(--group-width);
  display: grid;
  place-items: center;
  padding: 0.55rem 0.65rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: #294f6d;
  background: #f2f8fd;
  font-size: 0.86rem;
  font-weight: 750;
  text-align: center;
}

.subcategory:empty::after {
  content: "—";
  color: #a4b5c4;
  font-weight: 500;
}

.timeline-row {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.time-slot {
  position: absolute;
  z-index: 3;
  top: 0.56rem;
  bottom: 0.56rem;
  min-width: 4.7rem;
  overflow: hidden;
  border: 1px solid rgba(0, 81, 145, 0.24);
  border-radius: 0.5rem;
  color: #fff;
  background: linear-gradient(90deg, var(--zju-blue-bright), var(--zju-blue));
  box-shadow: 0 4px 10px rgba(0, 83, 148, 0.17);
}

.slot-label {
  position: absolute;
  top: 50%;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  transform: translateY(-50%);
  white-space: nowrap;
}

.slot-label.start {
  left: 0.55rem;
}

.slot-label.end {
  right: 0.55rem;
}

.now-line {
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--danger);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.axis-track .now-line::before {
  position: absolute;
  top: 0.2rem;
  left: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--danger);
  content: "";
  transform: translateX(-50%);
}

.now-badge {
  position: absolute;
  z-index: 8;
  top: 0.42rem;
  left: 0;
  padding: 0.28rem 0.48rem;
  border-radius: 0.42rem;
  color: #fff;
  background: var(--danger);
  font-size: 0.67rem;
  font-weight: 800;
  line-height: 1;
  transform: translateX(-50%);
  white-space: nowrap;
}

.schedule-note {
  margin: 0;
  padding: 0.8rem 1.1rem 0.95rem;
  color: var(--muted);
  background: #fbfdff;
  font-size: 0.78rem;
  line-height: 1.6;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 1rem, 100rem);
    padding-top: 1rem;
  }

  .page-header,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header {
    gap: 1rem;
  }

  .clock-status {
    align-self: flex-start;
  }

  .toolbar {
    gap: 0.9rem;
  }

  .legend {
    justify-content: flex-start;
  }

  .mode-switch,
  .mode-button {
    width: 100%;
  }

  :root {
    --group-width: 8rem;
    --subcategory-width: 7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
