/* ============================================================
   CMS 公共样式表
   主色调: #205aa8  辅助色: #58A0CA / #85B4F1
   版心宽度: 1170px
   ============================================================ */

/* ---------- CSS 变量与重置 ---------- */
:root {
  --primary: #205aa8;
  --primary-light: #58A0CA;
  --primary-lighter: #85B4F1;
  --primary-bg: #ecf3fb;
  --text-color: #333;
  --text-light: #666;
  --text-muted: #999;
  --border-color: #e4e4e4;
  --bg-gray: #f8f8f8;
  --bg-white: #fff;
  --container-width: 1170px;
  --header-height: 120px;
  --top-bar-height: 35px;
  --nav-height: 50px;
  --radius: 6px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.12);
  --transition: all 0.3s ease;
}

/* Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-color);
  background: #f5f5f5;
  line-height: 1.6;
}

a {
  color: var(--text-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary);
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- 工具类 ---------- */
.container {
  width: var(--container-width);
  margin: 0 auto;
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }

/* ---------- 顶部栏 ---------- */
.top-bar {
  height: var(--top-bar-height);
  background: #f5f5f5;
  border-bottom: 1px solid #eee;
  font-size: 12px;
  color: var(--text-muted);
  line-height: var(--top-bar-height);
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar__welcome {
  color: #333;
}

.top-bar__actions a {
  margin-left: 15px;
  color: var(--text-muted);
  font-size: 12px;
}

.top-bar__actions a:hover {
  color: var(--primary);
}

/* ---------- 头部 ---------- */
.site-header {
  background: var(--bg-white);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo img {
  height: 50px;
}

.header-logo h1 {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary);
  line-height: 1.3;
}

.header-logo h2 {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: normal;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-block;
  padding: 6px 20px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  line-height: 1.5;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: #1a4a8a;
  color: #fff;
}

/* 搜索框 */
.header-search {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  overflow: hidden;
  height: 34px;
}

.header-search input {
  border: none;
  outline: none;
  padding: 0 12px;
  height: 100%;
  width: 180px;
  font-size: 13px;
}

.header-search button {
  border: none;
  background: var(--primary);
  color: #fff;
  padding: 0 14px;
  height: 100%;
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
}

.header-search button:hover {
  background: #1a4a8a;
}

/* ---------- 主导航 ---------- */
.main-nav {
  background: var(--primary);
  height: var(--nav-height);
}

.main-nav .container {
  display: flex;
  align-items: center;
  height: 100%;
}

.nav-list {
  display: flex;
  height: 100%;
  width: 100%;
}

.nav-item {
  position: relative;
  height: 100%;
}

.nav-item > a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 22px;
  color: #fff;
  font-size: 15px;
  white-space: nowrap;
  transition: var(--transition);
}

.nav-item > a:hover,
.nav-item > a.active {
  background: rgba(255, 255, 255, 0.15);
}

.nav-item .arrow-down {
  margin-left: 4px;
  font-size: 10px;
  transition: transform 0.2s;
}

.nav-item:hover .arrow-down {
  transform: rotate(180deg);
}

/* 二级菜单 */
.sub-nav {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background: var(--bg-white);
  box-shadow: var(--shadow-hover);
  border-radius: 0 0 var(--radius) var(--radius);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: var(--transition);
  z-index: 200;
}

.nav-item:hover .sub-nav {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sub-nav li a {
  display: block;
  padding: 10px 20px;
  color: var(--text-color);
  font-size: 14px;
  border-bottom: 1px solid #f5f5f5;
  transition: var(--transition);
}

.sub-nav li:last-child a {
  border-bottom: none;
}

.sub-nav li a:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

/* ---------- 面包屑 ---------- */
.breadcrumb-bar {
  background: var(--bg-white);
  border-bottom: 1px solid #eee;
  padding: 12px 0;
}

.breadcrumb-bar .container {
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb-bar a {
  color: var(--primary);
}

.breadcrumb-bar .separator {
  margin: 0 8px;
  color: #ccc;
}

/* ---------- 通用区块标题 ---------- */
.section-title {
  text-align: center;
  margin-bottom: 30px;
}

.section-title .title {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 4px;
}

.section-title .subtitle {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.section-title--left {
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title--left .more-link {
  font-size: 13px;
  color: var(--primary);
}

/* ---------- 内容区块 ---------- */
.section {
  padding: 50px 0;
}

.section--gray {
  background: var(--bg-gray);
}

.section--bg {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.section--bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
}

.section--bg > .container {
  position: relative;
  z-index: 1;
}

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 16px;
}

.card-title {
  font-size: 15px;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

.card-more {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--primary);
  padding: 4px 12px;
  border: 1px solid var(--primary);
  border-radius: 3px;
  transition: var(--transition);
}

.card-more:hover {
  background: var(--primary);
  color: #fff;
}

/* ---------- 列表项 ---------- */
.list-item {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid #f0f0f0;
  transition: var(--transition);
}

.list-item:hover {
  background: #fafafa;
}

.list-item__img {
  width: 270px;
  height: 150px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.list-item__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-item__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.list-item__title {
  font-size: 16px;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item__date {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.list-item__desc {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.list-item__more {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--primary);
}

.list-item__more:hover {
  color: #1a4a8a;
}

/* ---------- 分页 ---------- */
.pagination-wrap {
  text-align: center;
  padding: 30px 0;
}

/* ---------- 页脚 - 联系我们 ---------- */
.footer-contact {
  background: #2c3e50;
  padding: 50px 0;
  color: #ccc;
}

.footer-contact .container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-contact__info h3 {
  color: #fff;
  font-size: 18px;
  margin-bottom: 15px;
}

.footer-contact__info p {
  font-size: 14px;
  line-height: 2;
  color: #bbb;
}

.footer-contact__map {
  width: 40%;
  height: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #444;
}

.footer-contact__map img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- 页脚 - 版权 ---------- */
.site-footer {
  background: #1a252f;
  padding: 15px 0;
  text-align: center;
  font-size: 12px;
  color: #888;
}

.site-footer a {
  color: #aaa;
  margin-left: 10px;
}

.site-footer a:hover {
  color: #fff;
}

/* ---------- 侧边浮动工具栏 ---------- */
.float-sidebar {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.float-sidebar__item {
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition);
}

.float-sidebar__item:first-child {
  border-radius: var(--radius) 0 0 0;
}

.float-sidebar__item:last-child {
  border-radius: 0 0 0 var(--radius);
}

.float-sidebar__item:hover {
  background: #1a4a8a;
}

.float-sidebar__item img {
  width: 30px;
  height: 30px;
  margin-bottom: 2px;
}

/* ---------- 单页内容 ---------- */
.page-content {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  min-height: 400px;
}

.page-content h2 {
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--primary-bg);
}

.page-content h3 {
  font-size: 18px;
  color: var(--text-color);
  margin: 25px 0 15px;
}

.page-content p {
  font-size: 14px;
  line-height: 2;
  color: var(--text-color);
  margin-bottom: 10px;
}

.page-content ul,
.page-content ol {
  padding-left: 25px;
  margin-bottom: 15px;
}

.page-content li {
  line-height: 2;
  list-style: disc;
}

.page-content ol li {
  list-style: decimal;
}

.page-content img {
  max-width: 100%;
  margin: 20px auto;
  border-radius: var(--radius);
}

/* ---------- 分类页面布局 ---------- */
.category-layout {
  display: flex;
  gap: 20px;
}

.category-sidebar {
  width: 230px;
  flex-shrink: 0;
}

.category-sidebar__title {
  height: 55px;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius) var(--radius) 0 0;
}

.category-sidebar__menu {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}

.category-sidebar__menu li {
  border-bottom: 1px solid #f0f0f0;
}

.category-sidebar__menu li:last-child {
  border-bottom: none;
}

.category-sidebar__menu li a {
  display: block;
  padding: 14px 20px;
  font-size: 14px;
  color: var(--text-color);
  transition: var(--transition);
}

.category-sidebar__menu li a:hover,
.category-sidebar__menu li a.active {
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: bold;
}

.category-main {
  flex: 1;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.category-main__header {
  background: var(--primary-bg);
  padding: 14px 20px;
  font-size: 16px;
  font-weight: bold;
  color: var(--primary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-main__list {
  padding: 0 20px;
}

.category-main__list .item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #f5f5f5;
  transition: var(--transition);
}

.category-main__list .item:hover {
  background: #fafafa;
  padding-left: 10px;
}

.category-main__list .item:last-child {
  border-bottom: none;
}

.category-main__list .item-title {
  font-size: 14px;
  color: var(--text-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

.category-main__list .item-title:hover {
  color: var(--primary);
}

.category-main__list .item-date {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- 首页特有样式 ---------- */

/* 申请入口 */
.apply-entries {
  display: flex;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.apply-entry {
  flex: 1;
  padding: 30px 15px;
  text-align: center;
  background: var(--primary);
  color: #fff;
  transition: var(--transition);
  cursor: pointer;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.apply-entry:last-child {
  border-right: none;
}

.apply-entry:nth-child(even) {
  background: var(--primary-light);
}

.apply-entry:hover {
  background: #1a4a8a;
}

.apply-entry__icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.apply-entry__title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 4px;
}

.apply-entry__subtitle {
  font-size: 12px;
  opacity: 0.8;
}

/* 课程卡片 */
.course-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.course-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
}

.course-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.course-card__img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.course-card__body {
  padding: 16px;
}

.course-card__title {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-card__info {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.8;
}

.course-card__price {
  font-size: 16px;
  color: #e74c3c;
  font-weight: bold;
  margin-top: 8px;
}

.course-card__btn {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 16px;
  background: var(--primary);
  color: #fff;
  border-radius: 3px;
  font-size: 13px;
  transition: var(--transition);
}

.course-card__btn:hover {
  background: #1a4a8a;
  color: #fff;
}

/* 人员展示 */
.user-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
}

.user-grid .user-card--main {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.user-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.user-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(32, 90, 168, 0.75);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.user-card:hover .user-card__overlay {
  opacity: 1;
}

.user-card__overlay .id {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 6px;
}

.user-card__overlay .name {
  font-size: 14px;
}

.user-card__overlay .role {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 2px;
}

/* 机构卡片 */
.inst-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.inst-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  padding: 20px;
  text-align: center;
}

.inst-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.inst-card__logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
  border: 3px solid #f0f0f0;
}

.inst-card__name {
  font-size: 15px;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inst-card__desc {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 关于我们 */
.about-section {
  display: flex;
  gap: 30px;
  align-items: center;
}

.about-section__text {
  flex: 1;
}

.about-section__text .title {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 4px;
}

.about-section__text .subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.about-section__text p {
  font-size: 14px;
  line-height: 2;
  color: var(--text-color);
  margin-bottom: 15px;
}

.about-section__text .more-link {
  display: inline-block;
  padding: 8px 24px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 14px;
  transition: var(--transition);
}

.about-section__text .more-link:hover {
  background: #1a4a8a;
  color: #fff;
}

.about-section__img {
  width: 400px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.about-section__img img {
  width: 100%;
  height: 280px;
  object-fit: cover;
}

/* 友情链接 */
.links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.link-item {
  text-align: center;
  padding: 15px;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
  width: 200px;
}

.link-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.link-item img {
  height: 50px;
  margin: 0 auto 8px;
  object-fit: contain;
}

.link-item__name {
  font-size: 12px;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  :root {
    --container-width: 960px;
  }

  .course-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .inst-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .user-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .user-grid .user-card--main {
    grid-column: 1;
    grid-row: auto;
  }

  .about-section {
    flex-direction: column;
  }

  .about-section__img {
    width: 100%;
  }
}
