@charset "UTF-8";
/* ==========================================================================
   保定市农业农村局 · 便民服务平台（移动端首页）
   设计基准宽度 390px，字号按 px 固定（面向中老年用户，不随屏宽缩小）
   布局宽度自适应，最大 480px 居中
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计变量（与设计稿一一对应）
   -------------------------------------------------------------------------- */
:root {
  /* 主色：政务 + 农业绿 */
  --c-green-deep: #125C36;
  --c-green-dark: #14663D;
  --c-green: #1F7A46;
  --c-green-bright: #2F9C61;
  --c-green-mid: #217A4A;
  --c-green-light: #8FD3AE;
  --c-green-tint: #E8F4EC;
  --c-green-tint-2: #E4F2E9;

  /* 辅助色：按层级 / 类别区分 */
  --c-blue: #2B6CB0;
  --c-blue-tint: #E7EFF9;
  --c-orange: #C2721F;
  --c-orange-tint: #FCEFE0;
  --c-red: #B23A55;
  --c-red-tint: #F8EBEF;
  --c-purple: #6B58A8;
  --c-purple-tint: #F1EDF8;

  /* 文字与背景 */
  --c-text: #16261C;
  --c-text-sub: #4E5F55;
  --c-text-muted: #7A887E;
  --c-text-faint: #8C9A90;
  --c-text-hint: #A6B3A9;
  --c-bg: #F2F5F1;
  --c-bg-outer: #DDE4DD;
  --c-surface: #FFFFFF;
  --c-surface-soft: #F5F9F6;
  --c-line: #EEF2EE;
  --c-border: #DEE8E1;
  --c-border-light: #E3EBE5;

  /* 圆角 */
  --r-card: 18px;
  --r-item: 16px;
  --r-tile: 14px;
  --r-pill: 999px;

  /* 阴影 */
  --shadow-card: 0 4px 16px rgba(15, 51, 30, .07);
  --shadow-card-sm: 0 3px 12px rgba(15, 51, 30, .06);
  --shadow-tabbar: 0 -2px 14px rgba(15, 51, 30, .08);

  /* 间距 */
  --gap-section: 22px;
  --gap-block: 12px;
  --pad-page: 16px;
}

/* --------------------------------------------------------------------------
   2. 基础重置
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  background: var(--c-bg-outer);
  color: var(--c-text);
  font-family: "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p, ul, li, figure {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

svg {
  display: block;
}

/* 键盘聚焦可见（鼠标点击不出现描边） */
a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(31, 122, 70, .55);
  outline-offset: 2px;
  border-radius: 8px;
}

/* --------------------------------------------------------------------------
   3. 页面容器
   -------------------------------------------------------------------------- */
.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--c-bg);
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   4. 顶部品牌区
   -------------------------------------------------------------------------- */
.app-header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--c-green-deep) 0%, var(--c-green-mid) 60%, #30995E 100%);
}

/* 模拟状态栏 */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  padding: 0 20px 0 24px;
}

.status-bar__time {
  font-size: 16px;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: .2px;
}

.status-bar__icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-bar__icon--signal { width: 18px; height: 12px; }
.status-bar__icon--wifi { width: 16px; height: 12px; }
.status-bar__icon--battery { width: 25px; height: 12px; }

/* 局徽 + 平台名 + 客服 */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 6px;
  
}

.brand__emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  background: #FFFFFF;
  border-radius: 16px;
}

.brand__emblem-icon {
  width: 30px;
  height: 30px;
}

.brand__text {
  flex: 1 1 auto;
  min-width: 0;
}

.brand__org {
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  color: #CBE7D7;
}

.brand__title {
  font-size: 26px;
  font-weight: 700;
  line-height: 36px;
  color: #FFFFFF;
  letter-spacing: .5px;
}

.brand__help {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  transition: background .2s ease;
}

.brand__help svg {
  width: 20px;
  height: 20px;
}

.brand__help:active {
  background: rgba(255, 255, 255, .3);
}

/* 服务标语 */
.slogan {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px 24px;
  font-size: 14px;
  line-height: 20px;
  color: #CFEBDC;
}

.slogan__mark {
  flex: 0 0 auto;
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--c-green-light);
}

/* 田垄装饰纹样 */
.app-header__decor {
  position: absolute;
  top: 88px;
  right: 0;
  width: 200px;
  height: 90px;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   5. 主内容区
   -------------------------------------------------------------------------- */
.app-main {
  display: flex;
  flex-direction: column;
  gap: var(--gap-section);
  /* 底部留出固定导航的高度，避免页脚被遮挡 */
  padding: 16px var(--pad-page) 12px;
  padding-bottom: 100px;
}

/* 板块标题行（竖条 + 标题 + 右侧内容） */
.section-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-head__title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  font-size: 21px;
  font-weight: 700;
  line-height: 28px;
  color: var(--c-text);
}

.section-head__title::before {
  content: "";
  flex: 0 0 auto;
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: var(--c-green);
}

.section-head__caption {
  flex: 0 0 auto;
  font-size: 13px;
  line-height: 20px;
  color: var(--c-text-faint);
}

.section-head__more {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  min-height: 32px;
  padding-left: 8px;
  font-size: 15px;
  line-height: 22px;
  color: #5C6B60;
}

.section-head__more svg {
  width: 14px;
  height: 14px;
}

/* 通用板块容器（纵向间距） */
.section {
  display: flex;
  flex-direction: column;
  gap: var(--gap-block);
}

/* 白色卡片容器（政策性平台使用） */
.panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 16px 16px;
  background: var(--c-surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

/* --------------------------------------------------------------------------
   6. 政策性平台入口宫格
   -------------------------------------------------------------------------- */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.entry-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 100px;
  padding: 14px 8px;
  background: var(--c-surface-soft);
  border-radius: var(--r-tile);
  transition: background .18s ease, transform .18s ease;
}

.entry-item:active {
  background: #EDF4EF;
  transform: scale(.98);
}

.entry-item__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-tile);
}

.entry-item__icon svg {
  width: 26px;
  height: 26px;
}

.entry-item__icon--green { background: var(--c-green-tint-2); }
.entry-item__icon--blue { background: var(--c-blue-tint); }
.entry-item__icon--orange { background: var(--c-orange-tint); }
.entry-item__icon--red { background: var(--c-red-tint); }

.entry-item__label {
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  color: var(--c-text);
  text-align: center;
}

/* --------------------------------------------------------------------------
   7. 政策法规
   -------------------------------------------------------------------------- */
/* 层级筛选胶囊 */
.filter {
  display: flex;
  gap: 8px;
}

.filter__chip {
  flex: 0 0 auto;
  min-width: 66px;
  height: 36px;
  padding: 0 16px;
  font-size: 15px;
  line-height: 22px;
  color: var(--c-text-sub);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.filter__chip--wide {
  min-width: 88px;
}

.filter__chip.is-active {
  font-weight: 500;
  color: #FFFFFF;
  background: var(--c-green);
  border-color: var(--c-green);
}

.filter__chip:active {
  opacity: .85;
}

/* 政策列表 */
.policy-list {
  background: var(--c-surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.policy-item + .policy-item {
  border-top: 1px solid var(--c-line);
}

.policy-item.is-hidden {
  display: none;
}

/* 筛选后第一条可见条目去掉上边框（隐藏项仍在 DOM 中，需由 JS 标记） */
.policy-item.is-first {
  border-top: 0;
}

.policy-item__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px 16px 16px;
  transition: background .18s ease;
}

.policy-item__link:active {
  background: #F7FAF8;
}

.policy-item__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

/* 层级标签 */
.tag {
  align-self: flex-start;
  padding: 3px 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  border-radius: 6px;
}

.tag--city {
  color: var(--c-green);
  background: var(--c-green-tint);
}

.tag--nation {
  color: var(--c-blue);
  background: var(--c-blue-tint);
}

.tag--province {
  color: var(--c-orange);
  background: var(--c-orange-tint);
}

.tag--knowledge {
  color: var(--c-purple);
  background: var(--c-purple-tint);
}

.policy-item__title {
  font-size: 18px;
  font-weight: 500;
  line-height: 27px;
  color: var(--c-text);
}

.policy-item__date {
  font-size: 14px;
  line-height: 20px;
  color: var(--c-text-faint);
}

.policy-item__arrow {
  flex: 0 0 auto;
}

.policy-item__arrow svg {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------------------
   8. 科普园地
   -------------------------------------------------------------------------- */
.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.knowledge-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--r-item);
  transition: transform .18s ease, filter .18s ease;
}

.knowledge-card:active {
  transform: scale(.98);
  filter: brightness(.97);
}

.knowledge-card--green { background: #E9F4EE; }
.knowledge-card--orange { background: #FDF1E5; }
.knowledge-card--blue { background: #E8F1F8; }
.knowledge-card--purple { background: var(--c-purple-tint); }

.knowledge-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.knowledge-card__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  background: #FFFFFF;
  border-radius: 11px;
}

.knowledge-card__badge svg {
  width: 20px;
  height: 20px;
}

.knowledge-card__title {
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  color: var(--c-text);
}

.knowledge-card__desc {
  font-size: 13px;
  line-height: 19px;
  color: #5C6B60;
}

/* --------------------------------------------------------------------------
   9. 金融产品
   -------------------------------------------------------------------------- */
.finance-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.finance-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--c-surface);
  border-radius: var(--r-item);
  box-shadow: var(--shadow-card-sm);
  transition: background .18s ease;
}

.finance-card:active {
  background: #F7FAF8;
}

.finance-card__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  background: var(--c-green-tint);
  border-radius: 13px;
}

.finance-card__badge svg {
  width: 24px;
  height: 24px;
}

.finance-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.finance-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.finance-card__name {
  font-size: 18px;
  font-weight: 500;
  line-height: 26px;
  color: var(--c-text);
}

.finance-card__amount {
  flex: 0 0 auto;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  color: var(--c-orange);
  white-space: nowrap;
}

.finance-card__bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.finance-card__provider {
  font-size: 14px;
  line-height: 20px;
  color: var(--c-text-muted);
}

.finance-card__tag {
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 17px;
  color: var(--c-green);
  background: var(--c-green-tint);
  border-radius: 5px;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   10. 便民服务（维修电话）
   -------------------------------------------------------------------------- */
.service-list {
  background: var(--c-surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.service-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
}

.service-item + .service-item {
  border-top: 1px solid var(--c-line);
}

.service-item__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.service-item__badge svg {
  width: 22px;
  height: 22px;
}

.service-item__badge--red { background: #FDEDE8; }
.service-item__badge--blue { background: var(--c-blue-tint); }
.service-item__badge--green { background: var(--c-green-tint); }
.service-item__badge--orange { background: var(--c-orange-tint); }

.service-item__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.service-item__name {
  font-size: 15px;
  line-height: 21px;
  color: var(--c-text);
}

/* 电话号码：全页最高优先级的可操作信息 */
.service-item__phone {
  font-size: 18px;
  font-weight: 700;
  line-height: 26px;
  color: var(--c-green);
  letter-spacing: .3px;
}

/* 拨打按钮 */
.btn-call {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 54px;
  height: 34px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: #FFFFFF;
  background: var(--c-green);
  border-radius: 17px;
  transition: background .18s ease;
}

.btn-call--wide {
  width: 56px;
}

.btn-call:active {
  background: var(--c-green-dark);
}

/* --------------------------------------------------------------------------
   11. 三农服务热线
   -------------------------------------------------------------------------- */
.hotline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 14px 16px;
  background: var(--c-green-tint);
  border-radius: 14px;
}

.hotline__icon {
  flex: 0 0 auto;
}

.hotline__icon svg {
  width: 20px;
  height: 20px;
}

.hotline__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.hotline__title {
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
  color: var(--c-green-dark);
}

.hotline__desc {
  font-size: 13px;
  line-height: 19px;
  color: #4E7A5F;
}

/* --------------------------------------------------------------------------
   12. 页脚
   -------------------------------------------------------------------------- */
.page-footer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 2px;
  font-size: 12px;
  line-height: 18px;
  color: var(--c-text-hint);
  text-align: center;
}

/* --------------------------------------------------------------------------
   13. 底部导航（固定在视口底部，任何时候都可见）
   -------------------------------------------------------------------------- */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  width: 100%;
  max-width: 480px;
  padding: 8px 20px 20px;
  /* 刘海屏机型追加安全区高度，不支持的浏览器自动沿用上一行 */
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  background: var(--c-bg);
  transform: translateX(-50%);
}

/* 底栏上沿渐隐，内容滑过时不出现生硬的切割线 */
.tabbar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -18px;
  height: 18px;
  background: linear-gradient(180deg, rgba(242, 245, 241, 0) 0%, var(--c-bg) 100%);
  pointer-events: none;
}

.tabbar__pill {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 62px;
  padding: 4px;
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-radius: 36px;
  box-shadow: var(--shadow-tabbar);
}

.tabbar__item {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  font-size: 11px;
  font-weight: 500;
  line-height: 15px;
  color: var(--c-text-faint);
  border-radius: 26px;
  transition: background .18s ease, color .18s ease;
}

.tabbar__item svg {
  width: 20px;
  height: 20px;
}

.tabbar__item.is-active {
  color: #FFFFFF;
  background: var(--c-green);
}

/* --------------------------------------------------------------------------
   14. 轻提示
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 120px;
  z-index: 100;
  max-width: 80vw;
  padding: 12px 20px;
  font-size: 15px;
  line-height: 22px;
  color: #FFFFFF;
  text-align: center;
  background: rgba(22, 38, 28, .9);
  border-radius: 12px;
  transform: translate(-50%, 12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
}

.toast.is-show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* --------------------------------------------------------------------------
   14.5 小程序跳转引导弹层
   -------------------------------------------------------------------------- */
.mp-modal[hidden] {
  display: none;
}

.mp-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
}

.mp-modal__mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 26, 19, .55);
  animation: mpFade .2s ease;
}

.mp-modal__panel {
  position: relative;
  width: 100%;
  max-width: 320px;
  padding: 26px 22px 20px;
  text-align: center;
  background: #FFFFFF;
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(15, 26, 19, .22);
  animation: mpPop .24s cubic-bezier(.2, .9, .3, 1.1);
}

@keyframes mpFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes mpPop {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.mp-modal__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  color: var(--c-green);
  background: var(--c-green-tint);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp-modal__icon svg {
  width: 28px;
  height: 28px;
}

.mp-modal__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-text);
}

.mp-modal__desc {
  margin-top: 8px;
  font-size: 14px;
  line-height: 22px;
  color: var(--c-text-sub);
}

.mp-modal__code {
  margin-top: 14px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 20px;
  color: var(--c-text);
  word-break: break-all;
  background: var(--c-surface-soft);
  border: 1px dashed rgba(31, 122, 70, .35);
  border-radius: 10px;
  -webkit-user-select: all;
  user-select: all;
}

.mp-modal__actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
}

.mp-modal__btn {
  flex: 1;
  height: 42px;
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text-sub);
  background: var(--c-bg);
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

.mp-modal__btn--primary {
  color: #FFFFFF;
  background: var(--c-green);
}

.mp-modal__btn:active {
  opacity: .85;
}

/* --------------------------------------------------------------------------
   15. 响应式与可访问性适配
   -------------------------------------------------------------------------- */

/* 小屏（320–359px）：保持字号不变，仅压缩横向留白，避免文字被挤断 */
@media (max-width: 359px) {
  :root {
    --pad-page: 12px;
  }

  .entry-item {
    padding: 14px 6px;
  }

  .knowledge-card {
    padding: 12px;
  }

  .knowledge-card__title {
    font-size: 15px;
  }

  .policy-item__title {
    font-size: 17px;
  }

  .filter__chip {
    min-width: 60px;
    padding: 0 12px;
  }

  .filter__chip--wide {
    min-width: 80px;
  }
}

/* 大屏（平板 / 桌面预览）：宽度居中并加投影，模拟手机卡片 */
@media (min-width: 520px) {
  .app {
    box-shadow: 0 0 0 1px rgba(15, 51, 30, .06), 0 18px 48px rgba(15, 51, 30, .16);
  }
}

/* 尊重系统「减少动效」偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
