/* PetsMinder 静态页 H5 / 移动端适配（privacy、delete-account 共用） */

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --touch-min: 44px;
}

html {
  scroll-behavior: smooth;
}

body {
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  overflow-x: hidden;
}

.top {
  padding-top: var(--safe-top);
}

.top-inner {
  min-height: var(--touch-min);
}

button,
.lang button,
.auth-tabs button,
.btn-primary,
.btn-secondary,
a.brand {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.lang button,
.auth-tabs button {
  min-height: 36px;
}

.btn-primary,
.btn-secondary {
  min-height: var(--touch-min);
}

.confirm-row {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.confirm-row input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.field input,
.field select,
.field textarea {
  font-size: 16px;
  min-height: var(--touch-min);
}

.table-wrap {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
  main {
    padding: 1.25rem 1rem calc(2.5rem + var(--safe-bottom));
  }

  .top-inner {
    padding: 0.625rem 1rem;
    gap: 0.625rem;
    flex-wrap: wrap;
  }

  .top-links {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    margin-bottom: 1.5rem;
  }

  .hero h1 {
    font-size: 1.375rem;
    line-height: 1.35;
  }

  .intro,
  .hero p {
    font-size: 0.9375rem;
    line-height: 1.65;
  }

  nav.toc,
  .info-box,
  .card {
    padding: 1rem 1.125rem;
    border-radius: 10px;
  }

  nav.toc a,
  .info-box {
    font-size: 0.875rem;
  }

  article h2 {
    font-size: 1.0625rem;
    padding-top: 1.5rem;
  }

  article h3 {
    font-size: 0.9375rem;
  }

  article h4 {
    font-size: 0.875rem;
  }

  table {
    font-size: 0.75rem;
  }

  th {
    white-space: normal;
  }

  th,
  td {
    padding: 0.5rem 0.6rem;
  }

  .table-wrap {
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    border-radius: 8px;
  }

  .auth-tabs button {
    min-height: var(--touch-min);
    font-size: 0.8125rem;
    padding: 0.5rem 0.5rem;
  }

  .code-row {
    flex-direction: column;
    gap: 0.625rem;
  }

  .code-row .btn-secondary {
    width: 100%;
    padding: 0.65rem 1rem;
  }

  .btn-primary {
    padding: 0.875rem 1rem;
    font-size: 1rem;
  }

  footer {
    margin-top: 2rem;
    padding-bottom: var(--safe-bottom);
    line-height: 1.6;
  }
}

@media (max-width: 380px) {
  .lang button {
    padding: 0.4rem 0.65rem;
    font-size: 0.75rem;
  }

  .brand {
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
