/* =====================================================
   昆山市乒乓球协会 - 主题样式
   配套 Bootstrap 5.3.3 使用
   ===================================================== */

/* ---------- 主题变量 ---------- */
:root {
  --kstta-primary: #c8102e;        /* 协会红 */
  --kstta-primary-dark: #8e0b20;   /* 深红 */
  --kstta-gold: #f5b301;           /* 金色（logo徽章） */
  --kstta-orange: #ff9f1c;         /* 乒乓球橘：导航选中/悬停强调色 */
  --kstta-dark: #1f2430;           /* 深灰蓝 */
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: #333;
}

a { text-decoration: none; }
a:hover { text-decoration: none; }

/* ---------- 顶部信息条 ---------- */
.topbar {
  background: var(--kstta-dark);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8125rem;
}
.topbar a { color: rgba(255, 255, 255, 0.85); }
.topbar a:hover { color: var(--kstta-gold); }

/* ---------- 导航 ---------- */
.navbar-kstta {
  background: var(--kstta-primary);
}
.navbar-kstta .nav-link {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.0625rem;
  padding: 1rem 1.25rem;
}
/* 橘黄圆角下划线：悬停/选中时从中间展开（桌面端） */
.navbar-kstta .nav-link {
  position: relative;
}
.navbar-kstta .nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.55rem;
  transform: translateX(-50%);
  width: 0;
  height: 4px;
  border-radius: 4px;
  background: var(--kstta-orange);
  transition: width 0.25s ease;
}
.navbar-kstta .nav-link:hover,
.navbar-kstta .nav-link.active {
  color: #fff;
}
.navbar-kstta .nav-link:hover::after,
.navbar-kstta .nav-link.active::after {
  width: 55%;
}
/* 移动端：下划线挂在文字 span 上，宽度自动匹配文字长度 */
@media (max-width: 991.98px) {
  .navbar-kstta .nav-link::after {
    display: none;
  }
  .navbar-kstta .nav-link span {
    display: inline-block;
  }
  .navbar-kstta .nav-link span::after {
    content: "";
    display: block;
    width: 0;
    height: 3px;
    border-radius: 3px;
    background: var(--kstta-orange);
    margin-top: 0.2rem;
    transition: width 0.25s ease;
  }
  .navbar-kstta .nav-link:hover span::after,
  .navbar-kstta .nav-link.active span::after {
    width: 100%;
  }
}
.brand-badge {
  width: 55px;
  height: 55px;
  border-radius: 10px;
  background: var(--kstta-gold);
  color: var(--kstta-primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex: none;
}
.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ---------- 轮播 ---------- */
.carousel-caption {
  background: rgba(31, 36, 48, 0.55);
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  bottom: 1.25rem;
}
.carousel-caption h5 {
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.carousel-caption p {
  font-size: 0.875rem;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 首页轮播与右侧公告栏等高（仅桌面端，右侧栏撑高） */
@media (min-width: 992px) {
  .carousel-fill,
  .carousel-fill .carousel-inner,
  .carousel-fill .carousel-item {
    height: 100%;
  }
  .carousel-fill .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}
/* 移动端：固定宽高比显示，避免高度塌陷不显示 */
@media (max-width: 991.98px) {
  .carousel-fill .carousel-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 12 / 5;
    object-fit: cover;
  }
}

/* ---------- 栏目标题 ---------- */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-left: 4px solid var(--kstta-primary);
  padding-left: 0.75rem;
  margin-bottom: 1.5rem;
}
.section-title h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 0;
}
.section-title .more {
  font-size: 0.875rem;
  color: #999;
}
.section-title .more:hover { color: var(--kstta-primary); }

/* ---------- 卡片 ---------- */
.card-kstta {
  border: 1px solid #eee;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card-kstta:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}
.card-kstta .card-title {
  color: var(--kstta-dark);
  font-weight: 700;
}
.card-kstta .card-title:hover { color: var(--kstta-primary); }
.img-cover {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
/* 赛事动态：图片随卡片行高拉伸，使左侧与右侧栏等高 */
.event-img {
  flex: 1 1 180px;
  height: auto;
  min-height: 160px;
}

/* ---------- 成员头像 ---------- */
.avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  flex: none;
}
.member-card {
  text-align: center;
  padding: 1.5rem 1rem;
}
.member-card .member-name { font-weight: 700; font-size: 1.0625rem; margin-top: 0.75rem; }
.member-card .member-role { font-size: 0.8125rem; color: #999; }

/* 球员风采：证件照竖版卡片（3:4 比例） */
.player-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;   /* 人像对齐顶部，避免裁掉头 */
}
.player-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(135deg, #c8102e, #8e0b20);
}
.member-role { font-size: 0.75rem; }

/* ---------- 俱乐部/场馆卡片 ---------- */
.club-badge {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex: none;
}
.meta-line { font-size: 0.875rem; color: #6c757d; margin-bottom: 0.25rem; }
.meta-line i { color: var(--kstta-primary); }

/* 场馆列表：上图下文卡片 */
.venue-card .img-cover {
  height: 200px;
  width: 100%;
  transition: transform 0.35s ease;
}
.venue-card:hover .img-cover {
  transform: scale(1.06);
}
.venue-card .card-title {
  font-weight: 700;
  font-size: 1.0625rem;
}
.venue-card .card-body {
  border-top: 1px solid #eee;
}

/* ---------- 新闻列表 / 侧栏 ---------- */
/* 协会公告：标题单行截断 + 日期固定右侧 */
.notice-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.notice-list li {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.6rem 0;
  border-bottom: 1px dashed #e9e9e9;
}
.notice-list li:last-child { border-bottom: none; }
.notice-list li > i {
  color: var(--kstta-primary);
  font-size: 0.875rem;
  flex: none;
}
.notice-list li a {
  color: #444;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notice-list li a:hover { color: var(--kstta-primary); }
.notice-list li time {
  flex: none;
  margin-left: auto;
  font-size: 0.75rem;
  color: #999;
}

.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.news-list li {
  padding: 0.65rem 0;
  border-bottom: 1px dashed #e5e5e5;
  position: relative;
  padding-left: 1.1rem;
}
.news-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.15rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--kstta-primary);
}
.news-list li a {
  color: #444;
}
.news-list li a:hover { color: var(--kstta-primary); }
.news-list li time {
  float: right;
  font-size: 0.8125rem;
  color: #999;
}

.side-box {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 1.25rem;
}
.side-box h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  border-left: 4px solid var(--kstta-primary);
  padding-left: 0.6rem;
  margin-bottom: 1rem;
}
.side-box h3 i { color: var(--kstta-primary); }

/* ---------- 栏目横幅 ---------- */
.page-banner {
  background: linear-gradient(135deg, var(--kstta-primary), var(--kstta-primary-dark));
  color: #fff;
  padding: 2.5rem 0;
}
.page-banner h1 {
  font-size: 1.75rem;
  font-weight: 700;
}
.page-banner .breadcrumb {
  --bs-breadcrumb-divider-color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}
.page-banner .breadcrumb-item a { color: rgba(255, 255, 255, 0.8); }
.page-banner .breadcrumb-item.active { color: #fff; }

/* 面包屑：跳来跳去的乒乓球 */
.pp-track {
  position: relative;
  min-width: 72px;
}
.pp-ball {
  position: absolute;
  top: 4px;
  left: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--kstta-orange);
  box-shadow: inset -2px -2px 3px rgba(139, 69, 0, 0.25);
  animation: pp-x 7s linear infinite, pp-bounce 0.45s ease-in-out infinite alternate;
}
@keyframes pp-x {
  0%   { left: 0; }
  50%  { left: calc(100% - 11px); }
  100% { left: 0; }
}
@keyframes pp-bounce {
  from { top: 4px; }
  to   { top: 16px; }
}
/* 减少动态效果偏好时停用动画 */
@media (prefers-reduced-motion: reduce) {
  .pp-ball { animation: none; }
}

/* ---------- 正文样式 ---------- */
.article-body {
  line-height: 1.9;
  color: #333;
}
.article-body h2, .article-body h3 {
  font-weight: 700;
  border-left: 4px solid var(--kstta-primary);
  padding-left: 0.6rem;
  margin: 1.5rem 0 1rem;
}
.article-body img {
  max-width: 100%;
  border-radius: 6px;
}
.article-body table {
  max-width: 100%;
}

/* ---------- 分页（红色主题，当前页白字红底） ---------- */
.pagination .page-link {
  color: var(--kstta-primary);
  border-radius: 6px;
  margin: 0 0.2rem;
}
.pagination .page-item.active .page-link {
  background: var(--kstta-primary);
  border-color: var(--kstta-primary);
  color: #fff !important;   /* 当前页文字强制白色，避免红字红底看不清 */
}
.pagination .page-link:hover {
  color: var(--kstta-primary-dark);
  background: #fdeaea;
}
.pagination .page-item.disabled .page-link {
  color: #999;
}

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--kstta-dark);
  color: rgba(255, 255, 255, 0.75);
}
.site-footer h5 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 1rem;
}
.site-footer a { color: rgba(255, 255, 255, 0.75); }
.site-footer a:hover { color: var(--kstta-gold); }
.site-footer .bi { color: var(--kstta-gold); }
.footer-bottom {
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8125rem;
}

/* ---------- 回到顶部 ---------- */
.back-top {
  position: fixed;
  right: 1.5rem;
  bottom: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--kstta-primary);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(200, 16, 46, 0.4);
  z-index: 1050;
}
.back-top:hover { background: var(--kstta-primary-dark); color: #fff; }
