:root {
  --major-accent-a: #674fff;
  --major-accent-b: #0a68fe;
  --major-heading: #171a24;
  --major-text: #3d4655;
  --major-muted: #6c757d;
  --major-panel: #f9f9ff;
  --major-rule: #e5eaf2;
}

.major-layout {
  position: relative;
  display: grid;
  width: 1400px;
  margin: 15px auto 0;
  grid-template-columns: minmax(0, 1168px) 200px;
  gap: 32px;
  align-items: start;
}

.major-content-card {
  width: 1168px;
  min-width: 0;
  padding: 28px 24px;
  border-radius: 16px;
  color: var(--major-text);
  background: #fff;
  font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
}

.major-content-card [id] {
  scroll-margin-top: 96px;
}

.breadcrumbs {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  margin: 0 0 28px;
  color: var(--major-muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
}

.breadcrumbs a {
  color: inherit;
  text-decoration: none;
}

.breadcrumbs > span[aria-hidden="true"] {
  color: #a7b1c0;
}

.major-name-card {
  position: relative;
  display: flex;
  min-height: 110px;
  align-items: center;
  justify-content: center;
  margin: 4px 0 28px;
  padding: 12px 40px 12px 24px;
  overflow: hidden;
  border-radius: 14px;
  background: #f7f9ff;
  box-shadow: 0 6px 10px -7px rgba(95, 88, 237, 0.16);
}

.major-name-badge {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  width: 96px;
  height: 49px;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12px;
  color: #fff;
  background: linear-gradient(90deg, var(--major-accent-a), var(--major-accent-b));
  clip-path: polygon(0 0, 100% 0, 100% 72%, 12% 72%, 0 100%);
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: 0.04em;
}

.major-name-card h1 {
  width: 100%;
  margin: 8px 0 0;
  color: #2f2b31;
  font-size: 35px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-align: center;
}

.major-section {
  margin: 0 0 28px;
}

.major-content-card > .major-section:last-child {
  margin-bottom: 0;
}

.major-section-title {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 0 12px;
  padding-left: 12px;
  color: var(--major-heading);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.major-section-title::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 4px;
  height: 1em;
  border-radius: 999px;
  background: var(--accent-gradient);
  content: "";
  transform: translateY(-50%);
}

#major-intro > .major-section-title,
#major-gender > .major-section-title {
  line-height: 1.2;
}

#major-intro > .major-section-title {
  margin-bottom: 8px;
}

#major-gender,
#major-courses,
#major-employment {
  margin-bottom: 25px;
}

.major-intro-card {
  padding: 20px 15px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 7px 16px rgba(42, 73, 130, 0.03);
}

.major-intro-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--major-text);
  font-size: 16px;
  line-height: 1.85;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.gender-card {
  display: grid;
  padding: 18px;
  border-radius: 16px;
  background: var(--major-panel);
  grid-template-columns: 92px minmax(0, 1fr) 92px;
  align-items: center;
  gap: 16px;
}

.gender-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #4d5668;
  font-size: 20px;
  line-height: 1.3;
  white-space: nowrap;
}

.gender-label b,
.gender-label strong {
  font: inherit;
}

.gender-label-female {
  justify-content: flex-end;
}

.gender-track {
  position: relative;
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(10, 104, 254, 0.2);
}

.gender-male {
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, var(--major-accent-a), var(--major-accent-b));
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.gender-female {
  min-width: 0;
  flex: 1;
}

.major-courses .major-section-title,
.major-certificates .major-section-title {
  margin-bottom: 16px;
}

.course-track,
.certificate-track {
  display: flex;
  gap: 13px;
  margin: 0 -4px;
  padding: 2px 4px 14px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: 4px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.course-track::-webkit-scrollbar,
.certificate-track::-webkit-scrollbar {
  display: none;
}

.course-card {
  min-width: 0;
  flex: 0 0 144px;
  scroll-snap-align: start;
}

.course-cover {
  position: relative;
  display: flex;
  min-height: 192px;
  flex-direction: column;
  overflow: hidden;
  padding: 18px 13px;
  border-radius: 11px;
  background-color: #eef4ff;
  box-shadow: 0 8px 18px rgba(42, 73, 130, 0.04);
  isolation: isolate;
}

.course-cover::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 88% 6%, rgba(255, 255, 255, 0.6) 0 10%, transparent 11%),
    radial-gradient(circle at 16% 76%, rgba(255, 255, 255, 0.28) 0 16%, transparent 17%);
  content: "";
}

.course-cover::after {
  position: absolute;
  right: -18%;
  bottom: -26%;
  left: -14%;
  z-index: -1;
  height: 52%;
  border-radius: 50% 50% 0 0;
  background: rgba(255, 255, 255, 0.28);
  content: "";
  transform: rotate(-8deg);
}

.course-yellow .course-cover { background-image: linear-gradient(145deg, #fff2bf, #fff9df 58%, #ffd447); }
.course-blue .course-cover { background-image: linear-gradient(145deg, #bce4ff, #e9f7ff 58%, #55a9ff); }
.course-purple .course-cover { background-image: linear-gradient(145deg, #e7d8ff, #f7efff 58%, #c6a8ff); }
.course-mint .course-cover { background-image: linear-gradient(145deg, #d0f6e9, #effff9 58%, #63e2bf); }
.course-coral .course-cover { background-image: linear-gradient(145deg, #ffd1dc, #fff0f2 58%, #ff9cb3); }
.course-violet .course-cover { background-image: linear-gradient(145deg, #dcdcff, #f4f3ff 58%, #999aff); }
.course-sky .course-cover { background-image: linear-gradient(145deg, #c8efff, #effcff 58%, #65d4eb); }
.course-green .course-cover { background-image: linear-gradient(145deg, #d9f3c7, #f6ffef 58%, #a9de75); }

.course-cover > span {
  margin-bottom: 14px;
  color: rgba(31, 49, 79, 0.78);
  font-size: 13px;
  line-height: 1.3;
}

.course-cover h3 {
  margin: 0;
  color: var(--major-heading);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
  word-break: break-all;
}

.course-cover p {
  display: -webkit-box;
  margin: auto 0 0;
  overflow: hidden;
  color: rgba(86, 94, 108, 0.82);
  font-size: 9px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.training-top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.training-card,
.abilities,
.internship-card {
  min-width: 0;
  padding: 18px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 7px 16px rgba(42, 73, 130, 0.03);
}

.training-card h3,
.abilities h3,
.internship-card h3,
.career-panel h3 {
  margin: 0 0 12px;
  color: #202735;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.training-card p,
.internship-card p {
  margin: 0;
  color: var(--major-text);
  font-size: 14px;
  line-height: 1.85;
}

.training-card-wide p {
  font-size: 16px;
}

.abilities,
.internship-card {
  margin-top: 16px;
}

.abilities ol {
  display: grid;
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  list-style: none;
}

.abilities li {
  display: flex;
  min-height: 52px;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: var(--major-panel);
}

.abilities li > span {
  flex: 0 0 auto;
  color: var(--major-accent-b);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
}

.abilities li p {
  margin: 0;
  color: var(--major-text);
  font-size: 14px;
  line-height: 1.65;
}

.internship-card {
  background: var(--major-panel);
}

.career-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.career-panel {
  display: flex;
  min-width: 0;
  min-height: 322.7px;
  flex-direction: column;
  padding: 18px;
  border-radius: 16px;
  background: var(--major-panel);
  box-shadow: 0 6px 16px rgba(10, 104, 254, 0.03);
}

.career-donut-wrap {
  display: grid;
  min-height: 236px;
  flex: 1;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.career-donut {
  width: 150px;
  height: 150px;
  overflow: visible;
}

.career-donut circle {
  fill: none;
  stroke-width: 20;
}

.career-donut .donut-base {
  stroke: #edf2fb;
}

.career-donut text {
  fill: #242c3b;
  font-family: "PingFang SC", sans-serif;
  font-size: 19px;
  font-weight: 700;
  text-anchor: middle;
}

.career-donut text.donut-caption {
  fill: #7a8496;
  font-size: 11px;
  font-weight: 500;
}

.career-legend {
  display: flex;
  margin: 0;
  padding: 0;
  flex-direction: column;
  gap: 7px;
  list-style: none;
}

.career-legend li {
  display: grid;
  align-items: center;
  color: #626d80;
  font-size: 11px;
  line-height: 1.25;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  gap: 5px;
}

.career-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot);
}

.career-legend b {
  color: #303744;
  font-weight: 600;
}

.career-legend-compact {
  gap: 4px;
}

.salary-chart {
  width: 100%;
  min-height: 228px;
  flex: 1;
  overflow: visible;
}

.salary-grid line {
  stroke: #e7ecf5;
  stroke-width: 1;
}

.salary-chart polyline {
  fill: none;
  stroke: var(--major-accent-b);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.salary-points circle {
  fill: #fff;
  stroke: var(--major-accent-b);
  stroke-width: 3;
}

.salary-chart text {
  font-family: "PingFang SC", sans-serif;
  text-anchor: middle;
}

.salary-values text {
  fill: #2a3650;
  font-size: 11px;
  font-weight: 600;
}

.salary-labels text {
  fill: #7d8797;
  font-size: 10px;
}

.certificate-track {
  gap: 14px;
}

.certificate-card {
  position: relative;
  display: flex;
  min-height: 126px;
  flex: 0 0 180px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
  padding: 18px 16px;
  border-radius: 12px;
  background: var(--major-panel);
  box-shadow: 0 7px 16px rgba(29, 94, 254, 0.03);
  isolation: isolate;
  scroll-snap-align: start;
}

.certificate-card span,
.certificate-card h3 {
  position: relative;
  z-index: 1;
  max-width: 135px;
}

.certificate-card span {
  color: #7a8598;
  font-size: 11px;
  line-height: 1.3;
}

.certificate-card h3 {
  margin: 0;
  color: #303744;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}

.certificate-card i {
  position: absolute;
  top: -26px;
  right: -24px;
  width: 70px;
  height: 70px;
  border: 12px solid rgba(64, 114, 255, 0.13);
  border-radius: 50%;
  opacity: 0.75;
}

.quick-card {
  position: relative;
  z-index: 2;
  padding: 24px 20px 20px;
  border-radius: 16px;
  background: #fff;
}

.quick-card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 23px;
  padding: 0 0 5px;
  border-bottom: 1px solid #e9ecef;
  color: #212529;
  font-size: 20px;
  font-weight: 600;
  line-height: 22px;
}

.quick-card h2::before {
  width: 4px;
  height: 22px;
  flex: 0 0 4px;
  border-radius: 2px;
  background: var(--accent-gradient);
  content: "";
}

.quick-card nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quick-card a {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #000;
  background: rgba(243, 242, 255, 0.5);
  font-size: 18px;
  text-decoration: none;
}

.quick-card svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: #303030;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
}

@media (hover: hover) and (pointer: fine) {
  .breadcrumbs a:hover,
  .course-track:focus-visible,
  .certificate-track:focus-visible {
    color: #405aff;
  }

  .quick-card a:hover {
    background: rgba(243, 242, 255, 0.78);
  }
}

@media (max-width: 768px) {
  .major-layout {
    display: block;
    width: 375px;
    margin: 8px 0 0;
    overflow: clip;
  }

  .major-content-card {
    width: 343px;
    margin: 0 16px;
    padding: 16px;
    border-radius: 16px;
  }

  .major-content-card [id] {
    scroll-margin-top: 62px;
  }

  .breadcrumbs {
    min-height: 18px;
    gap: 7px;
    margin-bottom: 14px;
    overflow: hidden;
    color: #7b8798;
    font-size: 12px;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .breadcrumbs a,
  .breadcrumbs span {
    flex: 0 0 auto;
  }

  .breadcrumbs span[aria-current="page"] {
    min-width: 0;
    overflow: hidden;
    flex: 1;
    text-overflow: ellipsis;
  }

  .major-name-card {
    min-height: 80px;
    margin: 4px 0 20px;
    padding: 12px 20px 10px;
    border-radius: 12px;
  }

  .major-name-badge {
    width: 76px;
    height: 40px;
    padding-top: 9px;
    font-size: 11px;
    line-height: 15px;
  }

  .major-name-card h1 {
    margin-top: 8px;
    font-size: 20px;
    line-height: 1.3;
  }

  .major-section {
    margin-bottom: 20px;
  }

  .major-section-title {
    margin-bottom: 10px;
    padding-left: 11px;
    font-size: 18px;
  }

  #major-intro > .major-section-title,
  #major-gender > .major-section-title {
    margin-bottom: 8px;
    line-height: 1.25;
  }

  #major-training > .major-section-title {
    margin-bottom: 6px;
  }

  .major-section-title::before {
    width: 4px;
  }

  .major-intro-card {
    padding: 15px;
    border-radius: 12px;
  }

  .major-intro-card p {
    font-size: 14px;
    line-height: 1.8;
    -webkit-line-clamp: 5;
  }

  .gender-card {
    padding: 13px;
    border-radius: 13px;
    grid-template-columns: 62px minmax(0, 1fr) 62px;
    gap: 8px;
  }

  .gender-label {
    gap: 4px;
    font-size: 14px;
  }

  .gender-track {
    height: 6px;
  }

  .major-courses .major-section-title,
  .major-certificates .major-section-title {
    margin-bottom: 12px;
  }

  .course-track,
  .certificate-track {
    gap: 10px;
    margin-right: -2px;
    margin-left: -2px;
    padding: 2px 2px 12px;
  }

  .course-card {
    flex-basis: 118px;
  }

  .course-cover {
    min-height: 158px;
    padding: 14px 10px;
    border-radius: 10px;
  }

  .course-cover > span {
    margin-bottom: 10px;
    font-size: 10px;
  }

  .course-cover h3 {
    font-size: 17px;
    line-height: 1.32;
  }

  .course-cover p {
    font-size: 8px;
    line-height: 1.4;
    -webkit-line-clamp: 3;
  }

  .training-top-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .training-card,
  .abilities,
  .internship-card {
    padding: 13px;
    border-radius: 12px;
  }

  .training-card h3,
  .abilities h3,
  .internship-card h3,
  .career-panel h3 {
    margin-bottom: 9px;
    font-size: 16px;
  }

  .training-card p,
  .training-card-wide p,
  .internship-card p {
    font-size: 13px;
    line-height: 1.8;
  }

  .abilities,
  .internship-card {
    margin-top: 12px;
  }

  .abilities ol {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .abilities li {
    min-height: 0;
    gap: 8px;
    padding: 15px;
  }

  .abilities li > span,
  .abilities li p {
    font-size: 13px;
    line-height: 1.65;
  }

  .career-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .career-panel {
    min-height: 0;
    padding: 13px;
    border-radius: 13px;
  }

  #major-gender,
  #major-courses,
  #major-employment {
    margin-bottom: 20px;
  }

  .career-donut-wrap {
    min-height: 217.63px;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 8px;
  }

  .career-donut {
    width: 132px;
    height: 132px;
  }

  .career-donut circle {
    stroke-width: 18px;
  }

  .career-legend {
    gap: 5px;
  }

  .career-legend-compact {
    gap: 3px;
  }

  .career-legend li {
    font-size: 10px;
  }

  .salary-chart {
    min-height: 217.63px;
  }

  .certificate-track {
    gap: 8px;
  }

  .certificate-card {
    min-height: 86.4px;
    flex-basis: 123.2px;
    gap: 4px;
    padding: 12px 10.4px;
    border-radius: 10px;
  }

  .certificate-card span,
  .certificate-card h3 {
    max-width: 105px;
  }

  .certificate-card span {
    font-size: 8.8px;
  }

  .certificate-card h3 {
    font-size: 12.8px;
    line-height: 1.4;
  }

  .certificate-card i {
    top: -22px;
    right: -18px;
    width: 54px;
    height: 54px;
    border-width: 9px;
  }

  .quick-card {
    display: none;
  }
}
.major-name-badge {
  position: absolute;
  top: -4px;
  left: -2px;
  z-index: 2;
  display: block;
  width: 96px;
  height: 49px;
  box-sizing: border-box;
  padding: 0;
  border: 0;
  color: #fff;
  background: none;
  box-shadow: none;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  transform: scale(0.9);
  transform-origin: top left;
}

.major-name-badge::after {
  content: "";
  position: absolute;
  top: 37px;
  left: 0;
  width: 5px;
  height: 5px;
  background: #5949d4;
}

.major-name-badge__icon {
  position: absolute;
  top: 5px;
  left: 0;
  width: 100%;
  height: 37px;
  filter: drop-shadow(0 4px 8px rgba(28, 99, 254, 0.16));
}

.major-name-badge__text {
  position: absolute;
  top: 5px;
  left: 0;
  z-index: 1;
  display: flex;
  width: 96px;
  height: 32px;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.08em;
}

.major-name-badge__gradient-start {
  stop-color: #5f58ed;
}

.major-name-badge__gradient-end {
  stop-color: #0a68fe;
}

@media (max-width: 768px) {
  .major-name-badge {
    top: -4px;
    left: -2px;
    width: 76px;
    height: 40px;
    font-size: 13px;
  }

  .major-name-badge::after {
    top: 30px;
    width: 4px;
    height: 4px;
  }

  .major-name-badge__icon {
    top: 4px;
    height: 30px;
  }

  .major-name-badge__text {
    top: 4px;
    width: 76px;
    height: 26px;
  }
}