:root {
  --ink: #172033;
  --ink-soft: #4f5b6f;
  --paper: #fbfaf8;
  --paper-deep: #f3eee9;
  --white: #ffffff;
  --brand: #971d3d;
  --brand-dark: #71152d;
  --brand-pale: #f7e8ec;
  --line: #dfd9d3;
  --line-soft: #ebe6e1;
  --navy: #16243d;
  --shadow: 0 24px 60px rgba(28, 35, 52, 0.1);
  --radius-lg: 28px;
  --radius-md: 18px;
  --shell: min(1180px, calc(100% - 40px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: var(--shell);
  margin: 0 auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  color: var(--white);
  background: var(--navy);
  border-radius: 10px;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 250, 248, 0.92);
  border-bottom: 1px solid rgba(223, 217, 211, 0.85);
  backdrop-filter: blur(16px);
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--brand);
  border-radius: 14px 14px 14px 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: var(--brand-dark);
  font-size: 19px;
  letter-spacing: -0.03em;
}

.brand small {
  margin-top: 2px;
  color: #78716b;
  font-size: 11px;
  letter-spacing: 0.15em;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  color: #4d5564;
  font-size: 14px;
  font-weight: 650;
}

.top-nav a {
  position: relative;
  transition: color 0.2s ease;
}

.top-nav a:not(.nav-home)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  color: var(--brand);
}

.top-nav a:hover::after,
.top-nav a:focus-visible::after {
  transform: scaleX(1);
}

.nav-home {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 0 92px;
  background:
    radial-gradient(circle at 90% 5%, rgba(151, 29, 61, 0.12), transparent 27%),
    linear-gradient(135deg, #fff 0%, #fbf8f4 58%, #f3ebe7 100%);
}

.hero::before {
  content: "";
  position: absolute;
  width: 540px;
  height: 540px;
  left: -350px;
  bottom: -360px;
  border: 1px solid rgba(151, 29, 61, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(151, 29, 61, 0.03), 0 0 0 140px rgba(151, 29, 61, 0.025);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(340px, 0.72fr);
  gap: 72px;
  align-items: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 28px;
  height: 2px;
  background: currentColor;
}

.hero h1 {
  margin: 0;
  max-width: 760px;
  color: var(--ink);
  font-size: clamp(44px, 5.8vw, 74px);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.hero h1 em {
  color: var(--brand);
  font-family: "Songti SC", "STSong", Georgia, serif;
  font-style: normal;
  font-weight: 700;
}

.hero-lead {
  max-width: 720px;
  margin: 26px 0 34px;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.9;
}

.course-search > label {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.search-control {
  min-height: 64px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 7px 7px 7px 22px;
  background: var(--white);
  border: 1px solid #d9d3ce;
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(44, 38, 36, 0.09);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-control:focus-within {
  border-color: rgba(151, 29, 61, 0.65);
  box-shadow: 0 18px 45px rgba(90, 28, 44, 0.13), 0 0 0 4px rgba(151, 29, 61, 0.08);
}

.search-symbol {
  position: relative;
  width: 17px;
  height: 17px;
  border: 2px solid #78716b;
  border-radius: 50%;
}

.search-symbol::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  right: -6px;
  bottom: -3px;
  background: #78716b;
  transform: rotate(45deg);
  transform-origin: center;
}

.search-control input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
}

.search-control input::placeholder {
  color: #9b948e;
}

.search-control button,
.empty-state button {
  min-height: 48px;
  padding: 0 22px;
  color: var(--white);
  background: var(--brand);
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 750;
  transition: background 0.2s ease, transform 0.2s ease;
}

.search-control button:hover,
.search-control button:focus-visible,
.empty-state button:hover,
.empty-state button:focus-visible {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.search-hint {
  margin: 10px 0 0 4px;
  color: #8b837d;
  font-size: 12px;
}

.hero-panel {
  position: relative;
  min-height: 450px;
  overflow: hidden;
  padding: 45px 40px 35px;
  color: var(--white);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.055), transparent 45%),
    var(--navy);
  border-radius: 34px 34px 34px 8px;
  box-shadow: 0 35px 80px rgba(24, 32, 50, 0.24);
}

.panel-orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
}

.orbit-one {
  width: 310px;
  height: 310px;
  right: -90px;
  top: -120px;
}

.orbit-two {
  width: 190px;
  height: 190px;
  right: -32px;
  top: -60px;
}

.panel-kicker {
  margin: 0 0 44px;
  color: #c5ccda;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
}

.panel-number {
  position: relative;
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 78px;
  line-height: 1;
  letter-spacing: -0.055em;
}

.panel-caption {
  display: block;
  margin-top: 8px;
  color: #d8dce4;
  font-size: 15px;
}

.panel-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 34px 0 0;
  padding: 22px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.panel-stats div {
  padding-left: 13px;
  border-left: 2px solid rgba(181, 69, 96, 0.85);
}

.panel-stats dt {
  font-size: 24px;
  font-weight: 800;
}

.panel-stats dd {
  margin: 5px 0 0;
  color: #b9c1cf;
  font-size: 11px;
}

.panel-note {
  margin: 22px 0 0;
  color: #b9c1cf;
  font-size: 12px;
  line-height: 1.75;
}

.subject-section,
.courses-section {
  padding: 94px 0;
}

.subject-section {
  background: var(--white);
}

.section-heading h2,
.course-toolbar h2,
.method-intro h2 {
  margin: 0;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.split-heading {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 60px;
  align-items: end;
  margin-bottom: 38px;
}

.split-heading > p {
  max-width: 520px;
  margin: 0 0 5px;
  color: var(--ink-soft);
  line-height: 1.8;
}

.subject-matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.subject-card {
  position: relative;
  min-height: 210px;
  padding: 26px 24px 24px;
  text-align: left;
  color: var(--ink);
  background: var(--white);
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: color 0.22s ease, background 0.22s ease, transform 0.22s ease;
}

.subject-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--subject-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.subject-card:hover,
.subject-card:focus-visible,
.subject-card.is-active {
  z-index: 1;
  color: var(--white);
  background: var(--subject-accent);
  outline: 0;
  transform: translateY(-4px);
  box-shadow: 0 20px 48px rgba(29, 36, 53, 0.16);
}

.subject-card:hover::before,
.subject-card:focus-visible::before,
.subject-card.is-active::before {
  transform: scaleX(1);
}

.subject-code {
  display: block;
  color: var(--subject-accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 31px;
  font-weight: 700;
  line-height: 1;
}

.subject-card:hover .subject-code,
.subject-card:focus-visible .subject-code,
.subject-card.is-active .subject-code {
  color: rgba(255, 255, 255, 0.82);
}

.subject-card strong {
  display: block;
  margin-top: 32px;
  font-size: 18px;
}

.subject-card p {
  min-height: 42px;
  margin: 9px 0 0;
  color: #706b66;
  font-size: 12px;
  line-height: 1.7;
}

.subject-card:hover p,
.subject-card:focus-visible p,
.subject-card.is-active p {
  color: rgba(255, 255, 255, 0.76);
}

.subject-count {
  position: absolute;
  right: 20px;
  top: 22px;
  display: inline-flex;
  min-width: 31px;
  min-height: 31px;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  color: #77716b;
  background: #f4f1ee;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.subject-card:hover .subject-count,
.subject-card:focus-visible .subject-count,
.subject-card.is-active .subject-count {
  color: var(--white);
  background: rgba(255, 255, 255, 0.18);
}

.courses-section {
  background: var(--paper-deep);
}

.course-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.result-count {
  margin: 0 0 6px;
  color: #756e69;
  font-size: 13px;
}

.result-count strong {
  color: var(--brand);
  font-size: 18px;
}

.active-filter-row {
  margin: -12px 0 24px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 17px;
  color: #4d4650;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
}

.active-filter-row:not([hidden]) {
  display: flex;
}

.active-filter-row button {
  color: var(--brand);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 750;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.course-card {
  position: relative;
  overflow: hidden;
  display: flex;
  min-height: 470px;
  flex-direction: column;
  padding: 0;
  background: var(--white);
  border: 1px solid #ddd6cf;
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 36px rgba(35, 39, 50, 0.06);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.course-card:hover,
.course-card:focus-within {
  border-color: rgba(151, 29, 61, 0.35);
  box-shadow: var(--shadow);
  transform: translateY(-7px);
}

.course-cover {
  position: relative;
  min-height: 165px;
  overflow: hidden;
  padding: 26px;
  color: var(--white);
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.16), transparent 28%),
    linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
}

.course-cover::before,
.course-cover::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.course-cover::before {
  width: 200px;
  height: 200px;
  right: -75px;
  top: -98px;
}

.course-cover::after {
  width: 118px;
  height: 118px;
  right: -22px;
  top: -43px;
}

.cover-row {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.course-abbr {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 44px;
  line-height: 1;
}

.course-status {
  padding: 7px 10px;
  color: #661127;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.cover-category {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 42px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 11px;
  letter-spacing: 0.13em;
}

.course-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 26px;
}

.course-body h3 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.03em;
}

.course-scope {
  min-height: 42px;
  margin: 8px 0 14px;
  color: #6d6660;
  font-size: 12px;
  line-height: 1.65;
}

.course-description {
  min-height: 47px;
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.75;
}

.course-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 0 22px;
  padding: 15px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.course-metrics div {
  text-align: center;
  border-right: 1px solid var(--line-soft);
}

.course-metrics div:last-child {
  border-right: 0;
}

.course-metrics dt {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.course-metrics dd {
  margin: 4px 0 0;
  color: #8b837d;
  font-size: 11px;
}

.noscript-message {
  padding: 18px 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.noscript-message a {
  color: var(--brand);
  font-weight: 750;
  text-decoration: underline;
}

.course-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 22px;
}

.course-tags span {
  padding: 5px 8px;
  color: #6d5d62;
  background: var(--brand-pale);
  border-radius: 6px;
  font-size: 10px;
}

.course-link {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding: 0 17px;
  color: var(--white);
  background: var(--navy);
  border-radius: 13px;
  font-size: 13px;
  font-weight: 750;
  transition: background 0.2s ease;
}

.course-link span:last-child {
  font-size: 20px;
  transition: transform 0.2s ease;
}

.course-link:hover,
.course-link:focus-visible {
  background: var(--brand);
  outline: 0;
}

.course-link:hover span:last-child,
.course-link:focus-visible span:last-child {
  transform: translateX(4px);
}

.course-add-card {
  min-height: 470px;
  display: grid;
  place-items: center;
  padding: 34px;
  text-align: center;
  color: #736c66;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.2)),
    repeating-linear-gradient(135deg, transparent, transparent 12px, rgba(151, 29, 61, 0.02) 12px, rgba(151, 29, 61, 0.02) 24px);
  border: 1px dashed #cfc4bc;
  border-radius: var(--radius-lg);
}

.course-add-card b {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  margin: 0 auto 20px;
  color: var(--brand);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  box-shadow: 0 12px 30px rgba(35, 39, 50, 0.08);
}

.course-add-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 21px;
}

.course-add-card p {
  max-width: 260px;
  margin: 12px auto 0;
  font-size: 13px;
  line-height: 1.75;
}

.empty-state {
  padding: 70px 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.empty-state > span {
  display: inline-grid;
  width: 68px;
  height: 68px;
  place-items: center;
  color: var(--brand);
  background: var(--brand-pale);
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.empty-state h3 {
  margin: 20px 0 8px;
  font-size: 24px;
}

.empty-state p {
  max-width: 480px;
  margin: 0 auto 22px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.empty-state button {
  min-height: 44px;
}

.method-section {
  padding: 104px 0;
  color: var(--white);
  background: var(--navy);
}

.method-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 100px;
  align-items: start;
}

.eyebrow.light {
  color: #d88ca0;
}

.method-intro h2 {
  font-size: clamp(38px, 4.5vw, 58px);
}

.method-intro > p:last-child {
  margin: 25px 0 0;
  color: #b8c1d1;
  line-height: 1.85;
}

.method-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.method-list li {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.method-list b {
  color: #d88ca0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
}

.method-list strong {
  display: block;
  margin-bottom: 7px;
  font-size: 16px;
}

.method-list span {
  color: #b8c1d1;
  font-size: 13px;
  line-height: 1.7;
}

.method-list span strong {
  color: var(--white);
}

.site-footer {
  padding: 46px 0;
  color: #5f5a55;
  background: #f2efeb;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px 60px;
  align-items: start;
}

.footer-inner strong {
  color: var(--brand);
  font-size: 20px;
}

.footer-inner p {
  max-width: 620px;
  margin: 9px 0 0;
  font-size: 12px;
  line-height: 1.7;
}

.footer-links {
  display: flex;
  gap: 22px;
  font-size: 12px;
  font-weight: 700;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--brand);
}

.copyright {
  grid-column: 1 / -1;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1020px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 46px;
  }

  .hero-panel {
    min-height: 360px;
  }

  .subject-matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .method-grid {
    gap: 58px;
  }
}

@media (max-width: 760px) {
  :root {
    --shell: min(100% - 28px, 1180px);
  }

  .header-inner {
    min-height: 68px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand strong {
    font-size: 17px;
  }

  .top-nav a:not(.nav-home) {
    display: none;
  }

  .nav-home {
    padding: 9px 12px;
    font-size: 12px;
  }

  .hero {
    padding: 60px 0 68px;
  }

  .hero h1 {
    font-size: clamp(40px, 12vw, 58px);
  }

  .hero-lead {
    font-size: 15px;
  }

  .search-control {
    grid-template-columns: 22px minmax(0, 1fr);
    padding: 12px 15px;
  }

  .search-control button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .hero-panel {
    min-height: 390px;
    padding: 36px 26px 28px;
  }

  .panel-number {
    font-size: 68px;
  }

  .subject-section,
  .courses-section,
  .method-section {
    padding: 72px 0;
  }

  .split-heading {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .subject-matrix,
  .course-grid,
  .method-grid {
    grid-template-columns: 1fr;
  }

  .subject-card {
    min-height: 185px;
  }

  .course-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-count {
    margin: 0;
  }

  .course-card,
  .course-add-card {
    min-height: auto;
  }

  .course-add-card {
    min-height: 310px;
  }

  .method-grid {
    gap: 48px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-links {
    flex-wrap: wrap;
  }

  .copyright {
    grid-column: auto;
  }
}

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