/* ==========================================================================
   手机端 App 外壳与组件层
   只在 ≤760px 生效，加载顺序在 mobile.css 之后，覆盖其页头/页脚部分。
   设计取向：画布下沉（卡片浮起）、发丝线分隔、直接可点的列表行、
   底部标签栏常驻、按下有回弹。桌面端不受影响。
   ========================================================================== */

:root {
  --app-canvas: #EFECE5;
  --app-card: #FFFFFF;
  --app-line: rgba(19, 22, 27, .10);
  --app-bar: rgba(251, 250, 247, .92);
  --app-r: 10px;
  --app-shadow: 0 1px 2px rgba(19, 22, 27, .05), 0 6px 16px rgba(19, 22, 27, .05);
  --app-sh: 48px;
  --app-tb: 58px;
}

/* 桌面端不显示 App 元素 */
.appbar, .tabbar, .sheet, .only-mob, .app-scrim { display: none }

@media (max-width: 760px) {

  /* ---------- 画布 ---------- */
  /* 离屏的弹层是 fixed 定位，会把滚动宽度撑出 2px；clip 不产生滚动容器，也不影响 sticky */
  html { background: var(--app-canvas); overflow-x: clip }
  body {
    overflow-x: clip;
    background: var(--app-canvas);
    font-size: 15px;
    line-height: 1.72;
    padding-bottom: calc(var(--app-tb) + env(safe-area-inset-bottom) + 10px);
    overscroll-behavior-y: contain;
  }
  .wrap { padding: 0 14px; max-width: none }
  .only-mob { display: block }
  .only-desk { display: none !important }

  /* ---------- 顶部应用栏 ---------- */
  header.top-header { display: none }
  .appbar {
    display: flex; align-items: center; gap: 6px;
    position: sticky; top: 0; z-index: 80;
    height: var(--app-sh);
    padding: 0 8px 0 4px;
    padding-top: env(safe-area-inset-top);
    background: var(--app-bar);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--app-line);
  }
  .ab-btn {
    flex: none; width: 44px; height: 44px; display: flex;
    align-items: center; justify-content: center;
    color: var(--ink); text-decoration: none; background: none; border: 0;
    -webkit-tap-highlight-color: transparent;
  }
  .ab-btn:active { background: rgba(19, 22, 27, .06) }
  .ab-title {
    flex: 1; min-width: 0; font-size: 16px; font-weight: 700; line-height: 1.2;
    letter-spacing: -.01em; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .ab-title .ab-sub {
    display: block; font-family: var(--mono); font-size: 9.5px; font-weight: 400;
    letter-spacing: .12em; color: var(--ink4); margin-top: 2px;
  }
  .ab-logo {
    display: flex; align-items: center; gap: 7px; text-decoration: none;
    color: var(--ink); width: auto; padding: 0 10px 0 8px; white-space: nowrap;
  }
  .ab-logo .mk { width: 22px; height: 22px; display: block; object-fit: contain }
  .ab-logo .lw { font-size: 15.5px; font-weight: 700; letter-spacing: .05em }

  /* ---------- 底部标签栏 ---------- */
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    background: var(--app-bar);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--app-line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tab {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center;
    border: 0; background: none; padding: 0; font-family: inherit; font-size: inherit;
    cursor: pointer;
    justify-content: center; gap: 3px; height: var(--app-tb);
    text-decoration: none; color: var(--ink3); position: relative;
    -webkit-tap-highlight-color: transparent;
  }
  .tab .ic { display: block; transition: transform .16s cubic-bezier(.3, 1.4, .5, 1) }
  .tab span { font-size: 10px; line-height: 1; letter-spacing: .02em }
  .tab:active .ic { transform: scale(.88) }
  .tab.on { color: var(--accent) }
  .tab.on span { font-weight: 700 }
  .tab.on:before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 26px; height: 2px; background: var(--accent);
  }

  /* ---------- 底部弹层（更多菜单 / 分享） ---------- */
  .app-scrim {
    display: block; position: fixed; inset: 0; z-index: 95;
    background: rgba(19, 22, 27, .38);
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .app-scrim.on { opacity: 1; pointer-events: auto }
  .sheet {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 96;
    background: var(--app-card);
    border-top-left-radius: 16px; border-top-right-radius: 16px;
    padding: 8px 0 calc(10px + env(safe-area-inset-bottom));
    transform: translateY(102%); transition: transform .26s cubic-bezier(.32, .72, 0, 1);
    box-shadow: 0 -8px 32px rgba(19, 22, 27, .14);
    max-height: 76vh; overflow-y: auto;
    overscroll-behavior: contain;
  }
  .sheet.on { transform: translateY(0) }
  .sheet:before {
    content: ''; display: block; width: 36px; height: 4px; margin: 4px auto 8px;
    background: var(--rule2); border-radius: 2px;
  }
  .sh-sec { padding: 0 14px 6px }
  .sh-sec + .sh-sec { border-top: 1px solid var(--app-line); padding-top: 8px }
  .sh-t {
    font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em;
    color: var(--ink4); padding: 4px 4px 6px;
  }
  .sh-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px }
  .sh-tile {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 7px 4px 6px; border-radius: 10px; text-decoration: none;
    color: var(--ink); -webkit-tap-highlight-color: transparent;
  }
  .sh-tile:active { background: var(--paper2) }
  .sh-ic {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    background: var(--paper2); color: var(--ink2); border-radius: 11px;
  }
  .sh-lb { font-size: 11.5px; line-height: 1.2; text-align: center; letter-spacing: -.01em }
  .sh-tile.on { color: var(--accent) }
  .sh-tile.on .sh-ic { background: var(--accent-bg); color: var(--accent) }
  .sh-tile.on .sh-lb { font-weight: 700 }
  .sh-foot { padding: 4px 18px 2px }
  .sh-close {
    display: block; width: 100%; min-height: 46px; border: 0;
    background: var(--paper2); border-radius: 10px;
    font-family: inherit; font-size: 15px; font-weight: 700; color: var(--ink);
    -webkit-tap-highlight-color: transparent;
  }
  .sh-close:active { background: var(--rule) }

  /* ---------- 卡片 ---------- */
  .card {
    background: var(--app-card); border-radius: var(--app-r);
    box-shadow: var(--app-shadow); padding: 16px; margin: 12px 0;
  }
  .card.flat { box-shadow: none; border: 1px solid var(--app-line) }
  .card-h {
    display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px;
  }
  .card-h .ct { font-size: 15px; font-weight: 700; line-height: 1.35 }
  .card-h .cm { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--ink4) }

  /* ---------- 列表行 ---------- */
  .lst {
    background: var(--app-card); border-radius: var(--app-r);
    box-shadow: var(--app-shadow); overflow: hidden; margin: 12px 0;
  }
  .li {
    display: flex; align-items: center; gap: 12px; min-height: 58px;
    padding: 11px 14px; text-decoration: none; color: var(--ink);
    border-bottom: 1px solid var(--app-line);
    -webkit-tap-highlight-color: transparent; position: relative;
  }
  .li:last-child { border-bottom: 0 }
  .li:active { background: var(--paper2) }
  .li-i {
    flex: none; width: 34px; height: 34px; display: flex; align-items: center;
    justify-content: center; background: var(--paper2); color: var(--ink2);
    border-radius: 8px;
  }
  .li-i.acc { background: var(--accent-bg); color: var(--accent) }
  .li-i.ok { background: var(--ok-bg); color: var(--ok) }
  .li-b { flex: 1; min-width: 0 }
  .li-t {
    font-size: 15.5px; font-weight: 700; line-height: 1.35;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .li-m {
    font-size: 12px; color: var(--ink3); line-height: 1.5; margin-top: 2px;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  }
  .li-go { flex: none; color: var(--ink4); display: flex; align-items: center }
  .li-num {
    flex: none; width: 22px; font-family: var(--mono); font-size: 11px;
    color: var(--ink4); text-align: right;
  }

  /* 分组标题（吸顶） */
  .lst-h {
    position: sticky; top: var(--app-sh); z-index: 5;
    display: flex; align-items: center; gap: 8px;
    padding: 14px 2px 6px; font-family: var(--mono); font-size: 10px;
    letter-spacing: .14em; color: var(--ink4);
    background: linear-gradient(var(--app-canvas) 72%, transparent);
  }

  /* ---------- 由网格降级来的入口列表 ---------- */
  .grid {
    display: block !important; background: var(--app-card); border-radius: var(--app-r);
    box-shadow: var(--app-shadow); overflow: hidden; margin: 12px 0;
  }
  .grid > .gi {
    display: block; position: relative; width: auto;
    padding: 14px 52px 14px 16px; border: 0; border-bottom: 1px solid var(--app-line);
    background: none; text-decoration: none; color: var(--ink);
    -webkit-tap-highlight-color: transparent;
  }
  .grid > .gi:last-child { border-bottom: 0 }
  .grid > .gi:active { background: var(--paper2) }
  .grid > .gi .n { font-size: 15.5px; font-weight: 700; line-height: 1.35 }
  .grid > .gi .m { font-size: 12px; color: var(--ink3); margin-top: 3px }
  .grid > .gi:after {
    content: ''; position: absolute; right: 18px; top: 50%; width: 7px; height: 7px;
    border-right: 1.7px solid var(--ink4); border-bottom: 1.7px solid var(--ink4);
    transform: translateY(-50%) rotate(-45deg);
  }
  .grid > .gi.empty .n { color: var(--ink3); font-weight: 400 }
  /* 两列卡片式入口（如产品三项）保留方块，但加圆角与投影 */
  .grid.tiles { display: grid !important; grid-template-columns: 1fr; gap: 10px;
    background: none; box-shadow: none; overflow: visible }
  .grid.tiles > .gi {
    background: var(--app-card); border: 0; border-radius: var(--app-r);
    box-shadow: var(--app-shadow); padding: 16px 40px 16px 16px;
  }

  /* ---------- 证据栏 / 参数格 ---------- */
  .ev {
    display: block; background: var(--app-card); border-radius: var(--app-r);
    box-shadow: var(--app-shadow); padding: 4px 0; margin: 14px 0; border: 0;
  }
  .ev > div {
    display: flex; align-items: baseline; gap: 12px;
    padding: 9px 16px; border-bottom: 1px solid var(--app-line);
  }
  .ev > div:last-child { border-bottom: 0 }
  .ev .k {
    flex: none; width: 76px; font-family: var(--mono); font-size: 10px;
    letter-spacing: .1em; color: var(--ink4); text-transform: none;
  }
  .ev .v { font-size: 13px; line-height: 1.55; color: var(--ink); min-width: 0 }
  .params { display: block !important; margin: 12px 0 }
  .params > .p {
    background: var(--app-card); border-radius: var(--app-r);
    box-shadow: var(--app-shadow); padding: 14px 16px; margin-bottom: 10px;
  }
  .params > .p .k {
    font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--ink4);
  }
  .params > .p .v { font-size: 15.5px; font-weight: 700; line-height: 1.5; margin-top: 4px }
  .params > .p .s { font-size: 11px; color: var(--ink4); margin-top: 6px }

  /* ---------- 统计格 ---------- */
  .stats { gap: 10px; margin: 12px 0 }
  .stat {
    background: var(--app-card); border: 0; border-radius: var(--app-r);
    box-shadow: var(--app-shadow); padding: 14px 15px;
  }
  .stat .n { font-size: 27px; letter-spacing: -.02em; font-variant-numeric: tabular-nums }
  .stat .l { font-size: 11.5px; color: var(--ink3) }




  /* ---------- 迎检清单：隐藏原方框格，用伪元素画，去掉重复的「检查项」标签 ---------- */
  table.t.stack.chk-tbl tr { padding: 13px 16px 14px }
  table.t.stack.chk-tbl td:nth-child(1) { display: none }
  table.t.stack.chk-tbl td:nth-child(2) {
    display: block; padding: 0 0 0 26px; position: relative;
    font-size: 14px !important; line-height: 1.6;
  }
  table.t.stack.chk-tbl td:nth-child(2)::before {
    content: '' !important; position: absolute; left: 0; top: 3px;
    width: 15px; height: 15px; border: 1.5px solid var(--rule2);
    border-radius: 3px; background: #fff; display: block !important;
    font-size: 0; line-height: 0;
  }
  table.t.stack.chk-tbl td:nth-child(3) { display: block; padding: 7px 0 0 26px }
  table.t.stack.chk-tbl td:nth-child(3)::before { display: none !important }
  table.t.stack.chk-tbl td.clause {
    font-family: var(--mono) !important; font-size: 10px !important;
    color: var(--ink4) !important; background: none;
  }

  /* ---------- 五字释义表：字与字母并排 ---------- */
  table.t.stack.name-tbl tr { padding: 15px 16px }
  table.t.stack.name-tbl td.k {
    display: inline-block; font-size: 30px; line-height: 1.1;
    padding: 0; margin-right: 9px; vertical-align: baseline;
  }
  table.t.stack.name-tbl td:nth-child(2) {
    display: inline-block; margin: 0; padding: 0; vertical-align: baseline;
    font-family: var(--mono); font-size: 11px; color: var(--ink4); letter-spacing: .1em;
  }
  table.t.stack.name-tbl td:nth-child(2):before { display: none }
  table.t.stack.name-tbl td:nth-child(3) {
    display: block; margin-top: 9px; padding: 0; font-size: 14px;
  }
  table.t.stack.name-tbl td:nth-child(3):before,
  table.t.stack.name-tbl td:nth-child(4):before {
    display: block; font-family: var(--mono); font-size: 9px; letter-spacing: .12em;
    color: var(--ink4); margin-bottom: 3px;
  }
  table.t.stack.name-tbl td:nth-child(4) { display: block; padding: 9px 0 0 }

  /* ---------- 折叠条目（认定机构按省） ---------- */
  .acc {
    background: var(--app-card); border-radius: var(--app-r);
    box-shadow: var(--app-shadow); margin-bottom: 10px; overflow: hidden;
  }
  .acc > summary {
    display: flex; align-items: center; gap: 9px; min-height: 56px;
    padding: 12px 14px; list-style: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .acc > summary::-webkit-details-marker { display: none }
  .acc > summary:active { background: var(--paper2) }
  .acc-t { font-size: 15.5px; font-weight: 700; flex: 1; min-width: 0 }
  .acc-n { font-family: var(--mono); font-size: 11px; color: var(--ink4) }
  .acc-i { color: var(--ink4); transition: transform .2s ease }
  .acc[open] > summary { border-bottom: 1px solid var(--app-line) }
  .acc[open] .acc-i { transform: rotate(180deg) }
  .acc-b { padding: 12px 14px 14px }
  .acc-b .co-m { font-size: 14px; line-height: 1.7; padding: 4px 0 }
  .acc-src {
    font-size: 12px; line-height: 1.6; color: var(--ink2);
    padding: 9px 0; border-top: 1px solid var(--app-line); margin-top: 8px;
  }
  .acc-src span {
    display: block; font-family: var(--mono); font-size: 9.5px; color: var(--ink4);
    margin-top: 2px;
  }
  .acc-go {
    display: inline-flex; align-items: center; gap: 5px; margin-top: 10px;
    min-height: 38px; padding: 0 14px; border-radius: 19px;
    background: var(--accent-bg); color: var(--accent);
    font-size: 13px; font-weight: 700; text-decoration: none;
  }

  /* ---------- 城市对比卡 ---------- */
  .cmpc { display: block; text-decoration: none; color: var(--ink) }
  .cmpc:active { background: var(--paper2) }
  .cmpg > div {
    display: flex; align-items: baseline; gap: 10px; padding: 7px 0;
    border-bottom: 1px solid var(--app-line);
  }
  .cmpg > div:last-child { border-bottom: 0 }
  .cmpg .k {
    flex: none; width: 108px; font-size: 11.5px; color: var(--ink3); line-height: 1.45;
  }
  .cmpg .v { font-size: 13.5px; line-height: 1.5; min-width: 0 }
  .cmpgo {
    display: flex; align-items: center; gap: 4px; justify-content: flex-end;
    margin-top: 10px; font-family: var(--mono); font-size: 10px;
    letter-spacing: .06em; color: var(--accent);
  }

  /* ---------- 分段控件 / 胶囊 ---------- */
  .seg {
    display: flex; gap: 4px; padding: 3px; margin: 12px 0;
    background: rgba(19, 22, 27, .06); border-radius: 9px;
  }
  .seg button, .seg a {
    flex: 1; min-height: 34px; border: 0; background: none; border-radius: 7px;
    font-family: inherit; font-size: 13px; color: var(--ink2); text-decoration: none;
    display: flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent;
  }
  .seg .on {
    background: var(--app-card); color: var(--ink); font-weight: 700;
    box-shadow: 0 1px 3px rgba(19, 22, 27, .10);
  }
  .pill {
    display: inline-flex; align-items: center; gap: 5px; height: 24px;
    padding: 0 9px; border-radius: 12px; font-size: 11px;
    background: var(--paper2); color: var(--ink2); white-space: nowrap;
  }
  .pill.a { background: var(--accent-bg); color: var(--accent) }
  .pill.b { background: var(--warn-bg); color: var(--warn) }
  .pill.c { background: var(--paper2); color: var(--ink3) }
  .pill.ok { background: var(--ok-bg); color: var(--ok) }

  /* ---------- Hero ---------- */
  .mhero { padding: 20px 2px 6px }
  .mhero .eyebrow { font-size: 9.5px; letter-spacing: .16em }
  .mhero h1 {
    font-size: 27px; line-height: 1.28; margin-top: 8px; letter-spacing: -.015em;
  }
  .mhero .lead {
    font-size: 13.5px; line-height: 1.8; color: var(--ink2); margin-top: 10px;
  }

  /* KPI 两列 */
  .kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 }
  .kpi > div {
    background: var(--app-card); border-radius: var(--app-r);
    box-shadow: var(--app-shadow); padding: 14px 15px;
  }
  .kpi .n {
    font-size: 27px; font-weight: 700; line-height: 1.05; letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
  }
  .kpi .n small { font-size: 12px; font-weight: 400; color: var(--ink3); margin-left: 2px }
  .kpi .l { font-size: 11.5px; color: var(--ink3); line-height: 1.4; margin-top: 6px }

  /* ---------- 大按钮 ---------- */
  .btn-block {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; min-height: 50px; margin: 12px 0 0;
    background: var(--accent); color: #fff; border: 0; border-radius: var(--app-r);
    font-family: inherit; font-size: 16px; font-weight: 700; text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .btn-block:active { transform: scale(.985); background: #962E17 }
  .btn-block.ghost { background: var(--app-card); color: var(--ink); box-shadow: var(--app-shadow) }

  /* ---------- 正文页排版（指南 / 关于 / 声明） ---------- */
  .wrap > .sec { padding: 18px 0 }
  .sec-h { border-bottom: 0; padding-bottom: 2px; margin-bottom: 4px }
  .sec-h .l { font-size: 9.5px; letter-spacing: .14em }
  .sec-h h2 { font-size: 17px; letter-spacing: -.01em }
  .guide-main h2 { font-size: 17px }
  .guide-main p, .guide-main ul, .guide-main ol { font-size: 14.5px; line-height: 1.92 }

  /* 段落放进卡片，避免长文在画布上散开 */
  .card > p:first-child { margin-top: 0 }
  .card > p:last-child { margin-bottom: 0 }

  /* 面包屑在 App 里不再显示，由应用栏返回键承担 */
  .crumb { display: none }

  /* 页脚：只保留法务说明，链接组收进「更多」弹层 */
  .foot { margin-top: 20px; padding: 0 0 8px }
  .foot .cols { display: none }
  .foot .disc {
    font-size: 10.5px; line-height: 1.85; color: var(--ink4);
    background: transparent; border-top: 1px solid var(--app-line); padding-top: 12px;
  }

  /* 次级导航改为横向 chip 组，吸在应用栏下方 */
  .subnav {
    position: sticky; top: var(--app-sh); z-index: 7;
    background: var(--app-canvas); margin: 0 -14px; padding: 8px 14px;
    display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none;
    border-bottom: 1px solid var(--app-line);
  }
  .subnav::-webkit-scrollbar { display: none }
  .subnav a {
    flex: 0 0 auto; height: 32px; padding: 0 13px; display: flex;
    align-items: center; border-radius: 16px; background: var(--app-card);
    border: 1px solid var(--app-line); font-size: 12.5px; color: var(--ink2);
    text-decoration: none;
  }
  .subnav a.on {
    background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700;
  }

  /* 表格在 App 里默认不出现，改由 .only-mob 列表承载 */
  .tbl-desk { display: none !important }

  /* 按下反馈统一 */
  a, button { -webkit-tap-highlight-color: transparent }
  .li:active, .card:active { }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .sheet, .tab .ic, .btn-block { transition: none !important }
}
