/* ==================== CSS Reset & Base ==================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #003d8f;
  --primary-light: #00509e;
  --primary-lighter: #00479e;
  --primary-dark: #002a66;
  --secondary: #00529d;
  --bg-gray: #f9fafb;
  --bg-white: #ffffff;
  --text-dark: #1f2937;
  --text-gray: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

body {
  font-family: 'Microsoft Yahei', -apple-system, BlinkMacSystemFont, 'Noto Sans SC', 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-gray);
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==================== Layout ==================== */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 640px) {
  .container {
    padding: 0 24px;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 32px;
  }
}

/* ==================== Header ==================== */
.header {
  background-image: url(../image/top-bg.png);
  border-bottom: 1px solid var(--border);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 0;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo svg {
  width: 28px;
  height: 28px;
  color: white;
}

.logo-text h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3;
}

.logo-text span {
  font-size: 14px;
  color: var(--primary);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 0px 1px 12px;
  width: 100%;
  max-width: 320px;
  transition: var(--transition);
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 61, 143, 0.1);
}

.search-box svg {
  width: 16px;
  height: 16px;
  color: var(--text-light);
  flex-shrink: 0;
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  flex: 1;
  font-size: 14px;
  color: var(--text-dark);
  min-width: 0;
}

.search-box input::placeholder {
  color: var(--text-light);
}

.search-box input:focus {
  outline: none;
}

.search-btn {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 4px;
  border: none;
  background-color: #9ca3af;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.search-btn:hover {
  background-color: #6b7280;
}

/* ==================== Navigation ==================== */
.nav {
  background-image: url(../image/nav-bg.png);
  color: white;
  height: 63px;
  position: relative;
  z-index: 100;
}

.nav .container {
  height: 100%;
  overflow: visible;
}

.nav-list {
  display: flex;
  overflow-x: visible;
  overflow-y: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
  width: 100%;
  height: 100%;
}

.nav-list::-webkit-scrollbar {
  display: none;
}

.nav-list li {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--transition);
  text-align: center;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 10px;
  background: url(../image/nav-dot.png) repeat-x bottom;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 120px;
}

@media (min-width: 768px) {
  .nav-link {
    padding: 0 20px;
    font-size: 18px;
  }
}

/* ==================== Nav Submenu ==================== */
.nav-item-has-sub {
  position: relative;
}

.nav-sub {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 175px;
  padding: 15px 0;
  text-align: center;
  z-index: 999;
  background: rgba(232, 232, 232, 0.79);
  list-style: none;
  margin: 0;
}

.nav-item-has-sub:hover .nav-sub {
  display: block;
}

.nav-sub li {
  list-style: none;
}

.nav-sub li a {
  color: var(--text-dark);
  display: block;
  width: 100%;
  height: 60px;
  line-height: 60px;
  margin: 0;
  font-size: 16px;
  text-decoration: none;
  text-align: center;
  border-bottom: 1px dotted rgba(51, 51, 51, 0.37);
}

.nav-sub li a:hover {
  color: var(--bg-gray);
  background-color: var(--primary-light);
}

/* ==================== Main Content ==================== */
.main {
  padding: 32px 0;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 1024px) {
  .content-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==================== Card ==================== */
.card {
  background: var(--bg-white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 0px;
}

.card-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
}

.card-header a {
  font-size: 12px;
  color: var(--primary);
}

.card-header a:hover {
  text-decoration: underline;
}

.card-header-primary {
  border-bottom: 1px solid var(--border);
}

.card-header-primary h2 {
  font-size: 22px;
  color: var(--text-dark);
  border-bottom: 5px solid #2358c0;
}

.card-header-primary a {
}

/* ==================== Module Title (参考教务处样式) ==================== */
.module-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 16px 16px 0px;
  border-bottom: 1px solid var(--border);
}

.module-title h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-dark);
  border-bottom: 5px solid #2358c0;
}

.module-more {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.module-more:hover {
  text-decoration: underline;
}

/* ==================== Swiper Carousel ==================== */
.yx-rotaion {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 676px;
  aspect-ratio: 594 / 334;
  background: #f0f0f0;
  border-radius: 0px;
}

.yx-rotaion .rotaion_list {
  position: relative;
  width: 100%;
  height: 100%;
}

.yx-rotaion .rotaion_list li {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: none;
}

.yx-rotaion .rotaion_list li.current {
  display: block;
  opacity: 1;
}

.yx-rotaion .rotaion_list li a {
  display: block;
  width: 100%;
  height: 100%;
}

.yx-rotaion .rotaion_list li img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 左右箭头按钮 */
.yx-rotaion-btn {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  pointer-events: none;
  z-index: 10;
}

.yx-rotaion-btn span {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.yx-rotaion-btn span:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.yx-rotaion-btn .left_btn::after,
.yx-rotaion-btn .right_btn::after {
  content: '';
  width: 10px;
  height: 10px;
  border-top: 2px solid #333;
  border-right: 2px solid #333;
}

.yx-rotaion-btn .left_btn::after {
  transform: rotate(-135deg);
  margin-left: 4px;
}

.yx-rotaion-btn .right_btn::after {
  transform: rotate(45deg);
  margin-right: 4px;
}

/* 底部焦点指示器 */
.yx-rotation-focus {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.yx-rotation-focus span {
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.yx-rotation-focus span:hover,
.yx-rotation-focus span.active {
  background: white;
}

/* 图片标题 */
.yx-rotation-t {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
  color: white;
  font-size: 15px;
  text-decoration: none;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  z-index: 5;
}

.yx-rotation-t:hover {
  color: white;
  text-decoration: underline;
}

/* ==================== Announcements ==================== */
.announcement-list {
  padding: 0;
}

.announcement-item {
  padding: 16px;
  border-bottom: 1px dashed var(--border);
  transition: var(--transition);
  cursor: pointer;
}

.announcement-item:last-child {
  border-bottom: none;
}

.announcement-item:hover {
  background: #e1e3e9;
}

.announcement-content {
  display: flex;
  gap: 12px;
}

.announcement-date {
  flex-shrink: 0;
  text-align: center;
  border: 1px solid var(--primary-lighter);
  border-radius: 4px;
  padding: 6px 10px;
  min-width: 64px;
  min-height: 72px;
  transition: var(--transition);
}

.announcement-content:hover .announcement-date {
  border: 2px solid rgb(233, 58, 58);
}

.announcement-date .day {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.announcement-date .month {
  font-size: 14px;
  color: var(--text-gray);
}

.announcement-body {
  flex: 1;
  min-width: 0;
}

.announcement-title {
  font-size: 16px;
  /* font-weight: 700; */
  color: var(--text-dark);
  line-height: 1.5;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 8px;
}

.announcement-desc {
  font-size: 14px;
  color: var(--text-gray);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================== Sections Grid ==================== */
.sections-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 32px;
  min-height: 399px;
}

@media (min-width: 768px) {
  .sections-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .sections-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.section-card .card-header {
  border-bottom: none;
}

/* ==================== 悬浮菜单下拉 ==================== */
.dropdown-header {
  position: relative;
}

.dropdown-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.dropdown-trigger {
  cursor: pointer;
  display: flex;
  align-items: center;
  user-select: none;
  padding: 0;
  border-bottom: 5px solid #2358c0;
}

.dropdown-trigger svg {
  transition: transform 0.25s ease;
}

.dropdown-wrap:hover .dropdown-trigger svg {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 140px;
  background: white;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  padding: 4px 0;
  margin-top: 0;
}

.dropdown-wrap:hover .dropdown-menu {
  display: block;
}

.dropdown-menu li {
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.dropdown-menu li:hover {
  background: var(--bg-gray);
  color: var(--primary);
}

.dropdown-menu li.active {
  color: var(--primary);
  font-weight: 600;
  background: var(--bg-gray);
}

/* ==================== Tab 内容切换 ==================== */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.section-card .section-list {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.section-item {
  padding: 8px 0;
  /* border-bottom: 1px solid var(--border); */
}

.section-item:last-child {
  border-bottom: none;
}

.section-link {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 16px;
  transition: var(--transition);
  border-bottom: 1px dashed transparent;
}

.section-link:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.section-link .dot {
  color: var(--text-light);
  flex-shrink: 0;
  margin-top: 2px;
}

.section-link:hover .dot {
  color: var(--primary);
}

.section-link .content {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.section-link .label {
  color: var(--text-dark);
  font-weight: 500;
  flex-shrink: 0;
}

.section-link:hover .label {
  color: var(--primary);
}

.section-link .meta {
  display: flex;
  align-items: baseline;
  flex-shrink: 0;
}

.section-link .date {
  font-size: 12px;
  color: var(--text-light);
}

/* ==================== Footer ==================== */
.footer {
  background-image: url(../image/foot-bg.png);
  color: white;
  margin-top: 48px;
}

.footer-content {
  padding: 32px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-section h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.footer-section p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.8;
}

.footer-bottom {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
}

.footer-bottom p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

/* ==================== Utility ==================== */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}