/* 宁夏法学会门户网站 - 参照官网版式 */
:root {
  --primary-blue: #1565b0;
  --primary-blue-dark: #0d4d8c;
  --dark-blue: #003366;
  --nav-blue: #1565b0;
  --accent-red: #c00000;
  --sky-blue: #87ceeb;
  --sky-blue-light: #b8dff5;
  --sky-blue-bg: #e8f4fc;
  --light-blue: #f0f7fc;
  --border-blue: #c5ddf0;
  --text-dark: #333333;
  --text-gray: #666666;
  --text-light: #999999;
  --white: #ffffff;
  --footer-bg: #003366;
  --page-bg: #f0f0f0;
  --radius: 3px;
  --container-max: 1100px;
  --transition: 0.2s ease;
  --section-spacing: 22px;
  --column-gap: 18px;
  --grid-columns-3: repeat(3, minmax(0, 1fr));
  --grid-columns-hero: minmax(0, 1.12fr) minmax(0, 1.12fr) minmax(0, 0.76fr);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: "Microsoft YaHei", "SimHei", "PingFang SC", sans-serif;
  font-size: 14px;
  color: var(--text-dark);
  background: var(--page-bg);
  line-height: 1.6;
  min-height: 100vh;
}

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

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

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== Header ===== */
.site-header {
  background: url('/assets/header-bg.jpg') center/cover no-repeat;
  position: relative;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(13, 77, 140, 0.38) 0%,
    rgba(21, 101, 176, 0.18) 45%,
    rgba(13, 77, 140, 0.22) 100%
  );
}

.header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 110px;
  padding: 16px 0;
  gap: 20px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.logo-area .logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
}

.logo-area .logo-link:hover {
  color: inherit;
}

.logo-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-emblem {
  display: none;
}

.logo-text h1 {
  font-size: 28px;
  color: var(--white);
  font-weight: 800;
  letter-spacing: 3px;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.logo-text p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 1px;
  margin-top: 2px;
}

.header-slogan-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
}

.header-slogan {
  color: var(--accent-red);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 4px;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9);
  text-align: center;
}

.header-slogan em {
  font-style: normal;
}

.search-box {
  position: absolute;
  top: 10px;
  right: 16px;
  display: flex;
  align-items: stretch;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.search-box input {
  width: 160px;
  padding: 6px 10px;
  border: 1px solid var(--border-blue);
  border-right: none;
  font-size: 12px;
  outline: none;
  background: var(--white);
}

.search-box input:focus {
  border-color: var(--primary-blue);
}

.search-box button {
  padding: 6px 14px;
  background: var(--primary-blue);
  color: var(--white);
  border: none;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

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

/* ===== 导航栏：首页独立列 + 其余两行 ===== */
.nav-wrapper {
  background: var(--nav-blue);
  position: sticky;
  top: 0;
  z-index: 900;
  margin-bottom: 8px;
}

.nav-inner {
  display: flex;
  align-items: stretch;
  min-height: 72px;
}

.nav-home-col {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-home {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 2px;
  transition: background var(--transition);
}

.nav-home:hover,
.nav-home.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
}

.nav-links-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nav-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  list-style: none;
  align-items: center;
  flex: 1;
}

.nav-row-1 {
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.nav-list li a {
  display: block;
  padding: 10px 8px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  text-align: center;
  transition: background var(--transition);
}

.nav-list li a:hover,
.nav-list li a.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
}

/* ===== 红色横幅（略宽于内容区，完整展示图片文字） ===== */
.red-banner-wrap {
  max-width: 1200px;
  margin: 0 auto var(--section-spacing);
  padding: 0 8px;
}

.red-banner {
  line-height: 0;
}

.red-banner img {
  display: block;
  width: 100%;
  height: auto;
}

/* ===== 浮动课题申报 ===== */
.topic-float-btn {
  position: fixed;
  right: 0;
  top: 340px;
  z-index: 850;
  background: var(--nav-blue);
  color: var(--white);
  border: none;
  border-radius: 4px 0 0 4px;
  padding: 12px 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.15);
  transition: background var(--transition);
  writing-mode: vertical-rl;
  text-orientation: upright;
}

.topic-float-btn:hover {
  background: var(--primary-blue-dark);
}

/* ===== 主内容 ===== */
.main-content {
  padding: var(--section-spacing) 0 30px;
}

.main-content > .page-container {
  margin-top: 0;
}

.page-container {
  background: var(--white);
  padding: var(--section-spacing) 16px 24px;
  display: flex;
  flex-direction: column;
  gap: var(--section-spacing);
}

/* ===== Hero 三栏 ===== */
.hero-section {
  display: grid;
  grid-template-columns: var(--grid-columns-hero);
  gap: var(--column-gap);
  align-items: stretch;
}

.content-row {
  display: grid;
  grid-template-columns: var(--grid-columns-3);
  gap: var(--column-gap);
  align-items: stretch;
}

.hero-section > *,
.content-row > *,
.special-grid > * {
  min-width: 0;
}

/* 轮播 */
.carousel {
  position: relative;
  overflow: hidden;
  min-height: 280px;
  height: 100%;
  border: 1px solid #e0e0e0;
}

.carousel-inner {
  display: flex;
  transition: transform 0.5s ease;
  height: 100%;
}

.carousel-item {
  min-width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.55);
  color: var(--white);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.carousel-tag {
  display: none;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  color: var(--white);
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition: opacity var(--transition);
}

.carousel:hover .carousel-arrow {
  opacity: 1;
}

.carousel-arrow.prev { left: 6px; }
.carousel-arrow.next { right: 6px; }

.carousel-dots {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.carousel-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.carousel-dots span.active {
  background: var(--white);
}

/* 面板通用 */
.panel {
  border: 1px solid #e5e5e5;
  padding: 12px 14px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #dcdcdc;
  padding-bottom: 8px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.section-header h3 {
  font-size: 16px;
  color: var(--text-dark);
  font-weight: 700;
}

.section-header h3::before {
  display: none;
}

.section-header .more {
  font-size: 12px;
  color: var(--text-light);
}

.section-header .more:hover {
  color: var(--primary-blue);
}

.news-list {
  list-style: none;
  flex: 1;
}

.news-list li {
  padding: 6px 0;
  border-bottom: 1px dashed #eee;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.news-list li::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--primary-blue);
  border-radius: 50%;
  flex-shrink: 0;
}

.news-list li a {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.5;
}

.news-list li .date {
  color: var(--text-light);
  font-size: 12px;
  flex-shrink: 0;
}

.content-block {
  min-height: 250px;
}

/* 机构设置 */
.org-panel {
  border: 1px solid var(--border-blue);
  padding: 12px 14px;
  background: var(--sky-blue-bg);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.org-panel .section-header {
  border-bottom-color: var(--primary-blue);
}

.org-panel .section-header h3 {
  color: var(--primary-blue);
}

.org-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
  flex: 1;
}

.org-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  background: var(--sky-blue-light);
  border: 1px solid var(--border-blue);
  border-radius: 2px;
  font-size: 13px;
  color: var(--primary-blue);
  font-weight: 500;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
  font-family: inherit;
  width: 100%;
}

.org-btn:hover {
  background: var(--primary-blue);
  color: var(--white);
}

.action-btns {
  display: flex;
  flex-direction: row;
  gap: 8px;
  flex-shrink: 0;
}

.action-btn {
  display: block;
  flex: 1;
  text-align: center;
  padding: 9px;
  background: var(--nav-blue);
  color: var(--white);
  border-radius: 2px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  transition: background var(--transition);
}

.action-btn:hover {
  background: var(--primary-blue-dark);
  color: var(--white);
}

/* 中间横幅 */
.mid-banner {
  height: 90px;
  background: url('/assets/mid-banner.jpg') center/cover no-repeat;
  border: 1px solid #e0e0e0;
}

/* 专题区 */
.special-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.special-section > .section-header {
  border-bottom: 1px solid #dcdcdc;
  margin-bottom: 0;
}

.special-grid {
  display: grid;
  grid-template-columns: var(--grid-columns-3);
  gap: var(--column-gap);
}

.special-card {
  height: 120px;
  display: block;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid #e8d4c8;
  transition: opacity var(--transition);
}

.special-card::before {
  display: none;
}

.special-card:hover {
  opacity: 0.92;
}

/* ===== 底部链接 ===== */
.db-links-wrap {
  background: linear-gradient(180deg, #1a6cb5 0%, #1565b0 50%, #1a6cb5 100%);
  margin: 0 -16px -24px;
  padding: 20px 16px;
}

.db-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.db-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 280px;
  height: 52px;
  background: linear-gradient(180deg, #c8e8f8 0%, #9dd4f0 100%);
  color: var(--primary-blue-dark);
  font-size: 17px;
  font-weight: 700;
  border-radius: 26px;
  letter-spacing: 2px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: all var(--transition);
}

.db-link-btn:hover {
  background: linear-gradient(180deg, #dff2fc 0%, #b8e4f8 100%);
  color: var(--dark-blue);
}

/* ===== 页脚 ===== */
.site-footer {
  background: var(--footer-bg);
  color: rgba(255, 255, 255, 0.85);
  padding: 24px 0 18px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-select {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
}

.footer-select option {
  background: var(--footer-bg);
  color: var(--white);
}

.footer-info {
  text-align: center;
  font-size: 13px;
  line-height: 2;
}

/* ===== 回到顶部 ===== */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 40px;
  height: 40px;
  background: var(--nav-blue);
  color: var(--white);
  border: none;
  border-radius: 3px;
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  z-index: 999;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--primary-blue-dark);
}

/* ===== 登录弹窗 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 45, 82, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: 4px;
  width: 420px;
  max-width: 92%;
  padding: 32px 28px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.modal h3 {
  text-align: center;
  color: var(--primary-blue);
  margin-bottom: 20px;
  font-size: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text-gray);
}

.form-group input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-blue);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
}

.form-group input:focus {
  border-color: var(--primary-blue);
}

.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-blue);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: vertical;
}

.form-group textarea:focus {
  border-color: var(--primary-blue);
}

.topic-apply-modal {
  width: 480px;
  max-height: 90vh;
  overflow: auto;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: var(--nav-blue);
  color: var(--white);
}

.btn-secondary {
  background: #f0f2f5;
  color: var(--text-dark);
}

.crypto-info {
  margin-top: 16px;
  padding: 8px;
  background: var(--sky-blue-bg);
  border-radius: var(--radius);
  font-size: 11px;
  color: var(--text-gray);
  text-align: center;
}

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
  .hero-section {
    grid-template-columns: 1fr 1fr;
  }

  .hero-section .org-panel {
    grid-column: 1 / -1;
  }

  .org-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .action-btns {
    flex-direction: row;
  }

  .topic-float-btn {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    top: auto;
    bottom: 80px;
    border-radius: 4px 0 0 4px;
    padding: 8px 12px;
  }
}

@media (max-width: 992px) {
  .header-inner {
    flex-direction: column;
    text-align: center;
    min-height: auto;
    padding-top: 40px;
  }

  .header-slogan-wrap {
    min-height: auto;
  }

  .header-slogan {
    font-size: 20px;
    letter-spacing: 2px;
  }

  .search-box {
    position: static;
    margin-top: 8px;
  }

  .nav-inner {
    flex-direction: column;
    min-height: auto;
  }

  .nav-home-col {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }

  .nav-home {
    padding: 10px 16px;
    width: 100%;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-section,
  .content-row,
  .special-grid {
    grid-template-columns: 1fr;
  }

  .footer-links {
    grid-template-columns: 1fr 1fr;
  }

  .db-links {
    flex-direction: column;
    gap: 16px;
  }

  .db-link-btn {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-list li a {
    padding: 8px 6px;
    font-size: 13px;
  }

  .footer-links {
    grid-template-columns: 1fr;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 480px) {
  .logo-text h1 {
    font-size: 22px;
  }

  .header-slogan {
    font-size: 16px;
  }

  .org-grid {
    grid-template-columns: 1fr 1fr;
  }

  .action-btns {
    flex-direction: row;
  }
}
