/* ============================================
   专业法律服务平台 · 首页样式
   配色：深海军蓝 #16406E（主） + 金色 #C9A24B（点缀）
         辅助蓝 #2E5F94 / 深一档 #1D4E82
   ============================================ */

:root {
  --navy: #16406E;
  --navy-deep: #1D4E82;
  --blue: #2E5F94;
  --gold: #C9A24B;
  --bg: #F5F7FA;
  --text: #22293A;
  --text-sub: #6B7385;
  --ink: #22293A;
  --slate: #5B708C;
  --radius-lg: 16px;
  --radius-md: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- 顶部栏 ---------- */
.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
}

.logo {
  width: 26px;
  height: 26px;
  color: var(--gold);
  flex-shrink: 0;
}

.site-home {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}

.site-name {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 1px;
}

.site-home:hover .site-name { color: var(--gold); }

/* ---------- 轮播 Banner ---------- */
.banner { position: relative; }

.banner-wrap {
  position: relative;
  padding-top: 16px;
}

.slides {
  position: relative;
  height: 170px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 28px;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
}

/* 纯文字轮播的背景色由后台按条设置，写在内联 style 上；
   图片轮播：图片铺满整块，左侧加一层深色蒙版保证文字清晰 */
.slide.has-img { background-color: var(--navy); }

.slide.has-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(22, 64, 110, 0.9) 0%, rgba(22, 64, 110, 0.66) 42%, rgba(22, 64, 110, 0.12) 100%);
}

/* 整块可点击（后台填了跳转地址时） */
.slide-hit {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.slide-text {
  position: relative;
  z-index: 2;
}

.slide-icon {
  position: relative;
  z-index: 2;
  width: 64px;
  height: 64px;
  color: var(--gold);
  flex-shrink: 0;
}

.slide-text h2 {
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 1px;
}

.slide-text p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  margin-top: 4px;
}

.slide-tag {
  display: inline-block;
  background: #fff;
  color: var(--navy);
  font-size: 11px;
  padding: 1px 10px;
  border-radius: 10px;
  margin-bottom: 8px;
}

.dots {
  position: absolute;
  bottom: 12px;
  left: 44px;
  display: flex;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.45);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s;
}

.dot.active {
  width: 18px;
  background: var(--gold);
}

.gold-line {
  height: 3px;
  background: var(--gold);
  margin-top: 16px;
}

/* ---------- 搜索框 ---------- */
.search-section { position: relative; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid var(--navy);
  border-radius: 24px;
  padding: 5px 5px 5px 14px;
  margin-top: 16px;
}

.search-icon {
  width: 16px;
  height: 16px;
  color: var(--navy);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  min-width: 0;
}

.search-bar input::placeholder { color: #A5ABBA; }

.search-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 8px 20px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.search-btn:hover { background: var(--blue); }

/* 轻提示 */
.toast {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -38px;
  background: rgba(22, 64, 110, 0.92);
  color: #fff;
  font-size: 13px;
  padding: 7px 18px;
  border-radius: 18px;
  white-space: nowrap;
  z-index: 50;
}

/* ---------- 服务宫格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px 10px;
  margin-top: 26px;
}

.grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.grid-item .icon {
  width: 62px;
  height: 62px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.grid-item:hover .icon {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(22, 64, 110, 0.18);
}

.grid-item:active .icon { transform: scale(0.94); }

.grid-item .icon svg {
  width: 32px;
  height: 32px;
}

.grid-item .label {
  font-size: 12px;
  color: var(--text-sub);
  text-align: center;
}

/* ---------- 返回首页按钮 ---------- */
.back-home-wrap { margin-top: 30px; }

.back-btn {
  display: block;
  width: 100%;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 2px;
  cursor: pointer;
  transition: background 0.2s;
}

.back-btn:hover { background: var(--blue); }

/* ---------- 页脚 ---------- */
.site-footer {
  text-align: center;
  padding: 26px 16px 30px;
  color: #9AA1B0;
  font-size: 12px;
}

/* ---------- 内页通用：栏目头图 ---------- */
.page-hero {
  background: var(--navy-deep);
  padding: 16px 0 18px;
}

.breadcrumb {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  margin-bottom: 4px;
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
}

.breadcrumb a:hover { color: var(--gold); }

.page-hero .hero-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 19px;
  font-weight: 500;
  margin-top: 10px;
}

.page-hero .hero-title::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--gold);
}

.page-hero .hero-sub {
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  margin-top: 6px;
}

/* ---------- 单页介绍页 ---------- */
.about-intro {
  background: #EEF2F7;
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.about-intro h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.about-intro p {
  font-size: 14px;
  color: var(--text-sub);
  margin-top: 8px;
  line-height: 1.9;
}

.section-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin: 24px 0 12px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.feature-card {
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(22, 64, 110, 0.14);
}

.feature-card .f-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  align-items: center;
  justify-content: center;
}

.feature-card .f-icon svg { width: 21px; height: 21px; }

.feature-card h4 {
  font-size: 13px;
  font-weight: 500;
  margin-top: 8px;
  color: var(--text);
}

.feature-card p {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
}

/* 服务流程 */
.step-flow {
  display: flex;
  align-items: flex-start;
}

.step-flow .step {
  flex: 1;
  text-align: center;
}

.step-flow .step-num {
  display: inline-flex;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  align-items: center;
  justify-content: center;
}

.step-flow .step p {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 6px;
}

.step-flow .step-line {
  flex: 1;
  border-top: 1.5px dashed var(--gold);
  margin-top: 16px;
}

/* 联系我们 */
.contact-list {
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-item .c-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-item .c-icon svg { width: 14px; height: 14px; }

.contact-item span {
  font-size: 13px;
  color: var(--text-sub);
}

/* ---------- 列表页 ---------- */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.article-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.article-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(22, 64, 110, 0.14);
}

.article-item .a-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-item .a-icon svg { width: 18px; height: 18px; }

/* 文件类型图标（下载列表：Word / PDF / Excel / PPT…，由 file_icon_svg() 输出） */
.article-item > .file-ico { flex-shrink: 0; margin-top: 2px; }

.article-item .a-info { min-width: 0; flex: 1; }

.article-item h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-item .a-meta {
  display: block;
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 4px;
}

.article-item .a-arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 10px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
}

.page-btn {
  min-width: 30px;
  height: 30px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font-size: 13px;
  color: var(--text-sub);
  cursor: pointer;
  padding: 0 6px;
}

.page-btn.active {
  background: var(--navy);
  color: #fff;
}

.page-btn:hover:not(.active) { background: #EEF2F7; }

/* 页码过多时中间的省略号 */
.page-gap {
  min-width: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-sub);
}

/* ---------- 详情页 ---------- */
.detail-title {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
  margin-top: 10px;
}

.detail-meta {
  font-size: 12px;
  color: #9AA1B0;
  margin-top: 10px;
  padding-bottom: 14px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.12);
}

.detail-body { padding-top: 16px; }

.detail-body p {
  font-size: 14px;
  line-height: 2;
  color: var(--text);
  margin-bottom: 12px;
}

.detail-body h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin: 20px 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--gold);
}

/* 正文里的图片一律居中显示（含后台编辑器插入的图、列表/详情封面） */
.detail-body img,
.oi-body img {
  display: block;
  margin: 14px auto;
  max-width: 100%;
  height: auto;
}

.detail-body video { margin: 0 auto; }

/* 搜索结果里的内容摘要 */
.a-desc {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-sub);
}

.detail-tip {
  background: #EEF2F7;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.8;
  margin-top: 20px;
}

.back-row {
  display: flex;
  gap: 10px;
  margin-top: 26px;
}

.back-row .back-btn { flex: 1; }

.back-btn.ghost {
  background: #fff;
  color: var(--navy);
  border: 1.5px solid var(--navy);
  padding: 10.5px 0;
}

.back-btn.ghost:hover { background: #EEF2F7; }

/* ---------- 子分类标签页 ---------- */
.sub-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.sub-tabs a {
  padding: 6px 14px;
  border-radius: 999px;
  background: #F1F4F9;
  color: var(--text-sub);
  font-size: 13px;
  text-decoration: none;
  border: 1px solid #E3E8F0;
}

.sub-tabs a:hover { color: var(--navy); border-color: var(--navy); }

.sub-tabs a.on {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* ---------- 网页嵌入（iframe） ---------- */
.iframe-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #F5F7FA;
  border: 1px solid #E3E8F0;
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-sub);
}

.iframe-open {
  background: var(--navy);
  color: #fff !important;
  text-decoration: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  white-space: nowrap;
}

.iframe-wrap {
  margin-top: 12px;
  border: 1px solid #E3E8F0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.iframe-wrap iframe {
  width: 100%;
  height: 70vh;
  min-height: 520px;
  border: none;
  display: block;
}

/* ---------- 服务机构 ---------- */
.org-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.org-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #E3E8F0;
  border-left: 4px solid var(--navy);
  border-radius: 10px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow .15s, transform .15s;
}

.org-menu-item:hover {
  box-shadow: 0 4px 14px rgba(22, 64, 110, .12);
  transform: translateY(-1px);
}

.om-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.om-icon svg { width: 22px; height: 22px; }

.om-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.om-text strong { font-size: 16px; color: var(--navy); }
.om-text small { font-size: 12px; color: var(--slate); }

.om-arrow {
  font-size: 22px;
  color: var(--gold);
  line-height: 1;
}

.org-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.org-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #E3E8F0;
  border-radius: 10px;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow .15s;
}

.org-card:hover { box-shadow: 0 4px 14px rgba(22, 64, 110, .12); }

.org-qr {
  flex: 0 0 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.org-qr .qr { width: 96px; height: 96px; background: #fff; }
.org-qr .qr img { width: 96px; height: 96px; display: block; }
.org-qr small { font-size: 11px; color: var(--slate); }

.org-info { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.org-info h3 { margin: 0; font-size: 16px; color: var(--navy); }
.org-info .a-meta { font-size: 13px; }
.org-info .a-meta b { color: var(--navy); font-weight: 600; }

/* 机构详情页 */
.org-meta-card {
  background: #fff;
  border: 1px solid #E3E8F0;
  border-top: 3px solid var(--gold);
  border-radius: 10px;
  padding: 18px 20px;
  margin-top: 16px;
}

.od-name { margin: 0 0 6px; font-size: 20px; color: var(--navy); }

.od-tag {
  display: inline-block;
  background: rgba(201, 162, 75, .14);
  color: #9a7a2e;
  font-size: 12px;
  border-radius: 20px;
  padding: 2px 12px;
}

.org-intro {
  background: #fff;
  border: 1px solid #E3E8F0;
  border-radius: 10px;
  padding: 18px 20px;
  margin-top: 14px;
}

.oi-title {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--navy);
  padding-left: 10px;
  border-left: 3px solid var(--gold);
  line-height: 1.2;
}

.oi-body { font-size: 14px; line-height: 1.9; color: var(--ink); }

/* 援助人员卡片（可点击）与详情页 */
.person-item {
  text-decoration: none;
  color: var(--ink);
  background: #fff;
}

.person-more {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--gold);
}

.person-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #E3E8F0;
  border-top: 3px solid var(--gold);
  border-radius: 10px;
  padding: 18px 20px;
  margin-top: 16px;
}

.pc-photo {
  width: 110px;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #E9EDF4;
}

.pc-none {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
}

.pc-info { flex: 1; min-width: 0; }

.pc-name {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 500;
  color: var(--navy);
}

.person-card .a-meta { font-size: 13px; }
.person-card .a-meta b { color: var(--navy); }

/* ---------- 图 + 文列表（2 列卡片，后台「列表展示方式」可选） ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 12px;
}

.case-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.case-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(22, 64, 110, 0.14);
}

.cc-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #EEF2F7;
  overflow: hidden;
}

.cc-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cc-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.cc-ph svg { width: 40px; height: 40px; }

.cc-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding: 10px 10px 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--navy);
}

.cc-meta {
  display: block;
  padding: 6px 10px 12px;
  font-size: 12px;
  color: var(--text-sub);
}

/* ---------- 响应式 ---------- */
@media (min-width: 768px) {
  .slides { height: 240px; }
  .slide { padding: 0 48px; gap: 28px; }
  .slide-icon { width: 84px; height: 84px; }
  .slide-text h2 { font-size: 28px; }
  .slide-text p { font-size: 15px; }
  .dots { left: 64px; bottom: 16px; }
  .grid { grid-template-columns: repeat(8, 1fr); gap: 26px 10px; }
  .banner-wrap { padding-top: 24px; }
  .gold-line { margin-top: 24px; }
  .feature-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .page-hero { padding: 24px 0 26px; }
  .page-hero .hero-title { font-size: 24px; }
  .page-hero .hero-title::before { height: 22px; }
  .about-intro, .contact-list { padding: 20px 24px; }
  .article-list { flex-direction: row; flex-wrap: wrap; }
  .article-item { width: calc(50% - 5px); }
  .detail-title { font-size: 24px; }
}

/* ---------- 手机端：页面左右留白收紧到 10px ---------- */
@media (max-width: 767px) {
  .container { padding-left: 10px; padding-right: 10px; }
  /* 内页深蓝标题区与内容块左右间隔一致：内缩 10px + 圆角 */
  .page-hero { border-radius: 12px; overflow: hidden; }
}
