/* ===== 全局公共样式 ===== */

/* ===== CSS变量：主题色、通用间距、边框样式 ===== */
:root {
  /* 主题色 */
  --primary-red: #b4201a;
  --primary-red-light: #d43b35;
  --primary-red-dark: #8e1a15;
  --red-bg-light: #fef6f6;

  /* 文字颜色 */
  --text-dark: #333333;
  --text-gray: #666666;
  --text-light-gray: #999999;
  --text-white: #ffffff;

  /* 边框颜色 */
  --border-gray: #e5e5e5;
  --border-light: #f0f0f0;
  --border-dashed: #dddddd;

  /* 背景色 */
  --bg-gray: #f5f5f5;
  --bg-light-gray: #fafafa;
  --bg-white: #ffffff;

  /* 通用间距 */
  --spacing-xs: 5px;
  --spacing-sm: 10px;
  --spacing-md: 15px;
  --spacing-lg: 20px;
  --spacing-xl: 30px;

  /* 容器宽度 */
  --max-width: 1200px;

  /* 字体 */
  --font-size-xs: 14px;
  --font-size-sm: 15px;
  --font-size-base: 16px;
  --font-size-md: 17px;
  --font-size-lg: 18px;
  --font-size-xl: 24px;
  --font-size-xxl: 42px;
}

/* ===== 全局重置 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  font-size: var(--font-size-base);
  color: var(--text-dark);
  line-height: 1.6;
  background: var(--bg-white);
}

a {
  text-decoration: none;
  color: var(--text-dark);
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-red);
}

ul,
ol {
  list-style: none;
}

img {
  border: none;
  vertical-align: middle;
  max-width: 100%;
}

input,
button,
select {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

/* ===== 居中容器 ===== */
.site-container {
  width: var(--max-width);
  margin: 0 auto;
  max-width: 100%;
}

/* ===== 页面主体包装器（根据屏幕宽度自适应） ===== */
.page-wrapper {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
}

/* ===== page-wrapper内的容器取消固定宽度，继承wrapper宽度 ===== */
.page-wrapper .site-container {
  width: 100%;
  max-width: none;
}

/* ===== 顶部信息栏 ===== */
.top-bar {
  height: 36px;
  line-height: 36px;
  font-size: var(--font-size-sm);
  /* color: var(--text-gray); */
  color: #A71818;
  border-bottom: 1px solid var(--border-light);
  /* background: var(--bg-white); */
  background: rgba(245, 245, 245, 0.6);
  flex-shrink: 0; /* 禁止压缩高度 */
}

.top-bar .site-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar-left a{
  color: #A71818;
}

.top-bar-right {
  display: flex;
  align-items: center;
}

.top-bar-right a,
.top-bar-right span {
  margin-left: 8px;
  color: #A71818;
}

.divider {
  color: #dddddd;
}

/* ===== 头部Logo区域 ===== */
.header {
  background: url(../images/header_bg.png);
  /* 核心：宽高100%拉伸填满容器 */
  background-size: 100% 100%;
  /* background-size: cover; */
  background-position: center;
  background-repeat: no-repeat;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  overflow: hidden;
}

.header .site-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-grow: 1;
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.logo-title-img {
  width: 100%;
  max-width: 500px;
  height: auto;
}

.logo-img {
  width: 70px;
  height: 70px;
}

.logo-text h1 {
  font-size: var(--font-size-xxl);
  color: var(--primary-red);
  font-weight: bold;
  letter-spacing: 2px;
}

.logo-text p {
  font-size: var(--font-size-lg);
  color: var(--primary-red);
  letter-spacing: 1px;
}

/* ===== 搜索框 ===== */
.search-box {
  display: flex;
  border: 1px solid #cccccc;
  border-radius: 3px;
  overflow: hidden;
}

.search-box input {
  height: 34px;
  border: none;
  padding: 0 12px;
  font-size: var(--font-size-sm);
  min-width: 0;
  /* flex: 1 1 0; */
}

.search-box button {
  width: 35px;
  height: 34px;
  border: none;
  background: var(--primary-red);
  color: var(--text-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-box button:hover {
  background: var(--primary-red-dark);
}

/* ===== 主导航栏 ===== */
.main-nav {
  background: var(--primary-red);
  /* margin-top: 10px; */
}

.main-nav .site-container {
  display: flex;
  flex-wrap: wrap;
}

/* ===== 导航菜单（支持二级下拉） ===== */
.nav-menu {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.nav-item {
  position: relative;
  flex: 1 1 120px;
  min-width: max-content;
}

.nav-item > a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  font-size: var(--font-size-md);
  height: 48px;
  padding: 0 var(--spacing-sm);
  transition: background 0.2s;
  cursor: pointer;
  text-decoration: none;
}

.nav-item > a:hover,
.nav-item.active > a {
  background: rgba(0, 0, 0, 0.2);
}

/* ===== 二级下拉菜单 ===== */
.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  width: auto;
  min-width: 100%;
  white-space: nowrap;
  background: #fff;
  border: 1px solid #eee;
  border-top: 2px solid var(--primary-red);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  list-style: none;
  margin: 0;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: all 0.25s ease;
  z-index: 1000;
}

.nav-item.active .submenu,
.nav-item.has-submenu:hover .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.submenu li {
  display: block;
}

.submenu a {
  display: block;
  padding: 10px 20px;
  color: var(--text-dark);
  font-size: var(--font-size-base);
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.submenu a:hover {
  background: #f5f5f5;
  color: var(--primary-red);
  padding-left: 24px;
}

/* 桌面端：末级导航项（如「交流互动」）右对齐展开，避免长标题超出视口右侧 */
.nav-menu > .nav-item.has-submenu:last-child .submenu {
  left: auto;
  right: 0;
}

/* ===== 有二级菜单的项标记 ===== */
.has-submenu > a::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  transition: transform 0.2s;
}

.has-submenu.active > a::after,
.has-submenu:hover > a::after {
  transform: rotate(180deg);
}

/* ===== 无二级菜单的项 ===== */
.no-submenu > a::after {
  display: none;
}

/* ===== 面包屑 ===== */
.breadcrumb {
  font-size: var(--font-size-base);
  color: var(--text-gray);
  padding: var(--spacing-md) 0;
}

.breadcrumb .site-container {
  display: flex;
  align-items: center;
}

.breadcrumb .site-container img{
  width: 24px;
  height: 24px;
  margin-right: 8px;
}

.breadcrumb a {
  color: var(--text-gray);
}

.breadcrumb a:hover {
  color: var(--primary-red);
}

.sep {
  margin: 0 6px;
  color: #cccccc;
}

/* ===== 栏目标题通用（带红色菱形+虚线装饰） ===== */
.section-title {
  text-align: center;
  margin-bottom: var(--spacing-lg);
  position: relative;
}

.section-title h3 {
  font-size: var(--font-size-xl);
  color: var(--text-dark);
  font-weight: normal;
  display: inline-block;
  padding: 0 var(--spacing-lg);
  position: relative;
}

.section-title h3::before,
.section-title h3::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 60px;
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    var(--primary-red) 0,
    var(--primary-red) 4px,
    transparent 4px,
    transparent 8px
  );
}

.section-title h3::before {
  right: 100%;
}

.section-title h3::after {
  left: 100%;
}

.title-icon {
  color: var(--primary-red);
  margin-right: 8px;
  font-size: 12px;
}

/* ===== 新闻列表通用 ===== */
.news-list li {
  display: flex;
  align-items: center;
  padding: 9px 0;
}

.news-list li:last-child {
  border-bottom: none;
}

.news-list li a {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--font-size-base);
}

.news-list li .date {
  color: var(--text-light-gray);
  font-size: var(--font-size-sm);
  flex-shrink: 0;
  margin-left: var(--spacing-sm);
}

/* ===== 左侧带Tab的栏目标题 ===== */
.tab-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--primary-red);
  padding-bottom: 8px;
  margin-bottom: var(--spacing-md);
}

.tab-title h3 {
  font-size: var(--font-size-lg);
  color: var(--primary-red);
  font-weight: bold;
}

.tab-title .more {
  font-size: var(--font-size-sm);
  color: var(--text-gray);
}

.tab-title .more:hover {
  color: var(--primary-red);
}

/* ===== 分页通用 ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--spacing-xl) 0;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: 4px 10px;
  border: 1px solid #dddddd;
  font-size: var(--font-size-sm);
  color: var(--text-gray);
  min-width: 28px;
  text-align: center;
}

.pagination a:hover {
  border-color: var(--primary-red);
  color: var(--primary-red);
}

.pagination .current {
  background: var(--primary-red);
  color: var(--text-white);
  border-color: var(--primary-red);
}

.pagination .page-info {
  border: none;
  margin-left: var(--spacing-sm);
  color: var(--text-gray);
}

.pagination .page-jump {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: var(--spacing-md);
  border: none;
  padding: 0;
}

.pagination .page-jump input {
  width: 40px;
  height: 26px;
  border: 1px solid #dddddd;
  text-align: center;
  font-size: var(--font-size-sm);
}

.pagination .page-jump button {
  padding: 3px 8px;
  border: 1px solid #dddddd;
  background: var(--bg-white);
  cursor: pointer;
  font-size: var(--font-size-sm);
  /* 后续自行补充跳转交互逻辑 */
}

.pagination .page-jump button:hover {
  border-color: var(--primary-red);
  color: var(--primary-red);
}

/* ===== 红色主题横幅 ===== */
.red-banner,
.theme-banner,
.party-banner {
  background: var(--primary-red);
  padding: 14px 0;
  margin: var(--spacing-lg) 0;
  /* 可根据原型微调横幅高度 */
}

.red-banner h2,
.theme-banner h2,
.party-banner h2 {
  font-size: 22px;
  color: var(--text-white);
  text-align: center;
  font-weight: normal;
  letter-spacing: 3px;
}

.party-banner h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
}

/* ===== 虚线分割线 ===== */
.dashed-divider {
  border: none;
  border-top: 1px dashed var(--border-dashed);
  margin: var(--spacing-lg) 0;
}

/* ===== 友情链接 ===== */
.friend-links {
  padding: var(--spacing-lg) 0;
  border-top: 1px solid var(--border-gray);
  background: var(--bg-white);
}

.friend-links .site-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.friend-links .label {
  font-size: var(--font-size-base);
  color: var(--primary-red);
  font-weight: bold;
  flex-shrink: 0;
}

.link-selects {
  display: flex;
  flex: 1;
  gap: var(--spacing-md);
}

.link-selects select {
  flex: 1;
  height: 32px;
  border: 1px solid #dddddd;
  padding: 0 10px;
  font-size: var(--font-size-sm);
  color: var(--text-gray);
  background: var(--bg-white);
  cursor: pointer;
}

/* ===== 页脚 ===== */
.footer {
  /* background: var(--bg-gray); */
  /* padding: var(--spacing-xl) 0; */
  /* border-top: 2px solid var(--primary-red); */
}
.footer .divider {
  height: 2px; /* 设置分割线的高度 */
  background-color: var(--primary-red); /* 设置分割线的颜色 */
}
.footer .site-container {
  /* Bootstrap row handles layout, no custom flex needed */
}

.footer-logo {
  text-align: center;
}

.footer-logo img {
  width: 80px;
  height: 80px;
}

.footer-info {
  font-size: var(--font-size-sm);
  /* color: var(--text-gray); */
  color: var(--text-dark);
  line-height: 2;
}

.footer-qrcodes {
  display: flex;
  gap: var(--spacing-md);
}

.qr-item {
  text-align: center;
}

.qr-item img {
  width: 70px;
  height: 70px;
  margin-bottom: 5px;
}

.qr-item p {
  font-size: var(--font-size-sm);
  color: var(--text-gray);
}

/* ===== 响应式：视觉微调（布局由 Bootstrap Grid 自动处理） ===== */
@media (max-width: 991px) {
  .page-wrapper .site-container {
    padding-left: 0;
    padding-right: 0;
  }

  .section-title h3::before,
  .section-title h3::after {
    width: 40px;
  }

  .red-banner h2,
  .theme-banner h2,
  .party-banner h2 {
    font-size: var(--font-size-xl);
    letter-spacing: 2px;
  }
}

@media (max-width: 768px) {
  .search-box {
    /* display: none; */
  }

  .friend-links .site-container {
    flex-direction: column;
    gap: 10px;
  }

  .link-selects {
    flex-direction: column;
    width: 100%;
  }

  .footer-qrcodes {
    justify-content: center;
    flex-wrap: wrap;
  }

  /* 子菜单宽度按当前内容字数自适应：正常小框贴合字数；极长时通栏、仍超则换行。
     关键：定位上下文换回整条 .main-nav（left:0 = 页面左缘），max-width:100%（=页面宽，非 100vw 以避开滚动条宽度），
     故任意位置、任意长度都不会超出视口、不留半屏空白。 */
  .main-nav {
    position: relative;
  }
  .nav-item.has-submenu {
    position: static;
  }
  .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    width: max-content;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  .submenu a {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  .nav-menu > .nav-item.has-submenu:last-child .submenu {
    left: 0;
    right: auto;
  }
}

@media (max-width: 660px) {
  .header {
    min-height: 200px;
  }

  .top-bar {
    display: none;
  }

  .search-box {
    display: none;
  }

  .page-wrapper {
    width: 100%;
    padding: 0 10px;
  }

  .footer-info {
    text-align: center;
  }

  .footer-logo {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .header {
    padding: var(--spacing-sm) 0;
  }

  .logo-area {
    gap: var(--spacing-sm);
  }

  .section-title h3 {
    font-size: var(--font-size-lg);
    padding: 0 var(--spacing-md);
  }

  .section-title h3::before,
  .section-title h3::after {
    width: 24px;
  }

  .news-list li {
    padding: 7px 0;
  }

  .news-list li a {
    min-width: 0;
    font-size: var(--font-size-sm);
  }

  .news-list li .date {
    margin-left: var(--spacing-xs);
    font-size: var(--font-size-xs);
  }

  .pagination a,
  .pagination span {
    padding: 4px 8px;
  }

  .pagination .page-info,
  .pagination .page-jump {
    flex-basis: 100%;
    justify-content: center;
    margin-left: 0;
    margin-top: 6px;
  }

  .red-banner h2,
  .theme-banner h2,
  .party-banner h2 {
    font-size: var(--font-size-lg);
    letter-spacing: 1px;
  }

  .footer-qrcodes img,
  .qr-item img {
    width: 55px;
    height: 55px;
  }
}

.float-notice {
  position: fixed;
  left: 20px;
  bottom: 24px;
  width: 300px;
  padding: 16px 18px 14px;
  /* background: linear-gradient(135deg, #f7c98c 0%, #e3a95e 100%); */
  background: linear-gradient(180deg, #FFE8B0 0%, #FFD888 100%);
  /* background: linear-gradient(180deg, #FFDD99 0%, #F8C268 100%); */
  /* color: #8a0d10; */
  color: #994400;
  /* color: #882211; */
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  z-index: 999;
  font-size: 14px;
  line-height: 1.7;
}

.float-notice-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 26px;
  height: 26px;
  padding: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: #8a0d10;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.float-notice-close:hover {
  color: #6a0709;
  background: rgba(138, 13, 16, 0.12);
}

.float-notice-title {
  font-size: 18px;
  font-weight: bold;
  line-height: 1.4;
  text-align: center;
  margin: 0 22px 10px 0;
}

.float-notice-body {
  font-size: 14px;
  line-height: 1.7;
}

.float-notice-contact {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(138, 13, 16, 0.25);
}

.float-notice-contact p {
  margin: 3px 0;
}

.float-notice-footer {
  margin-top: 10px;
  text-align: right;
  font-size: 13px;
  line-height: 1.6;
  opacity: 0.92;
}

.float-notice-footer p {
  margin: 0;
}

/* 窄屏隐藏：视口 < 992px 不显示浮窗，992px 及以上显示（与 Bootstrap lg 断点一致）。
   注：992px~1500px 区间浮窗会与主体内容有少量重叠，如需完全不遮挡可改回 1499.98px。 */
@media (max-width: 991.98px) {
  .float-notice {
    display: none;
  }
}
