/* ===== 顶栏 Topbar ===== */
.topbar {
  background: linear-gradient(180deg, #b80000 0%, var(--gov-red) 100%);
  color: #fff;
  font-size: 12px;
  height: 32px;
  line-height: 32px;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.topbar-left { opacity: .9; }
.topbar-right { display: flex; gap: 0; }
.topbar-right a, .topbar-right button {
  color: #fff;
  padding: 0 12px;
  border-left: 1px solid rgba(255,255,255,.2);
  font-size: 12px;
  white-space: nowrap;
}
.topbar-right a:first-child, .topbar-right button:first-child { border-left: 0; }
.topbar-right a:hover, .topbar-right button:hover { background: rgba(0,0,0,.1); text-decoration: none; }

/* ===== Logo 区 ===== */
.header-main {
  background: #fff url('../images/header-bg.svg') center/cover no-repeat;
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--border-1);
}
.header-main .container { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: var(--space-md); }
.brand-logo {
  width: 72px; height: 72px; flex-shrink: 0;
  object-fit: contain;
}
.brand-title {
  font-size: 38px;
  font-weight: 700;
  color: var(--gov-red);
  letter-spacing: 4px;
  line-height: 1.2;
  font-family: var(--font-serif);
}
.brand-subtitle {
  font-size: 13px;
  color: var(--text-3);
  letter-spacing: 8px;
  margin-top: 4px;
  text-transform: uppercase;
}

/* 搜索 */
.search-box { display: flex; align-items: stretch; width: 380px; height: 42px; border: 2px solid var(--gov-red); border-radius: 4px; overflow: hidden; }
.search-box input { flex: 1; border: 0; padding: 0 14px; font-size: 14px; outline: none; background: #fff; }
.search-box button { background: var(--gov-red); color: #fff; padding: 0 22px; font-size: 14px; font-weight: 500; }
.search-box button:hover { background: var(--gov-red-deep); }
.search-suggestions { font-size: 12px; color: var(--text-3); margin-top: 8px; }
.search-suggestions a { margin-right: 12px; }
.search-suggestions a:hover { color: var(--gov-red); }

/* ===== 主导航 ===== */
.main-nav {
  background: linear-gradient(180deg, var(--gov-red) 0%, var(--gov-red-deep) 100%);
  height: 56px;
  position: relative;
  z-index: 100;
}
.main-nav .container { display: flex; height: 100%; align-items: stretch; position: relative; }
.nav-item { flex: 1; position: relative; }
.nav-link {
  display: flex; align-items: center; justify-content: center;
  height: 100%;
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  position: relative;
  transition: background .2s;
}
.nav-link:hover, .nav-item.active .nav-link {
  background: var(--gov-red-deep);
  text-decoration: none;
}
.nav-item.active .nav-link::after {
  content: "";
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 30px; height: 3px;
  background: #ffeb99;
}
/* 二级菜单 */
.nav-sub {
  position: absolute;
  top: 100%; left: 0;
  background: #fff;
  min-width: 100%;
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
  border-top: 2px solid var(--gov-red);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all .2s;
}
.nav-item:hover .nav-sub { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-sub a {
  display: block;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text-1);
  white-space: nowrap;
}
.nav-sub a:hover { background: var(--bg-section); color: var(--gov-red); text-decoration: none; }

/* ===== 主体区分块 ===== */
.section { padding: var(--space-2xl) 0; }
.section-sm { padding: var(--space-xl) 0; }

.section-title {
  display: flex; align-items: flex-end; justify-content: space-between;
  border-bottom: 2px solid var(--gov-red);
  margin-bottom: var(--space-lg);
  padding-bottom: 8px;
}
.section-title h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--gov-red);
  padding-bottom: 2px;
  position: relative;
}
.section-title h2::before {
  content: ""; display: inline-block; vertical-align: middle;
  width: 6px; height: 22px; background: var(--gov-red);
  margin-right: 10px;
}
.section-title .more {
  font-size: 13px;
  color: var(--text-3);
}
.section-title .more:hover { color: var(--gov-red); }

/* 通用卡片 */
.card { background: var(--bg-card); border: 1px solid var(--border-1); padding: var(--space-lg); }

/* ===== 友情链接 ===== */
.friend-links {
  background: var(--bg-section);
  border-top: 1px solid var(--border-1);
  padding: var(--space-lg) 0;
}
.friend-links h3 {
  font-size: 16px; color: var(--gov-blue); font-weight: 700; margin-bottom: var(--space-md);
}
.friend-links-group { display: flex; gap: var(--space-xl); flex-wrap: wrap; margin-bottom: var(--space-md); }
.friend-links-group:last-child { margin-bottom: 0; }
.friend-links-label {
  font-weight: 600;
  color: var(--gov-red);
  min-width: 100px;
  font-size: 14px;
  padding-top: 2px;
}
.friend-links-list { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; }
.friend-links-list a { color: var(--text-2); }
.friend-links-list a:hover { color: var(--gov-red); }

/* ===== 底栏 ===== */
.footer {
  background: var(--gov-blue-deep);
  color: rgba(255,255,255,.85);
  padding: var(--space-2xl) 0 var(--space-lg);
  font-size: 13px;
}
.footer a { color: rgba(255,255,255,.85); }
.footer a:hover { color: #fff; }
.footer-links {
  text-align: center;
  padding-bottom: var(--space-lg);
  font-size: 13px;
}
.footer-links a { color: rgba(255,255,255,.85); }
.footer-links a:hover { color: #fff; }
.footer-links-sep { margin: 0 12px; color: rgba(255,255,255,.3); }
.footer-top {
  display: flex; justify-content: space-between; gap: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid rgba(255,255,255,.12);
  flex-wrap: wrap;
}
.footer-info { flex: 1; min-width: 280px; line-height: 2; }
.footer-info p { margin: 0; }
.footer-info strong { color: #fff; font-weight: 600; }
.footer-badges { display: flex; gap: var(--space-lg); align-items: center; flex-wrap: wrap; }
.footer-badge {
  width: 80px; height: 80px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.05);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  font-size: 11px; color: rgba(255,255,255,.7);
  padding: 4px;
  /* TODO: 替换为真实政府网站标识、备案图标等 */
}
.footer-badge strong { color: #fff; font-size: 11px; }
.footer-bottom {
  padding-top: var(--space-md);
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,.6);
}

/* ===== 面包屑 ===== */
.breadcrumb {
  background: var(--bg-section);
  border-bottom: 1px solid var(--border-1);
  padding: 12px 0;
  font-size: 13px;
  color: var(--text-3);
}
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--gov-red); }
.breadcrumb .sep { margin: 0 8px; color: var(--text-4); }
.breadcrumb .current { color: var(--gov-red); }

/* ===== 响应式 ===== */
@media (max-width: 1199px) {
  :root { --container: 100%; }
  .container { padding: 0 var(--space-lg); }
  .brand-title { font-size: 32px; }
  .search-box { width: 320px; }
}

@media (max-width: 768px) {
  /* 顶栏 */
  .topbar { height: auto; line-height: 28px; font-size: 11px; }
  .topbar .container { padding: 0; }
  .topbar-left { display: none; }
  .topbar-right { width: 100%; justify-content: flex-start; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .topbar-right::-webkit-scrollbar { display: none; }
  .topbar-right a, .topbar-right button { padding: 0 10px; font-size: 11px; flex-shrink: 0; }

  /* Logo + 搜索 */
  .header-main { padding: 16px 0; background-size: cover; }
  .header-main .container { gap: var(--space-md); flex-direction: column; align-items: flex-start; }
  .brand { gap: var(--space-sm); }
  .brand-logo { width: 48px; height: 48px; }
  .brand-title { font-size: 20px; letter-spacing: 2px; }
  .brand-subtitle { font-size: 10px; letter-spacing: 2px; }
  .search-box { width: 100%; height: 38px; }
  .search-suggestions { font-size: 11px; }
  .search-suggestions a { margin-right: 8px; }

  /* 主导航 */
  .main-nav { height: auto; }
  .main-nav .container { flex-wrap: wrap; padding: 0; }
  .nav-item { flex: 0 0 25%; }
  .nav-link { height: 40px; font-size: 13px; padding: 0 2px; }
  .nav-item.active .nav-link::after { width: 20px; height: 2px; }
  .nav-sub { display: none; }

  /* 分块 */
  .section { padding: var(--space-xl) 0; }
  .section-sm { padding: var(--space-lg) 0; }
  .section-title { margin-bottom: var(--space-md); }
  .section-title h2 { font-size: 18px; }
  .section-title h2::before { width: 4px; height: 18px; margin-right: 6px; }
  .section-title .more { font-size: 12px; }

  /* 友情链接 */
  .friend-links-group { gap: var(--space-md); }
  .friend-links-label { min-width: auto; font-size: 13px; }
  .friend-links-list { gap: 6px 14px; font-size: 12px; }

  /* 底栏 */
  .footer { padding: var(--space-lg) 0 var(--space-md); font-size: 12px; }
  .footer-top { flex-direction: column; gap: var(--space-md); padding-bottom: var(--space-md); }
  .footer-info { line-height: 1.8; min-width: 0; word-break: break-all; }
  .footer-badges { justify-content: center; gap: var(--space-md); }
  .footer-badge { width: 64px; height: 64px; font-size: 10px; }
  .footer-bottom { font-size: 11px; line-height: 1.6; }
}
