/* 联系我 (contact.html): one quiet centred column, phones first. Tokens come from tokens.css / appearance.css.
   Shares its frame with support.html (same rules in support.css): 560px column, centred hero, five type levels,
   the form as the page's only solid card. */
* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--study-background, var(--page-1));
  font-family: "Noto Sans SC", "Noto Sans JP", "PingFang SC", "Hiragino Sans", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
}
/* The frame: gutters on <main>; on wide screens nav.css adds the companion rail as padding-right, so Sandy's dock never
   sits on the form. Every child is the same centred 560px column. */
.contact-app { width: calc(100% - 2 * var(--layout-gutter)); min-width: 0; margin: 0 auto; padding: var(--space-5) 0 var(--space-6); }
.contact-app > * { width: min(560px, 100%); margin-inline: auto; }
.contact-app > * + * { margin-top: var(--space-6); }

/* Hero: the learner's cat, headline, intro and a quiet footnote, all centred */
.contact-hero { display: grid; justify-items: center; text-align: center; }
.contact-cat { width: 96px; height: 96px; }
.contact-title { margin: var(--space-3) 0 0; word-break: keep-all; line-break: strict; text-wrap: balance; }
.contact-sub { max-width: 28em; margin: var(--space-2) 0 0; color: var(--ink-2); font-size: 1rem; line-height: 1.7; word-break: keep-all; line-break: strict; text-wrap: balance; }
.contact-foot { max-width: 34em; margin: var(--space-2) 0 0; color: var(--muted); font-size: .8rem; line-height: 1.8; text-wrap: balance; }

/* The form (and the thanks state in its place): the page's only solid card */
.contact-panel { display: grid; gap: var(--space-4); min-width: 0; padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.contact-panel[hidden] { display: none; }
.contact-label { padding: 0; color: var(--ink); font-size: .9rem; font-weight: 500; }
.contact-kinds { min-width: 0; margin: 0; padding: 0; border: 0; }
.contact-kinds .contact-label { margin-bottom: var(--space-2); }
.contact-kind-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.contact-kind { position: relative; display: block; min-width: 0; }
.contact-kind input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.contact-kind span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: var(--space-2) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-pill); color: var(--ink-2); background: var(--surface); font-size: .84rem; line-height: 1.4; text-align: center; cursor: pointer; }
.contact-kind span:hover { border-color: var(--blue-600); }
.contact-kind input:checked + span { border-color: var(--blue-600); box-shadow: inset 0 0 0 1px var(--blue-600); color: var(--ink); background: var(--tint-1); font-weight: 500; }
.contact-kind input:focus-visible + span { outline: 3px solid var(--accent-focus); outline-offset: 2px; }
.contact-cat-help { padding: var(--space-3) var(--space-4); border: 1px dashed var(--line); border-radius: 12px; background: var(--tint-1); }
.contact-cat-help[hidden] { display: none; }
.contact-cat-help p { margin: 0 0 var(--space-2); color: var(--ink-2); font-size: .8rem; }
.contact-prompts { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.contact-prompt { min-height: 44px; padding: var(--space-1) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-pill); color: var(--ink); background: var(--surface); font: inherit; font-size: .8rem; cursor: pointer; }
.contact-prompt:hover { border-color: var(--blue-600); }
.contact-prompt:focus-visible { outline: 3px solid var(--accent-focus); outline-offset: 2px; }
.contact-field { display: grid; gap: var(--space-2); min-width: 0; }
.contact-field textarea, .contact-field input { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--control-line, var(--muted)); border-radius: var(--radius-control); color: var(--ink); background: var(--surface); font: inherit; font-size: 1rem; line-height: 1.6; }
.contact-field textarea { min-height: 140px; resize: vertical; }
.contact-field input { min-height: 48px; }
.contact-field textarea::placeholder, .contact-field input::placeholder { color: var(--muted); opacity: .85; }
.contact-field textarea:focus-visible, .contact-field input:focus-visible { outline: 3px solid var(--accent-focus); outline-offset: 2px; }
.contact-field [aria-invalid="true"] { border-color: var(--bad); }
.contact-count { margin: 0; color: var(--muted); font-size: .8rem; text-align: right; font-variant-numeric: tabular-nums; }
.contact-count[data-over="true"] { color: var(--bad); font-weight: 500; }
.contact-help { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.8; }
.contact-status { margin: 0; color: var(--ink-2); font-size: .84rem; line-height: 1.7; }
.contact-status:empty { display: none; }
.contact-status[data-error="true"] { padding: 10px 12px; border: 1px solid var(--bad-line); border-radius: 12px; color: var(--bad); background: var(--bad-bg); }
/* Send + privacy note sit together: the note hangs --space-2 under the button */
.contact-actions { display: grid; gap: var(--space-2); }
.contact-send { width: 100%; min-height: 48px; font-size: .95rem; }
.contact-send:disabled { opacity: .7; cursor: progress; }
/* Off-screen, not display:none: some bots skip fields that are display:none. */
.contact-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-success { justify-items: center; text-align: center; }
.contact-success-cat { width: 96px; height: 96px; }
.contact-thanks { margin: 0; color: var(--ink); font-size: 1.1rem; font-weight: 500; line-height: 1.6; text-wrap: balance; }
.contact-thanks:focus { outline: none; }
.contact-again { min-width: 160px; min-height: 48px; }

/* The one quiet link to the support page */
.contact-support-link { margin-bottom: 0; text-align: center; }
.contact-support-link a { display: inline-flex; align-items: center; min-height: 44px; color: var(--blue-600); font-size: .92rem; font-weight: 500; text-underline-offset: 4px; }
.contact-support-link a::after { content: "\00a0›"; }
.contact-support-link a:focus-visible { outline: 3px solid var(--accent-focus); outline-offset: 2px; border-radius: 6px; }

@media (min-width: 681px) {
  /* Pills size to their words, so the English "Something's wrong in the content" stays on one line */
  .contact-kind-grid { display: flex; flex-wrap: wrap; }
  .contact-kind span { white-space: nowrap; }
}
@media (max-width: 680px) {
  .contact-app > * + * { margin-top: var(--space-5); }
  .contact-cat { width: 72px; height: 72px; }
  .contact-panel { padding: var(--space-4); }
  .contact-kind span { padding-inline: var(--space-2); }
}

/* Sandy's animated head-tilt, laid over the still pose (inline script on the page) */
.hero-sandy-anim { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
