@charset "utf-8";

/* ===== Layout ===== */
.major-list-layout {
  position: relative;
  display: grid;
  width: 1400px;
  margin: 15px auto 0;
  grid-template-columns: minmax(0, 1168px) 200px;
  gap: 32px;
  align-items: start;
}

.major-list-main {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.major-list-card {
  position: relative;
  z-index: 1;
  padding: 28px 24px;
  border-radius: 16px;
  background: #fff;
}

/* ===== Breadcrumbs + Title ===== */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 28px;
  color: #6c757d;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
}

.breadcrumbs a {
  color: inherit;
  text-decoration: none;
}

.major-list-card h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 23px;
  padding: 0 0 5px;
  border-bottom: 1px solid #e9ecef;
  color: #212529;
  font-family: "PingFang SC", sans-serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 22px;
}

.major-list-card h1::before {
  width: 4px;
  height: 22px;
  flex: 0 0 4px;
  border-radius: 2px;
  background: var(--accent-gradient);
  content: "";
}

/* ===== Major Grid ===== */
.major-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* ===== Major Item Card ===== */
.major-item {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px 20px 20px 24px;
  border-radius: 12px;
  background: rgba(243, 242, 255, 0.5);
  overflow: hidden;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.major-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: 12px 0 0 12px;
  background: var(--brand-gradient);
  opacity: 0.7;
  transition: opacity 160ms ease;
}

.major-item__title {
  margin: 0 0 8px;
  color: #1f2a38;
  font-family: "PingFang SC", sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 26px;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 160ms ease;
}

.major-item__intro {
  margin: 0 0 12px;
  color: #6c757d;
  font-family: "PingFang SC", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  text-overflow: ellipsis;
}

.major-item__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.major-item__courses {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--brand-gradient);
  color: #fff;
  font-family: "PingFang SC", sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
}

.major-item__arrow {
  color: #a7b1c0;
  font-size: 18px;
  line-height: 1;
  transition: color 160ms ease, transform 160ms ease;
}

/* ===== Hover ===== */
@media (hover: hover) and (pointer: fine) {
  .major-item:hover {
    background: rgba(243, 242, 255, 0.85);
    box-shadow: 0 4px 12px -4px rgba(103, 79, 255, 0.18);
  }

  .major-item:hover::before {
    opacity: 1;
  }

  .major-item:hover .major-item__title {
    color: #405aff;
  }

  .major-item:hover .major-item__arrow {
    color: #405aff;
    transform: translateX(3px);
  }
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  margin: 28px 0 0;
  padding: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  min-width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  color: #000;
  background: #f9f9ff;
  font-size: 14px;
  line-height: 30px;
  text-align: center;
  text-decoration: none;
}

.pagination a[aria-current="page"],
.pagination a:active {
  color: #fff;
  background: var(--control-gradient);
}

@media (hover: hover) and (pointer: fine) {
  .pagination a {
    transition: color 140ms ease, background-color 140ms ease, filter 140ms ease;
  }

  .pagination a:not([aria-current="page"]):hover,
  .pagination a:not([aria-current="page"]):focus-visible {
    color: #405aff;
    background: #f0efff;
    outline: none;
  }

  .pagination a[aria-current="page"]:hover,
  .pagination a[aria-current="page"]:focus-visible {
    filter: brightness(0.92);
    outline: none;
  }
}

/* ===== Sidebar (shared with news-list) ===== */
.quick-card {
  position: relative;
  z-index: 2;
  padding: 24px 20px 20px;
  border: 0;
  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-family: "PingFang SC", sans-serif;
  font-size: 18px;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease;
}

.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) {
  .quick-card a:hover {
    color: #000;
    background: rgba(243, 242, 255, 0.78);
  }
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .major-list-layout {
    display: block;
    width: 375px;
    margin: 8px 0 0;
    overflow: clip;
  }

  .major-list-main {
    width: 375px;
  }

  .major-list-card {
    width: 343px;
    margin: 0 16px;
    padding: 16px;
    border-radius: 16px;
  }

  .breadcrumbs {
    min-height: 18px;
    gap: 7px;
    margin-bottom: 14px;
    color: #7b8798;
    font-size: 12px;
    line-height: 18px;
    white-space: nowrap;
  }

  .breadcrumbs > span[aria-hidden="true"] {
    color: #a7b1c0;
  }

  .major-list-card h1 {
    gap: 10px;
    margin-bottom: 0;
    padding-bottom: 5px;
    border-color: #e5eaf2;
    color: #1f2a38;
    font-size: 16px;
    line-height: 22px;
  }

  .major-list-card h1::before {
    width: 4px;
    height: 20px;
    flex-basis: 4px;
  }

  .major-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding-top: 12px;
  }

  .major-item {
    padding: 14px 14px 14px 18px;
    border-radius: 10px;
  }

  .major-item::before {
    border-radius: 10px 0 0 10px;
  }

  .major-item__title {
    font-size: 15px;
    line-height: 22px;
    margin-bottom: 6px;
  }

  .major-item__intro {
    font-size: 12px;
    line-height: 18px;
    margin-bottom: 10px;
  }

  .major-item__courses {
    font-size: 11px;
    padding: 3px 10px;
  }

  .major-item__arrow {
    font-size: 16px;
  }

  .pagination {
    gap: 8px;
    margin-top: 16px;
  }

  .pagination a,
  .pagination span {
    min-width: 34px;
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    color: #1f2a38;
    font-family: "PingFang SC", sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    white-space: nowrap;
    transform: scale(0.9);
    transform-origin: center;
  }

  .pagination a[aria-current="page"],
  .pagination a:active {
    color: #fff;
  }

  .quick-card {
    display: none;
  }
}
