@font-face {
  font-family: "Guanyu Serif";
  src: url("assets/catalog-serif.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Guanyu Sans";
  src: url("assets/catalog-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: "Guanyu Sans", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: clamp(13px, .9vw, 16px);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: #dce6f0;
  background: #080e15;
  --muted: #9ba8b7;
  --serif: "Guanyu Serif", "Songti SC", "SimSun", serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
button { border: 0; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #9ed1fc; outline-offset: 5px; }
.lucide { width: 1.375rem; height: 1.375rem; flex: 0 0 auto; stroke-width: 1.2; }

.catalog-page {
  isolation: isolate;
  position: relative;
  display: grid;
  grid-template-columns: 14.5rem minmax(0, 1fr);
  grid-template-rows: auto minmax(min-content, 1fr) auto;
  grid-template-areas: "header header" "sidebar directory" "footer footer";
  min-height: 100dvh;
  overflow: visible;
}
.catalog-background {
  position: fixed;
  z-index: -1;
  inset: 0;
  background: #080e15;
  pointer-events: none;
}
.catalog-background img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; opacity: 0; transition: opacity 700ms ease; }
.catalog-background img.is-visible { opacity: 1; }
.catalog-background::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, #060d17b0, #060d1755 52%, #060d171a), linear-gradient(180deg, #050c1638, transparent 60%, #050c164a); }
.world-note > p { white-space: pre-line; }
@media (prefers-reduced-motion: reduce) { .catalog-background img { transition: none; } }

.site-header {
  position: relative;
  z-index: 3;
  grid-area: header;
  min-height: 6rem;
  padding: 0 2.5rem 1.1875rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 1.5rem; margin-top: 1.1875rem; white-space: nowrap; }
.brand-name { font-family: var(--serif); font-size: 2.3125rem; font-weight: 500; line-height: 1.4; letter-spacing: .03em; color: #f4f6f8; }
.brand-divider { width: 1px; height: 1.5625rem; margin-left: .0625rem; background: #43505a80; }
.brand-tagline { font-size: .875rem; letter-spacing: .125rem; color: #8e9caa; }
.header-tools { display: flex; align-items: center; min-height: 2.75rem; margin-top: 1.5625rem; gap: 1.6875rem; }
.course-search { display: flex; align-items: center; width: 15.625rem; height: 2.6875rem; gap: .8125rem; padding: 0 .8125rem; border: 1px solid #6a82964d; border-radius: .9375rem; background: #15202c2e; }
.course-search .lucide { width: 1.25rem; height: 1.25rem; color: #b4c1cf; }
.course-search input { width: 100%; min-width: 0; padding: 0; color: #e0e9f2; background: transparent; border: 0; font-size: .875rem; letter-spacing: .0625rem; outline: 0; }
.course-search:focus-within { border-color: #91c5f0; }
.course-search input::placeholder { color: #8d9aaa; opacity: 1; }
.course-search input::-webkit-search-cancel-button { cursor: pointer; }
.tools-divider { height: 1.4375rem; width: 1px; background: #4a5b6c36; }
.classroom-button { display: flex; align-items: center; gap: .75rem; padding: 0; background: none; white-space: nowrap; font-size: .875rem; letter-spacing: .0625rem; min-height: 2.75rem; }
.classroom-button .lucide { color: #b4c3d2; width: 1.5rem; height: 1.5rem; }
.classroom-button:hover { color: #9dd0fb; }
.profile-button { display: grid; place-items: center; width: 2.625rem; height: 2.625rem; padding: 0; margin-left: 1.25rem; border-radius: 50%; background: #354458; }
.profile-button .lucide { width: 1.75rem; height: 1.75rem; color: #afc2d8; fill: #9fb3cd; stroke-width: 1.1; }
.profile-panel { position: absolute; top: 5rem; right: 2.5rem; width: 18rem; padding: 1.5rem; border: 1px solid #465c7266; border-radius: .75rem; background: #101b29f5; box-shadow: 0 1rem 3rem #03070cb3; }
.profile-panel h2 { font-size: 1.125rem; font-weight: 500; }
.profile-panel p { color: var(--muted); font-size: .875rem; line-height: 1.9; margin: .75rem 0 1.2rem; }
.profile-panel button { display: inline-flex; align-items: center; gap: .75rem; background: none; padding: .25rem 0; font-size: .875rem; }

.sidebar { grid-area: sidebar; position: relative; min-height: 0; padding-top: 1.375rem; border-right: 1px solid #52667c14; overflow-y: auto; }
.category-nav { display: flex; flex-direction: column; gap: .375rem; padding-top: 1.5rem; }
.category-button { display: flex; align-items: center; gap: 1.375rem; padding: 0 1rem 0 2.5rem; width: 13.5rem; height: 3.5625rem; flex-shrink: 0; text-align: left; border-left: 2px solid transparent; border-radius: 0 .5rem .5rem 0; background: transparent; color: #a5b2c2; font-size: 1rem; font-weight: 300; letter-spacing: .125rem; transition: color .16s ease, background .16s ease; }
.category-button .lucide { width: 1.375rem; height: 1.375rem; stroke-width: 1.1; }
.category-button:hover { background: #17233280; color: #deedff; }
.category-button.is-active { border-left-color: #98cbf1; background: #172331d9; color: #a8d8ff; }
.category-button[data-category="all"] .lucide rect { fill: #71b9f7; stroke: #71b9f7; stroke-width: 1; }
.sidebar-note { position: absolute; left: 2.5rem; bottom: 5.9375rem; color: #95a2af; font-size: .875rem; line-height: 1.8; letter-spacing: .125rem; }
.short-rule { display: block; width: 1.375rem; height: 1px; background: #9dabba99; margin: 1.5rem 0 1.375rem; }
.english-note { font-size: .625rem; letter-spacing: .3125rem; line-height: 2.1; color: #8b9eae; }

.directory { grid-area: directory; display: flex; flex-direction: column; padding: min(2.125rem, 3.32dvh) 2.5rem min(5rem, 7.82dvh) 3.875rem; min-width: 0; min-height: 0; }
.directory-heading { flex-shrink: 0; }
.directory-heading h1 { color: #f0f3f6; font-family: var(--serif); font-size: 3rem; line-height: 1.35; font-weight: 500; letter-spacing: .3125rem; transform: translateY(-.1875rem); }
.directory-heading > p { margin-top: 0; color: #a1afbe; font-size: 1rem; line-height: 1.8; letter-spacing: .1rem; }
.directory-signature { position: absolute; top: 9.8125rem; right: 2.375rem; text-align: right; font-size: .625rem; line-height: 2; letter-spacing: .375rem; color: #8c9aab; }
.course-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 23rem), 1fr)); align-content: start; align-items: stretch; gap: 1.25rem; margin-top: min(2.275rem, 3.56dvh); flex: 0 0 auto; max-width: 68rem; }
.course-card { display: flex; flex-direction: column; position: relative; isolation: isolate; width: 100%; height: 100%; min-width: 0; padding: 1.8125rem 2.0625rem 1.6875rem; overflow: hidden; border: 1px solid #7a92ad38; border-radius: .8125rem; background: #09111b; transition: border-color .18s ease, box-shadow .18s ease; }
.course-card:hover { border-color: #9fcdfd8f; box-shadow: 0 .75rem 3rem #040b1640; }
.course-art { display: block; position: absolute; z-index: -1; width: 100%; height: 100%; inset: 0; object-fit: cover; }
.course-card--cosmos .course-art { object-position: 68% center; }
.course-card--solar .course-art { object-position: 25% center; filter: saturate(.86) brightness(.86); }
.course-badge { display: flex; align-self: flex-start; align-items: center; justify-content: center; min-width: 5.4375rem; min-height: 1.875rem; flex-shrink: 0; padding: .2rem .625rem; border-radius: .3125rem; background: linear-gradient(100deg,#8a8b8b66,#68768436); font-size: .875rem; letter-spacing: .0875rem; font-weight: 400; color: #f0f3f7; }
.course-copy { margin-top: auto; padding-top: 20%; flex-shrink: 0; }
.course-copy h2 { font-family: var(--serif); font-size: 2.3125rem; font-weight: 500; line-height: 1.4; color: #f7f8fa; letter-spacing: .0125rem; }
.course-copy p { margin-top: .5rem; font-size: 1rem; line-height: 1.65; color: #b1bdcb; letter-spacing: .05rem; }
.course-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; min-height: 1.5rem; flex-shrink: 0; margin-top: 1.6875rem; gap: .75rem 1rem; font-size: .875rem; }
.course-grades { display: inline-flex; align-items: center; gap: 1rem; color: #a9b7c8; letter-spacing: .125rem; }
.course-grades .lucide { width: 1.125rem; height: 1.125rem; }
.grade-divider { display: inline-block; width: 1px; height: .9375rem; margin: 0 .3125rem; background: #8a98a24d; }
.enter-course { display: inline-flex; align-items: center; gap: 1.0625rem; letter-spacing: .125rem; font-weight: 400; color: #f0f5fc; }
.enter-course .lucide { width: 1.4375rem; height: 1.4375rem; }
.empty-state { grid-column: 1 / -1; display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%; border: 1px solid #34465a66; border-radius: .8125rem; background: #0b1420c2; text-align: center; padding: 3rem 2rem; }
.empty-state > .lucide { width: 3rem; height: 3rem; color: #7ea7ca; margin-bottom: 1.5rem; }
.empty-state h2 { font-family: var(--serif); font-size: 1.75rem; font-weight: 500; }
.empty-state p { color: var(--muted); font-size: .9375rem; margin: 1rem 0 2rem; }
.empty-state button { display: inline-flex; align-items: center; gap: 1rem; background: #23374a; border: 1px solid #648bae77; border-radius: .4rem; padding: .75rem 1rem; font-size: .875rem; }
.world-note { position: absolute; right: 2.5rem; bottom: 9.375rem; text-align: right; font-size: .875rem; line-height: 1.8; letter-spacing: .125rem; color: #9aabbf; pointer-events: none; }
.world-note .short-rule { margin-left: auto; margin-top: 1.5rem; margin-bottom: 0; }

.site-footer { grid-area: footer; position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; min-height: 4.375rem; padding: .75rem 2.5rem; border-top: 1px solid #4c64772b; background: #08111a12; color: #879aaf; font-size: .8125rem; letter-spacing: .1rem; }
.footer-brand { display: flex; align-items: center; gap: .9375rem; }
.footer-brand > span:first-child { color: #e0eaf4; }
.footer-divider { width: 1px; height: .9375rem; background: #718ba345; }
.roman-brand { letter-spacing: .1875rem; color: #b5c8dc; }
.site-footer > p { letter-spacing: .1875rem; }
.toast { position: fixed; z-index: 8; bottom: 2rem; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 2rem); padding: .9rem 1.3rem; background: #172839f5; border: 1px solid #6889a2; border-radius: .6rem; font-size: 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 10; top: 1rem; left: 1rem; transform: translateY(-200%); padding: .75rem 1rem; background: #d4e9fa; color: #0a1726; border-radius: .25rem; }
.skip-link:focus { transform: translateY(0); }
.is-classroom .site-footer { display: none; }

@media (min-width: 1921px) {
  .directory { padding-top: 3rem; }
  .course-list { margin-top: 3rem; }
}
@media (max-width: 1150px) {
  .directory-signature { display: none; }
  .world-note { opacity: .7; }
  .brand-tagline { font-size: .85rem; }
}
@media (max-width: 900px) {
  .catalog-page { grid-template-columns: 12rem minmax(0, 1fr); }
  .site-header { padding: 0 1.5rem 1.1875rem; }
  .brand { gap: 1rem; }
  .brand-tagline, .brand-divider, .tools-divider { display: none; }
  .header-tools { gap: 1rem; }
  .profile-button { margin-left: 0; }
  .course-search { width: 13rem; }
  .category-button { width: 11.25rem; padding-left: 1.5rem; gap: 1rem; letter-spacing: .05rem; }
  .sidebar-note { left: 1.5rem; font-size: .8rem; }
  .directory { padding-left: 2rem; padding-right: 1.5rem; }
  .directory-heading h1 { font-size: 2.5rem; }
  .directory-heading > p { font-size: .9rem; max-width: 25rem; }
  .course-card { width: 100%; padding-inline: 1.5rem; }
  .course-art { object-position: 45% top; }
  .course-copy h2 { font-size: 1.875rem; }
  .course-copy p { font-size: .875rem; }
  .course-copy p br { display: none; }
  .world-note { display: none; }
  .site-footer { padding: 0 1.5rem; }
  .site-footer > p { display: none; }
}
@media (max-width: 620px) {
  :root { font-size: 16px; }
  .catalog-page { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto auto; grid-template-areas: "header" "sidebar" "directory" "footer"; }
  .catalog-page::before { background-position: 58% bottom; background-size: auto 100%; }
  .site-header { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 1rem; min-height: 0; padding: 1rem 1.25rem; align-items: center; }
  .brand { margin-top: 0; }
  .brand-name { font-size: 2rem; }
  .header-tools { display: contents; }
  .course-search { grid-column: 1 / -1; grid-row: 2; width: 100%; min-height: 2.75rem; background: #111e2ad9; }
  .classroom-button { font-size: .8125rem; gap: .5rem; }
  .classroom-button .lucide { width: 1.25rem; height: 1.25rem; }
  .profile-button { width: 2.25rem; height: 2.25rem; }
  .profile-button .lucide { width: 1.375rem; height: 1.375rem; }
  .profile-panel { top: 4rem; right: 1.25rem; }
  .sidebar { padding-top: 0; border-right: 0; overflow-y: visible; }
  .category-nav { padding: 0 1.25rem .75rem; flex-direction: row; gap: .5rem; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #29415a transparent; }
  .category-button { width: auto; height: 2.75rem; padding: 0 .875rem; gap: .5rem; border: 1px solid transparent; border-radius: .4rem; font-size: .875rem; letter-spacing: 0; }
  .category-button.is-active { border-color: #597e9c80; }
  .category-button .lucide { width: 1rem; height: 1rem; }
  .sidebar-note { display: none; }
  .directory { padding: .875rem 1.25rem 1.25rem; overflow: visible; }
  .directory-heading h1 { font-size: 2.125rem; line-height: 1.45; letter-spacing: .2rem; }
  .directory-heading > p { margin-top: .375rem; font-size: .8125rem; line-height: 1.9; letter-spacing: .03rem; }
  .course-list { flex: 0 0 auto; margin-top: 1rem; }
  .course-card { aspect-ratio: auto; min-height: 19rem; padding: 1.25rem; }
  .course-art { object-position: 43% top; }
  .course-copy h2 { font-size: 1.65rem; }
  .course-copy p { margin-top: .75rem; font-size: .875rem; line-height: 1.9; letter-spacing: 0; }
  .course-bottom { font-size: .8125rem; margin-top: 1.25rem; }
  .course-grades { gap: .65rem; letter-spacing: .05rem; }
  .enter-course { gap: .5rem; letter-spacing: .05rem; }
  .enter-course .lucide { width: 1.125rem; height: 1.125rem; }
  .empty-state { max-height: none; min-height: 19rem; padding: 1.5rem; }
  .site-footer { padding: .75rem 1.25rem; min-height: 3.25rem; font-size: .7rem; }
  .footer-brand { flex-wrap: wrap; gap: .75rem; }
  .footer-tagline { display: none; }
  .footer-divider:nth-of-type(4) { display: none; }
}
@media (max-height: 850px) {
  .sidebar-note { display: none; }
}
@media (max-height: 640px) and (min-width: 621px) {
  .site-header { min-height: 5rem; padding-bottom: .75rem; }
  .directory { padding-top: .75rem; padding-bottom: 1.25rem; }
  .directory-heading h1 { font-size: 2.25rem; }
  .course-list { margin-top: 1rem; }
  .sidebar { padding-top: .5rem; }
  .category-nav { padding-top: 1rem; gap: .125rem; }
  .category-button { height: 3rem; }
  .site-footer { min-height: 3rem; }
  .world-note { display: none; }
}
@media (max-height: 700px) and (max-width: 620px) {
  .site-header { padding-block: .75rem; gap: .75rem; }
  .directory { padding-top: .5rem; padding-bottom: .75rem; }
  .directory-heading h1 { font-size: 1.8rem; }
  .directory-heading > p { font-size: .75rem; margin-top: 0; }
  .site-footer { min-height: 2.75rem; }
}
@media (max-height: 480px), (max-width: 359px) {
  .catalog-page { min-height: 100dvh; grid-template-rows: auto auto auto; }
  .directory, .sidebar { overflow: visible; }
  .course-list { flex: 0 0 auto; }
  .course-card, .empty-state { height: auto; max-height: none; }
  .course-copy { padding-top: 4rem; }
  .world-note, .directory-signature { display: none; }
}
@media (max-width: 620px) and (max-height: 480px), (max-width: 359px) {
  .catalog-page { grid-template-rows: auto auto auto auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
