/* ==========================================================
   上海市市北公证处 · 官网
   桌面 / 移动自适应；品牌红 #972D2D + 深蓝首屏
   ========================================================== */

:root {
  --red: #972D2D;
  --red-dark: #7d2424;
  --navy: #16224a;
  --navy-2: #263d6f;
  --bg: #f5f6f8;
  --ink: #1f2329;
  --muted: #6b7280;
  --line: #e6e8ec;
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", system-ui, sans-serif;
  --font-serif: "Songti SC", "SimSun", "Noto Serif CJK SC", serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

a { color: inherit; }

/* ---------------- 头部 ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1200px;
  height: 78px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-logo { display: flex; align-items: center; flex: 0 0 auto; }
.site-logo img { display: block; height: 54px; width: auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  position: relative;
  padding: 9px 16px;
  border-radius: 4px;
  color: #333;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover { color: var(--red); }
.site-nav a.active { color: var(--red); font-weight: 600; }
.site-nav a.active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 2px;
  height: 2px;
  background: var(--red);
}

/* ---------------- 首屏 ---------------- */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(118deg, #0d1730 0%, #17264b 42%, #263d6f 100%);
  color: #fff;
}

.hero::before {
  content: "";
  position: absolute;
  left: -12%;
  bottom: -70%;
  width: 70%;
  height: 150%;
  background: rgba(255, 255, 255, .035);
  transform: rotate(24deg);
}

.hero::after {
  content: "";
  position: absolute;
  right: -14%;
  top: -60%;
  width: 55%;
  height: 160%;
  background: rgba(255, 255, 255, .045);
  transform: rotate(18deg);
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 78px 24px 86px;
  text-align: center;
}

.hero__office {
  margin: 0 0 18px;
  font-size: 14px;
  letter-spacing: .42em;
  text-indent: .42em;
  opacity: .72;
}

.hero__motto {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(30px, 4.4vw, 56px);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: .34em;
  text-indent: .34em;
}

.hero__sub {
  margin: 22px 0 0;
  font-size: 14px;
  letter-spacing: .18em;
  opacity: .62;
}

/* ---------------- 服务入口 ---------------- */

.services {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  max-width: 1200px;
  margin: -34px auto 0;
  padding: 0 24px;
}

.service {
  padding: 28px 14px 24px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(17, 28, 56, .08);
  text-align: center;
}

.service h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }

.service p {
  margin: 0 0 18px;
  color: #8a909b;
  font-size: 13px;
  line-height: 1.6;
}

.service a {
  display: inline-block;
  min-width: 84px;
  padding: 6px 18px;
  border: 1px solid #cbd0d8;
  border-radius: 999px;
  color: #333;
  font-size: 13px;
  text-decoration: none;
  transition: all .15s ease;
}

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

/* ---------------- 通用版块 ---------------- */

.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 68px 24px;
}

.section--tight { padding-top: 46px; }

.section-title {
  margin: 0 0 30px;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: .16em;
  text-align: center;
}

.section-title::after {
  content: "";
  display: block;
  width: 46px;
  height: 3px;
  margin: 14px auto 0;
  background: var(--red);
}

.section-title--left { text-align: left; }
.section-title--left::after { margin-left: 0; }

.intro p {
  margin: 0 0 16px;
  color: #3c414a;
  font-size: 15.5px;
  line-height: 2.05;
  text-indent: 2em;
}

.intro__photos {
  display: grid;
  grid-template-columns: 1.25fr 1fr .8fr;
  gap: 14px;
  margin-top: 34px;
}

.intro__photos img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.intro__photos figure {
  margin: 0;
  height: 230px;
  overflow: hidden;
  border-radius: 8px;
  background: #e9ebef;
}

/* ---------------- 联系 ---------------- */

.contact-band { background: #fff; border-top: 1px solid var(--line); }

.contact-grid {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 40px;
  align-items: center;
}

.contact-list { display: grid; gap: 14px; }

.contact-item { display: flex; gap: 12px; font-size: 15.5px; line-height: 1.7; }
.contact-item b { flex: 0 0 46px; color: var(--muted); font-weight: 400; }
.contact-item a { text-decoration: none; }
.contact-item a:hover { color: var(--red); }

.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 26px;
  border-radius: 999px;
  border: 1px solid var(--red);
  background: var(--red);
  color: #fff;
  font-size: 14px;
  letter-spacing: .06em;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover { background: var(--red-dark); }

.btn--ghost { background: transparent; color: var(--red); }
.btn--ghost:hover { background: rgba(151, 45, 45, .06); }

.qr-box { text-align: center; }
.qr-box img { width: 168px; height: 168px; display: block; margin: 0 auto 10px; }
.qr-box span { color: var(--muted); font-size: 13px; letter-spacing: .08em; }

/* ---------------- 内页 ---------------- */

.page-hero {
  background: linear-gradient(118deg, #0d1730 0%, #1b2c56 100%);
  color: #fff;
  padding: 46px 24px 42px;
}

.page-hero__inner { max-width: 1200px; margin: 0 auto; }

.page-hero h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 400;
  letter-spacing: .18em;
}

.page-hero p { margin: 10px 0 0; font-size: 13px; letter-spacing: .12em; opacity: .6; }

.page-body { max-width: 1000px; margin: 0 auto; padding: 34px 24px 70px; }

.panel {
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 16px rgba(20, 30, 50, .05);
  padding: 30px 32px;
}

.panel + .panel { margin-top: 20px; }

.panel h2 {
  position: relative;
  margin: 0 0 18px;
  padding-left: 14px;
  font-size: 20px;
  font-weight: 600;
}

.panel h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 2px;
  background: var(--red);
}

.panel h3 { margin: 22px 0 10px; font-size: 16px; font-weight: 600; }
.panel p { margin: 0 0 12px; color: #3c414a; }
.panel p.note { color: var(--muted); font-size: 13.5px; }

.panel .contact-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 26px;
  margin-bottom: 18px;
  color: #555;
  font-size: 14px;
}

.panel .contact-line b { color: var(--red); font-weight: 600; }

/* 办理 tab */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  padding: 12px 22px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: #555;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.tab:hover { color: var(--red); }
.tab.active { color: var(--red); border-bottom-color: var(--red); font-weight: 600; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* 目录 */
.catalog-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.input {
  flex: 1;
  min-width: 220px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfc;
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
}

.input:focus { outline: none; border-color: var(--red); background: #fff; }

.catalog-count { margin: 0 0 12px; color: var(--muted); font-size: 13px; }

.catalog {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.catalog th,
.catalog td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.catalog .group-heading td {
  background: #f7f8fa;
  color: #3c414a;
  font-weight: 600;
  font-size: 15px;
}

.catalog .item-row td { padding-left: 28px; }
.catalog tr:hover td { background: #fcfcfd; }
.catalog .empty-row td { color: var(--muted); text-align: center; padding: 26px 12px; }

.group-heading td {
  background: #f7f8fa;
  color: #3c414a;
  font-weight: 600;
}

/* 空状态 */
.empty-state {
  padding: 40px 10px 30px;
  text-align: center;
  color: var(--muted);
}

.empty-state strong { display: block; margin-bottom: 8px; color: var(--ink); font-size: 17px; }

/* 存证表单 */
.form-grid { display: grid; gap: 14px; max-width: 520px; }

.form-grid label span {
  display: block;
  margin-bottom: 6px;
  color: #555;
  font-size: 13.5px;
}

.form-grid label span em { color: var(--red); font-style: normal; margin-right: 4px; }

.form-grid input,
.form-grid textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfc;
  font-size: 14px;
  font-family: inherit;
}

.form-grid input:focus,
.form-grid textarea:focus { outline: none; border-color: var(--red); background: #fff; }

.form-msg {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fdf3f2;
  color: var(--red);
  font-size: 14px;
}

/* ---------------- 页脚 ---------------- */

.site-footer {
  background: #161c2a;
  color: #97a0b0;
  padding: 30px 24px 34px;
  text-align: center;
  font-size: 13px;
  line-height: 2;
}

.site-footer a { color: #c8ced8; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer .sep { margin: 0 10px; opacity: .4; }

/* ---------------- 响应式 ---------------- */

@media (max-width: 900px) {
  .site-header { position: static; }
  .site-header__inner { height: auto; flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 16px 0; }
  .site-logo { justify-content: center; }
  .site-logo img { height: 42px; }
  .site-nav { flex-wrap: wrap; justify-content: center; padding-bottom: 8px; }
  .site-nav a { padding: 7px 10px; font-size: 13px; }
  .site-nav a.active::after { left: 10px; right: 10px; }

  .hero__inner { padding: 46px 16px 58px; }
  .hero__office { margin-bottom: 14px; font-size: 12.5px; letter-spacing: .24em; text-indent: .24em; }
  .hero__motto { font-size: 27px; letter-spacing: .16em; text-indent: .16em; white-space: nowrap; }
  .hero__sub { margin-top: 16px; font-size: 12px; letter-spacing: .04em; }

  .services {
    grid-template-columns: repeat(2, 1fr);
    margin-top: -26px;
    padding: 0 16px;
    gap: 10px;
  }
  .service { padding: 20px 12px 18px; }
  .services .service:last-child { grid-column: 1 / -1; }
  .service h3 { font-size: 15.5px; }
  .service p { font-size: 12px; margin-bottom: 14px; }

  .section { padding: 44px 18px; }
  .section-title { font-size: 23px; margin-bottom: 22px; }
  .intro p { font-size: 14.5px; line-height: 1.95; text-align: justify; }
  .intro__photos { grid-template-columns: 1fr 1fr; }
  .intro__photos figure { height: 150px; }
  .intro__photos figure:last-child { display: none; }

  .contact-grid { grid-template-columns: 1fr; gap: 26px; }
  .contact-item { font-size: 14.5px; }
  .contact-item b { flex-basis: 40px; }
  .qr-box img { width: 150px; height: 150px; }

  .page-hero { padding: 34px 18px 30px; }
  .page-hero h1 { font-size: 22px; }
  .page-body { padding: 20px 14px 54px; }
  .panel { padding: 22px 18px; }
  .panel h2 { font-size: 18px; }

  .catalog .group-heading td { font-size: 14px; }
  .catalog .item-row td { padding-left: 18px; }

  .tab { padding: 11px 10px; font-size: 13.5px; }
  .tabs { gap: 0; }
}

/* ---------------- 公证员名片名录 ---------------- */

.contact-line .mini-qr {
  width: 54px;
  height: 54px;
  display: block;
}

.cards-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 18px 70px;
}

.cards-page .group-title {
  margin: 1.1rem .2rem .6rem;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .16em;
}

.person {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: .6rem;
  padding: .8rem .95rem;
  border-radius: .7rem;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 .1rem .4rem rgba(0, 0, 0, .05);
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, box-shadow .12s ease;
}

.person:active { transform: scale(.993); }
.person:hover { box-shadow: 0 .18rem .7rem rgba(0, 0, 0, .09); }

.person .avatar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "AR PL UKai CN", "楷体", serif;
  font-size: 1.1rem;
}

.person .meta { flex: 1; min-width: 0; }

.person .meta .n {
  display: block;
  font-size: 1.02rem;
  letter-spacing: .06em;
}

.person .meta .n .badge {
  display: inline-block;
  margin-left: .45rem;
  padding: .02rem .3rem;
  border: 1px solid var(--red);
  border-radius: .25rem;
  color: var(--red);
  font-size: .6rem;
  letter-spacing: .08em;
  vertical-align: .12em;
}

.person .meta .t {
  display: block;
  margin-top: .15rem;
  color: var(--muted);
  font-size: .78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person .arrow { flex: 0 0 auto; color: #c9c9c9; font-size: 1.3rem; line-height: 1; }
